/*****************************************
 *
 ****************************************/

      /******** MY cells *******/

/** global images for menu hover ***/
var menuHovers = ['/img2/figure_1_a.gif','/img2/figure_2_a.gif','/img2/figure_3_a.gif','/img2/figure_4_a.gif','/img2/figure_5_a.gif','/img2/figure_6_a.gif'];

/*** global URLs ****/
var Clicks=['http://www.tessanet.ru','http://www.tessaexpo.ru','http://www.tessapro.ru','#','http://www.tessadesign.ru','http://www.tessapack.ru'];

/******** globasl classes for hover emulation ****/
var classes = ['purple','purple','red','blue','orange','yellow'];
var classes2 = ['p','p','p','blue','p','p'];

function el(id){
         return document.getElementById(id);
}


function getNumericId(element){
    thisIdStr = element.getAttribute('id');
    return thisIdStr.replace(/[a-z_]*/,'');
}


function makeactive(){
    head = el('header');

    var counter =0;
    for(i in head.childNodes){

        if(head.childNodes[i].tagName == 'DIV'){

         /*if(counter == 0){
             counter++;
             continue;
         }*/
        
	    head.childNodes[i].onmouseover = function(c){
	    thisId = getNumericId(this);
	
	    this.style.backgroundImage="url("+ eval('"'+ menuHovers[thisId]+'"') +")";
	    this.onclick = function(){ location.href= eval('"'+ Clicks[thisId]+'"') ; return false; };
	    el('menu_item_' + thisId).className = eval('"menu_cell_' + classes[thisId] + '"');
	    };
	    head.childNodes[i].onmouseout = function(){
		this.removeAttribute('style');
		thisId = getNumericId(this);
		el('menu_item_' + thisId).className = eval('"menu_cell_' + classes2[thisId] + '"');//"menu_cell_p";
	    };
	    counter++;
         }

    }
/*
         if(!document.getElementById("topmenu")) return;
         var lis = document.getElementById("topmenu").getElementsByTagName("LI");
         for (var i=0;i<lis.length;i++){
                  lis[i].onmouseover=function(){
                           this.className+=" iehover";
                  }
                  lis[i].onmouseout=function() {
                           this.className=this.className.replace(new RegExp(" iehover\\b"), "");
                  }
         }


         document.getElementById('gordi').style.zoom=1;
         document.getElementById('center').style.zoom=1;
         document.getElementById('right').style.zoom=1;
         document.getElementById('left').style.zoom=1;
		 */
}

if(window.attachEvent){
        window.attachEvent("onload", makeactive);
}else{
        window.onload=makeactive;
}



function showhide(id){ 
                var el_1 = document.getElementById('maptxt');
				var el_2 = document.getElementById('form');
				
				switch (id) {
				case 1: el_1.style.display = 'block';
				        el_2.style.display = 'none';
						break;
				case 2: el_1.style.display = 'none';
				        el_2.style.display = 'block';
						break;	
						}	
               
        }


