var ei=document.all?1:0
var has_layers=document.layers?1:0
var nn=document.getElementById&&!document.all?1:0
var num_of_layers=110
var step=10;
var speed=10

function close_all()
{
	var i;
	if(ei)
		for(i=1;i<=num_of_pics;i++)
			document.all('b'+i).style.display='none';
	else
		for(i=1;i<=num_of_pics;i++)
			document.getElementById('b'+i).style.display='none';
}

function pic_click(b, n)
{
	close_all();
	if(ei)
		document.all('b'+b).style.display='block';
	else
	{
		document.getElementById('b'+b).style.display='';
		document.getElementById('b'+b).style.right='200px';
		
	}
}

function over_sub_menu_cell(sm)
{
if(ei)
	document.all(sm).bgColor='#E3E3E3';
else
	document.getElementById(sm).bgColor='#E3E3E3';
}

function out_sub_menu_cell(sm)
{
if(ei)
	document.all(sm).bgColor='#FFFFFF';
else
	document.getElementById(sm).bgColor='#FFFFFF';
}

function click_sub_menu_cell(sm)
{
if(ei)
	document.all(sm).children.tags('A')[0].click();
}




var tp;
var tout=0;
//window.onload=Init;

function Init(){
        pnl=new ObjConstruct('ContactsInfo')
        if (has_layers||nn) scrolled="window.pageYOffset"
        else if (ei) scrolled="document.body.scrollTop"
	pnl.css.left=-pnl.width+num_of_layers
        if (has_layers||nn) tp=pnl.css.top
        else if (ei) tp=pnl.css.pixelTop
	pnl.css.visibility='visible'
	
}

function ObjConstruct(ob,ob2){
    ob2=(!ob2) ? '':'document.'+ob2+'.'
    if (has_layers) this.css=eval(ob2+'document.'+ob)
    else if (nn) this.css=document.getElementById(ob).style
    else if (ei) this.css=eval(ob+'.style')						
	this.state=1
	this.go=0
        if (has_layers) this.width=this.css.document.width
        else if (nn) this.width=document.getElementById(ob).offsetWidth
        else if (ei) this.width=eval(ob+'.offsetWidth')
	this.left=GetTop
    this.ob = ob + "Object"; 	eval(this.ob + "=this")	
}

function GetTop(){
        var Top;
        if (has_layers||nn){ Top=parseInt(this.css.left)}
        else if (ei){ Top=eval(this.css.pixelLeft)}
	return Top;
}

function PanelClick(){
	if(!pnl.state){
		clearTimeout(tout)
		MoveIn()	
	}else{
		clearTimeout(tout)
		MoveOut()
	}
}

function MoveIn(){
	if(pnl.left()>-pnl.width+num_of_layers){
		pnl.go=1
		pnl.css.left=pnl.left()-step
		tout=setTimeout("MoveIn()",speed)
	}else{
		pnl.go=0
		pnl.state=1
	}	
}

function MoveOut(){
	if(pnl.left()<0){
		pnl.go=1
		pnl.css.left=pnl.left()+step
		tp=setTimeout("MoveOut()",speed)
	}else{
		pnl.go=0
		pnl.state=0
	}	
}



