function menuOver(num)
{
objectL = document.getElementById("ml"+num);
objectR = document.getElementById("mr"+num);
objectT = document.getElementById("mt"+num);
objectL.style.cursor="hand";
objectR.style.cursor="hand";
objectL.style.backgroundColor='#f3f8ff';
objectR.style.backgroundColor='#f3f8ff';
objectT.style.color='#004e7b';
}     
function menuOut(num)
{
objectL = document.getElementById("ml"+num);
objectR = document.getElementById("mr"+num);
objectT = document.getElementById("mt"+num);
objectL.style.backgroundColor='#ffffff';
objectR.style.backgroundColor='#ffffff';
objectT.style.color='#0396b8';
}

function ch_value(e)
{
	var n, v = '';
	for (i=0; i<e.length; i++)
	{
		if (e[i].checked)
		{
			n = i;
			v = e[i].value; 
		}
	}
	return v;
}


function choiseCity(form_name, form_element, form_region){
	y=screen.height/2-125;
	x=screen.width/2-135;                
	win=window.open("/choisecity/"+form_name+"/"+form_element+"/"+form_region,"cities","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0, width=270,height=150,top="+y+",left="+x+"");
	//win=window.open("choisecity/form/element/region","cities","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0, width=270,height=150,top="+y+",left="+x+"");
}

function choiseStreet(form_name, form_element, city, type){  
	y=screen.height/2-125;
	x=screen.width/2-135;			 
	win=window.open("/choiseaddress/"+form_name+"/"+form_element+"/"+city+"/"+type,"streets","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0, width=270,height=180,top="+y+",left="+x+"");	
}

cm=null; 
hide_delay=200;  
tstat=0;  

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

function switchDiv(objElement,bolVisible){
if(isNS4||isIE4){
     if(!bolVisible) {
       objElement.visibility ="hidden";
     } else {
       objElement.visibility ="visible";
     }     
 } else if (isIE5 || isNS6) {
      if(!bolVisible){
         objElement.style.display = "none";
         
      } else {
        objElement.style.display = "";
        
        }

      }

return 1;
}

function getPos(el,sProp) {
	var iPos = 0;
	while (el!=null) {
		iPos+=el["offset" + sProp];
		el = el.offsetParent;
	}
	return iPos;

}

function getelementbyid(myid) {
   if (isNS4){
        objElement = document.layers[myid];
     }else if (isIE4) {
        objElement = document.all[myid];
     }else if (isIE5 || isNS6) {
             objElement = document.getElementById(myid);
     }
return(objElement);
}

function show(el,m) {

 if (cm!=null) {
 switchDiv(cm,false);
 }


if (m!=null) {
tm=m;
m=getelementbyid(m);
m.style.left = getPos(el,"Left")+"px";
az=158-Math.round(((document.body.clientWidth-917)/10)+0.7);
if(tm=="service"){
m.style.left = (getPos(el,"Left")-az)+"px";
m.style.top =  getPos(el,"Top")+el.offsetHeight+"px";
}
else{
m.style.left = (getPos(el,"Left")+181)+"px";
m.style.top =  getPos(el,"Top")+el.offsetHeight-30+"px";
}

 switchDiv(m,true);
 cm=m;
 }

}

function hidemenu() {

timer1=setTimeout("show(null,null)",hide_delay);

tstat=1;

return 1;
}


function cancelhide() {
 if (tstat==1) {
 clearTimeout(timer1);
 tstat=0;
 }
return 1;
}


