function parentPosition(ch) {

var valueT = 0, valueL = 0;

do
{
	valueT += ch.offsetTop || 0;
	valueL += ch.offsetLeft || 0;
	ch = ch.offsetParent;
} while (ch);
return [valueL, valueT];

}

function menu() {

	navRoot = document.getElementById("menu");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		
		if (node.nodeName=="LI") {
			
			  node.onmouseover=function() {
				this.className+=" over"; 
			  }
			  
			  node.onmouseout=function() {
				this.className=this.className.replace("over", ""); 
			  }
			  
			  tagA = document.getElementsByTagName("UL");
			  
			  for(a = 0; a < tagA.length; a++){
				  if (tagA[a].className == 'submenu') {
					  parentPosition(tagA[a]); 
				  }
			  }
	
		}
	}
	
	navRoot = document.getElementById("menu");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		
		if (node.nodeName=="LI") {
			
			  node.onmouseover=function() {
				this.className+=" over"; 
			  }
			  
			  node.onmouseout=function() {
				this.className=this.className.replace("over", ""); 
			  }
			  
			  tagA = document.getElementsByTagName("UL");
			  
			  for(a = 0; a < tagA.length; a++){
				  if (tagA[a].className == 'submenu') {
					  parentPosition(tagA[a]); 
				  }
			  }
	
		}
	}
}

function menu2() {

 

            navRoot = document.getElementById("menu2");

            for (i=0; i<navRoot.childNodes.length; i++) {

                        node = navRoot.childNodes[i];

                        

                        if (node.nodeName=="LI") {

                                    

                                      node.onmouseover=function() {

                                                this.className+="over"; 

                                      }

                                      

                                      node.onmouseout=function() {

                                                this.className=this.className.replace("over", ""); 

                                      }

                                      

                                      tagA = document.getElementsByTagName("UL");

                                      

                                      for(a = 0; a < tagA.length; a++){

                                                  if (tagA[a].className == 'submenu') {

                                                              parentPosition(tagA[a]); 

                                                  }

                                      }

            

                        }

            }

            

            navRoot = document.getElementById("menu2");

            for (i=0; i<navRoot.childNodes.length; i++) {

                        node = navRoot.childNodes[i];

                        

                        if (node.nodeName=="LI") {

                                    

                                      node.onmouseover=function() {

                                                this.className+=" over"; 

                                      }

                                      

                                      node.onmouseout=function() {

                                                this.className=this.className.replace("over", ""); 

                                      }

                                      

                                      tagA = document.getElementsByTagName("UL");

                                      

                                      for(a = 0; a < tagA.length; a++){

                                                  if (tagA[a].className == 'submenu') {

                                                              parentPosition(tagA[a]); 

                                                  }

                                      }

            

                        }

            }

}



function allf() {
menu();
menu2();
}
window.onload=allf;



if (document.images)
{
  pic1= new Image; 
  pic1.src="images/item_menu_over.jpg"; 

  pic2= new Image; 
  pic2.src="images/satellite_over.jpg";
  
  pic3= new Image; 
  pic3.src="images/wireless_over.jpg";
  
  pic4= new Image; 
  pic4.src="images/cont_img_2_over.jpg";
  
  pic5= new Image; 
  pic5.src="images/cont_img_3_over.jpg";
  
  pic6= new Image; 
  pic6.src="images/cont_img_4_over.jpg";
  
  pic7= new Image; 
  pic7.src="images/cont_img_5_over.jpg";
  
  pic8= new Image; 
  pic8.src="images/cont_img_6_over.jpg";
  
  pic9= new Image; 
  pic9.src="images/cont_img_7_over.jpg";
}

function bigg(id)
{
	obj = document.getElementById(id);
	ptr = obj.src;
	ptr = ptr.replace(/.jpg/,"_over.jpg");
	obj.src = ptr;
	obj.style.margin = "0";
	document.getElementById('pole').innerHTML = obj.alt;
}

function smal(id)
{
	obj = document.getElementById(id);
	ptr = obj.src;
	ptr = ptr.replace(/_over.jpg/,".jpg");
	obj.src = ptr;	
	obj.style.margin = "11px 0 0 11px";
}




