var zscrollerwidth=135;
var zscrollerheight=120;
var znPause=5000;
var zi=2;

function zmove1(zwhichlayer){
	ztlayer=eval(zwhichlayer);
	if (ztlayer.top>0&&ztlayer.top<=5){
		ztlayer.top=0;
		setTimeout("zmove1(ztlayer)",znPause);
		setTimeout("zmove2(document.zmain.document.zsecond)",znPause);
		return;
	}
	if (ztlayer.top>=ztlayer.document.height*-1){
		ztlayer.top-=5;
		setTimeout("zmove1(ztlayer)",100);
	}
	else{
		ztlayer.top=zscrollerheight;
		ztlayer.document.write(zpayam[i]);
		ztlayer.document.close();
		if (zi==zpayam.length-1) zi=0
		else zi++;
	}
}

function zmove2(zwhichlayer){
	ztlayer2=eval(zwhichlayer);
	if (ztlayer2.top>0&&ztlayer2.top<=5){
		ztlayer2.top=0;
		setTimeout("zmove2(ztlayer2)",znPause);
		setTimeout("zmove1(document.zmain.document.zfirst)",znPause);
		return;
	}
	if (ztlayer2.top>=ztlayer2.document.height*-1){
		ztlayer2.top-=5;
		setTimeout("zmove2(document.ztlayer2)",100);
	}
	else{
		ztlayer2.top=zscrollerheight;
		ztlayer2.document.write(zpayam[i]);
		ztlayer2.document.close();
		if (zi==zpayam.length-1) zi=0
		else zi++;
	}
}

function zmove3(zwhichdiv){
	ztdiv=eval(zwhichdiv);
	if (ztdiv.style.pixelTop>0&&ztdiv.style.pixelTop<=5){
		ztdiv.style.pixelTop=0;
		setTimeout("zmove3(ztdiv)",znPause);
		setTimeout("zmove4(zsecond2)",znPause);
		return;
	}
	if (ztdiv.style.pixelTop>=ztdiv.offsetHeight*-1){
		ztdiv.style.pixelTop-=5;
		setTimeout("zmove3(ztdiv)",100);
	}
	else{
		ztdiv.style.pixelTop=zscrollerheight;
		ztdiv.innerHTML=zpayam[i];
		if (zi==zpayam.length-1) zi=0
		else zi++;
	}
}

function zmove4(zwhichdiv){
	ztdiv2=eval(zwhichdiv);
	if (ztdiv2.style.pixelTop>0&&ztdiv2.style.pixelTop<=5){
		ztdiv2.style.pixelTop=0;
		setTimeout("zmove4(ztdiv2)",znPause);
		setTimeout("zmove3(zfirst2)",znPause);
		return
	}
	if (ztdiv2.style.pixelTop>=ztdiv2.offsetHeight*-1){
		ztdiv2.style.pixelTop-=5;
		setTimeout("zmove4(zsecond2)",100);
	}
	else{
		ztdiv2.style.pixelTop=zscrollerheight;
		ztdiv2.innerHTML=zpayam[i];
		if (zi==zpayam.length-1) zi=0
		else zi++;
	}
}

function zStartScroll(){
	if (document.all){
		zmove3(zfirst2);
		zsecond2.style.top=zscrollerheight;
		zsecond2.style.visibility='visible';
	}
	else if (document.zlayers){
		document.zmain.visibility='show';
		zmove1(document.zmain.document.zfirst);
		document.zmain.document.zsecond.top=zscrollerheight+5;
		document.zmain.document.zsecond.visibility='show';
	}
}

function zneda(zsClass,znWidth,znHeight,znsecond)
{
	zscrollerwidth=znWidth;
	zscrollerheight=znHeight;
	znPause=znsecond*1000;
	if (zpayam.length>1) zi=2
	else zi=0;
	var zsHtml='<zilayer id="zmain" width='+zscrollerwidth+' height='+zscrollerheight+'>';
	zsHtml+='<zlayer id="zfirst"      left="0" top="1" width="'+zscrollerwidth+'" >'+'</zlayer>';
	zsHtml+='<zlayer id="zsecond" left="0" top="0" width="'+zscrollerwidth+'" >'+'</zlayer></zilayer>';
	zsHtml+='<span class='+zsClass+' id="zmain2" style="position:relative;width:'+znWidth+';height:'+znHeight+';overflow:hidden;">';
	zsHtml+='<div style="position:absolute;clip:rect(0 '+znWidth+' '+znHeight+' 0);left:0;top:0">';
	zsHtml+='<div id="zfirst2"      style="position:absolute;width:'+zscrollerwidth+';left:0;top:1;">'+zpayam[0]+'</div>';
	zsHtml+='<div id="zsecond2" style="position:absolute;width:'+zscrollerwidth+';left:0;top:0;visibility:hidden">'+zpayam[1]+'</div>';
	zsHtml+='</div></span>';
	document.write(zsHtml);
	zStartScroll();
}

