function preloadImages(){
			var loadImage=new Array();
			var loadImage_over=new Array();
			
			var loadsubImage=new Array(mainpictures.length);
			var loadsubImage_over=new Array(mainpictures.length);
			
			for (i=0;i<mainpictures.length;i++){
				loadImage[i] = new Image();
				loadImage[i].src= root + "/_i/top_btn/" + mainpictures[i][0];
				
				loadImage_over[i] = new Image();
				loadImage_over[i].src= root + "/_i/top_btn/" + mainpictures[i][1];
			}
			
			for (i=1;i<subpictures.length;i++){
				for(j=0;j<subpictures[i].length;j++){
					loadsubImage[i] = new Image();
					loadsubImage[i].src= root + "/_i/top_btn/" + subpictures[i][j][0];
					
					loadsubImage_over[i] = new Image();
					loadsubImage_over[i].src= root + "/_i/top_btn/" + subpictures[i][j][1];
				}
			}

		}
		
		
		function overoutImage(image ,imageArray, element, statu){
			image.src = root + "/_i/top_btn/" + imageArray[element][statu];
		}
		
		function overoutsubImage(image ,imageArray, element, elementsub,statu){
			image.src = root + "/_i/top_btn/" + imageArray[element][elementsub][statu];
		}
		
		
		
		function showsubMenu(submenu){
			if (submenu!="-1"){
				document.getElementById("submenu_" + submenu).style.display="block";
			}
		}
		
		function hiddensubMenu(submenu){
			if (submenu!="-1"){
				document.getElementById("submenu_" + submenu).style.display="none";
			}
		}
		
		
		function MagicMenu(){
			this.menuArray;
			this.submenuArray;
			this.menuDiv;
			this.active;
		}
		
		MagicMenu.prototype.build=function(){
			var str="";
			
			str+="<ul>"
			for (i=0;i<this.menuArray.length;i++){
				str+="<li><a href='" + root + this.menuArray[i][2] + "'>";
					if (this.active==i){
						str+="<img src='"+ root +"/_i/top_btn/" + this.menuArray[i][1] + "' alt='' border='0' ";
						str+="onmouseover='showsubMenu(" + this.menuArray[i][3] + " );' ";
						str+="onmouseout='hiddensubMenu( " + this.menuArray[i][3] + ");' />";
					}
					else{
						str+="<img src='"+ root +"/_i/top_btn/" + this.menuArray[i][0] + "' alt='' border='0' ";
						str+="onmouseover='overoutImage(this, mainpictures ," + i + ", 1); showsubMenu(" + this.menuArray[i][3] + " );' ";
						str+="onmouseout='overoutImage(this, mainpictures," + i + ", 0); hiddensubMenu( " + this.menuArray[i][3] + ");' />";
					}
				
				str+="</a>";
				if (i!=this.menuArray.length-1){
					str+="<img src='"+ root +"/_i/top_btn/ayrac.png' width='1' height='22' alt='' />";
				}
				str+="</li>"
			}
			str+="</ul>"
			document.getElementById(this.menuDiv).innerHTML=str;
			
		}
		
		MagicMenu.prototype.subbuild=function(){
			var str="";
			var cwidth = 110;
			for (i=1;i<this.submenuArray.length;i++){
			if ( i< this.submenuArray.length-1)
				cwidth = this.menuArray[i+1][4] - this.menuArray[i][4]-2;
			else
				cwidth = 120;	
			str+="<div id='submenu_"  + i + "' class='bg_sub_menu' ";
			str+="style='display:none;position:absolute;top:70px;left:"+ this.menuArray[i][4] +"px;z-index:100;width:"+cwidth+"px;BACKGROUND-POSITION: left top;BACKGROUND-IMAGE: url(/_i/subbg.jpg); BACKGROUND-REPEAT: repeat x' >";
			str+="<table cellpadding='0' cellspacing='0' border='0'  style='' ";
			str+="onmouseover='showsubMenu("+ i +")' onmouseout='hiddensubMenu("+ i +")'>"
				for (j=0;j<this.submenuArray[i].length;j++){
                    if((j==0))
                    {
		    
					str+="<tr style='height:20px'><td  style='height:20px'><a href='"+ root + this.submenuArray[i][j][2] +"'><img src='"+ root +"/_i/top_btn/"+ this.submenuArray[i][j][0] +"' alt='' border='0' ";
					str+="onmouseover='overoutsubImage(this,subpictures,"+ i +" ," +j + ", 1)' ";
					str+="onmouseout='overoutsubImage(this,subpictures," + i + "," + j + ", 0)' /></a></td></tr>";
					}
					else
                    {	
	    				str+="<tr><td><a href='"+ root + this.submenuArray[i][j][2] +"' class='submenu' style='padding-left:1px'>"+this.submenuArray[i][j][0]+"</a></td></tr>";
					}
				}
			str+="</table>"
			str+="</div>"
			}
			
			document.getElementById(this.menuDiv).innerHTML=str;
	
		}