var StartID=0;
var isVis=1;
var isStartDivOpen=0;
var LastOver=0;
var isAutoChangeStart=0;
var isMotion=0;

function nnn(){}

function divMotion(){
	TDiv.style.clip="rect(0px, 1px, 1px, 0px)";
	isMotion=1;
	for(var i=0;i<90;i++){
		setTimeout("divMotion2("+i+");",i*15);
	}
}
function divMotion2(w8){
	TDiv.style.clip="rect(0px, 200px, "+(20+(w8*3))+"px, 0px)";
}
function divMotion3(w8){
	divMotion2(w8);
	if (w8==1) {
		TDiv.style.visibility = "hidden";
		isMotion=0;
	}
}

function dodiv(){
	location = 'http://www.motophones.co.il/ComparisonP4.aspx?Oparator=4';
//	if (!isMotion) divMotion();
//	TDiv.style.visibility = "visible";
//	isVis=1;
//	GetList();
}
function GetList(){
	var maxItem=9;
	if (Phone.length<maxItem) maxItem=Phone.length;
	LastOver=0;
	var ThisID=0;
	ThisA= new Object();
	for(var i=0;i<maxItem;i++){
		ThisID=StartID+i;
		if (ThisID<0) ThisID=ThisID+Phone.length;
		if (ThisID>Phone.length-1) ThisID=ThisID-Phone.length;
		ThisA=eval("a"+(i+1));
		ThisA.innerHTML="<A HREF='PhonesP1.aspx?CP1="+PhoneBarID[ThisID]+"'><FONT SIZE='2'>&nbsp;&nbsp;&nbsp;&nbsp;<B>"+Phone[ThisID]+"</B><BR></A>";
	}
}
function AutoChangeStart(CValue){
	isAutoChangeStart=1;
	ChangeStart(CValue);
}
function EndChangeStart(){
	isAutoChangeStart=0;
}
function ChangeStart(CValue){
	StartID=StartID+CValue;
	if (StartID<0) StartID=StartID+Phone.length;
	if (StartID>Phone.length-1) StartID=StartID-Phone.length;
	GetList();
	if (isAutoChangeStart==1) setTimeout("ChangeStart("+CValue+");",200);

}
function outdiv(){
	if (isVis==1){
		LastOver=1;
		setTimeout("CloseDiv();",4000);
	}
}
function CloseDiv(){
	if (LastOver==1 && isStartDivOpen==0){
		isVis=0;
		for(var i=0;i<100;i++){
			setTimeout("divMotion3("+(100-i)+");",i*15);
		}
	}else
		outdiv();
}
var barTSt="<TABLE BACKGROUND='Images/HP05_Over.gif' BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD HEIGHT=18 WIDTH=105>";
var barTEn="</TD></TR></TABLE>";
var oldbarT="";
var oldShineBG=0;
function StopDivOpen(){
	isStartDivOpen=0;
	if (oldShineBG>0) StopShine();
}
function StartDivOpen(ShineBG){
	isStartDivOpen=1;
	if (ShineBG>0 && oldShineBG!=ShineBG){
		if (oldShineBG>0) StopShine();
		eval("oldbarT=a"+ShineBG+".innerHTML");
		oldShineBG=ShineBG;
		eval("a"+ShineBG+".innerHTML=barTSt+a"+ShineBG+".innerHTML+barTEn");
	}
}

function StopShine(){
	eval("a"+oldShineBG+".innerHTML=oldbarT");
	oldShineBG=0;
}
