
//simplePreload( '/images/p_menu_about_a.gif', '/images/p_menu_news.gif','/images/p_menu_model_a.gif','/images/p_menu_service_a.gif','/images/p_menu_salon_a.gif'); 
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
// alert(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function ChangeTopMenuColor(active,id)
{
	if (active)
	{
		if (document.getElementById('cell'+id).style.cursor) document.getElementById('cell'+id).style.cursor="pointer";
		document.getElementById('cell'+id).style.backgroundColor="#5C86AE";
		document.getElementById('imgTM'+id).src="/img/arrow_white.gif";
		document.getElementById('linkTM'+id).style.color="#FFFFFF";
	}
	else
	{
		document.getElementById('cell'+id).style.backgroundColor="";
		document.getElementById('linkTM'+id).style.color="";
		document.getElementById('imgTM'+id).src="/img/arrow_blue.gif";		
	}
}

function ChangeSubMenuColor(active,id)
{
	if (active)
	{
		if (document.getElementById('cell'+id).style.cursor) document.getElementById('cell'+id).style.cursor="pointer";
		document.getElementById('cell'+id).style.backgroundColor="#5C86AE";
		document.getElementById('imgTM'+id).src="/images/p_2levmenu_barr_a.gif";
		document.getElementById('linkTM'+id).style.color="#FFFFFF";
	}
	else
	{
		document.getElementById('cell'+id).style.backgroundColor="";
		document.getElementById('linkTM'+id).style.color="";
		document.getElementById('imgTM'+id).src="/images/p_2levmenu_barr.gif";		
	}
}

function ChColor (cellid,FileName){
document.getElementById('cell'+cellid).style.backgroundColor="#5C86AE";
if (document.getElementById('cell'+cellid).style.cursor) document.getElementById('cell'+cellid).style.cursor="pointer";
//ChLinkColor(cellid);
ChIm(cellid,FileName);
}
function ChColorBack (cellid,FileName){
document.getElementById('cell'+cellid).style.backgroundColor="";
//ChLinkColorBack(cellid);
ChIm(cellid,FileName);
}

function ChLinkColor(linkid){
document.getElementById('menulink'+linkid).style.color="#ffffff";
}
function ChLinkColorBack(linkid){
document.getElementById('menulink'+linkid).style.color="#576d76";
}
function ChIm(imgName,FileName){
document.images['arr'+imgName].src="/files/"+FileName;
}
function PosLogoLink (){

	if (document.all){
	w=document.body.scrollWidth;
	}else{
	w=document.width;
	}
	posX=w/2+235;
	if (document.getElementById('logolink')){
	//alert("yes!");
	document.getElementById('logolink').style.left=posX+"px";
	}
	
}
window.onload=PosLogoLink;
window.onresize=PosLogoLink;

function ChSubLink (cellid, menu){
	if (menu=="sub"){
	//document.getElementById('subcell'+cellid).style.backgroundColor="#E9E9EB";
	document.getElementById('subcell'+cellid).style.cursor="pointer";
	document.getElementById('sublink'+cellid).style.fontWeight="bold";
	document.images['subarr'+cellid].src="images/p_2levmenu_arr_a.gif";
	
	}else{
	document.getElementById('subsubcell'+cellid).style.backgroundColor="#E9E9EB";
	document.getElementById('subsubcell'+cellid).style.cursor="pointer";
	document.getElementById('subsubcell'+cellid).style.color="fffdff";
	//document.images['subarr'+cellid].src="images/p_2levmenu_arr";
	}

}
function ChSubLinkBack (cellid, menu){
	if (menu=="sub"){
	//document.getElementById('subcell'+cellid).style.backgroundColor="#E9E9EB";
	document.getElementById('subcell'+cellid).style.cursor="pointer";
	document.getElementById('sublink'+cellid).style.fontWeight="normal";
	document.images['subarr'+cellid].src="/images/p_2levmenu_arr.gif";
	
	}else{
	document.getElementById('subsubcell'+cellid).style.backgroundColor="#E9E9EB";
	document.getElementById('subsubcell'+cellid).style.cursor="pointer";
	document.getElementById('subsubcell'+cellid).style.color="fffdff";
	//document.images['subarr'+cellid].src="images/p_2levmenu_arr";
	}

}
function OpenWin (){
window.open ('colors_window.html','win','width=490,height=330');
}
function ChangeImage (ImgName,fileName){
document.images[ImgName].src="/files/"+fileName;
}
function OpenBigModel (ImName,TitTxt){
var msgWin=window.open('about:blank','window2','width=750,height=600');
msgWin.document.write("<html><head><title>"+TitTxt+"</title></head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' bgcolor='#000000'><table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'><a href='javascript:window.close();'><img src='"+ImName+"' border='0'></a></td></tr></table></body></html>")

//window.open (Fname+'.html','win','width=750,height=563');
}

function OpenWinMap (ImName,TitTxt){
var msgWin=window.open('about:blank','window3','width=450,height=340');
msgWin.document.write("<html><head><title>"+TitTxt+"</title></head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' bgcolor='#FFFFFF'><table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'><a href='javascript:window.close();'><img src='"+ImName+"' border='0'></a></td></tr></table></body></html>")
}

function OpenWinImg (ImName,TitTxt,width,height){
var msgWin=window.open('about:blank','window4','width='+width+',height='+height);
msgWin.document.write("<html><head><title>"+TitTxt+"</title></head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' bgcolor='#FFFFFF'><table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'><a href='javascript:window.close();'><img src='"+ImName+"' border='0'></a></td></tr></table></body></html>")
}



function zxcLeft(zxc){
 zxcObjLeft=zxc.offsetLeft;
 while(zxc.offsetParent!=null){
  zxcObjParent=zxc.offsetParent;
  zxcObjLeft+=zxcObjParent.offsetLeft;
  zxc=zxcObjParent;
 }
 return zxcObjLeft;
}

function zxcTop(zxc){
 zxcObjTop=zxc.offsetTop;
 while(zxc.offsetParent!=null){
  zxcObjParent=zxc.offsetParent;
  zxcObjTop+=zxcObjParent.offsetTop;
  zxc=zxcObjParent;
 }
 return zxcObjTop;
}


var HideMenuFlags=Array();
var MenuPosition=Array();

function doHideMenu(divid){
	if (document.getElementById(divid)) if (document.getElementById(divid).style.visibility!="hidden") document.getElementById(divid).style.visibility="hidden";
}

function HideMenu(divid){
	if (!HideMenuFlags[divid])
	{
		HideMenuFlags[divid]=setTimeout('doHideMenu("'+divid+'")',10);
	}
}
	
	
function ShowMenu(divid,el){
		if (HideMenuFlags[divid])
		{
			clearTimeout(HideMenuFlags[divid]);
			HideMenuFlags[divid]=false;
		}
		if (el && !MenuPosition[divid])	{
			var t = zxcTop(el);
			var l = zxcLeft(el);		
			if (document.getElementById(divid)) document.getElementById(divid).style.top = t - 2 + 'px';
			if (document.getElementById(divid)) document.getElementById(divid).style.left = l + 144 + 'px';
			MenuPosition[divid]=true;			
		}
		if (document.getElementById(divid)) if (document.getElementById(divid).style.visibility!="visible") document.getElementById(divid).style.visibility="visible";
	}
	
window.onresize=function(){
MenuPosition=Array();
}	
