var baseline;
var xs_bv=0;
var xs_pHeight=601;
var xs_updown=1;
var xs_endpt=0;
var xs_ranonce=0;
var xs_pDivSeen=0;
var xs_pTuck=0;
var ua=navigator.userAgent.toLowerCase()
if ( (ua.indexOf("opera")==-1)&&((ua.indexOf("msie")!=-1)&&(ua.indexOf("windows")!=-1))||((ua.indexOf("msie 5")!=-1)&&(ua.indexOf("mac")!=-1)) ) {xs_bv=1}
function xs_pdEx(){
	baseline = getPageCoords(popdownBaseline);
	
	xs_pTop = baseline.y - xs_pHeight; 
	
	if (sb_firstshow) {
		//alert('test');
		xs_pDiv.style.clip="rect(0,401,601,0)";
		xs_pDiv.style.display="none";
		xs_pDiv.style.top=baseline.y;
		xs_pd();
	} else {
//		if((xs_bv)&&(!xs_ranonce)){
//			//xs_pDiv2.style.left=xs_pDiv.style.left=((document.body.offsetWidth/2)-160)
//			xs_pd();
//		}	else{
//			if(xs_pTuck == 1){
//				if (xs_pDivSeen != 1){
//					xs_pDiv.style.clip="rect(0,401,601,0)";
//					xs_pDiv.style.display="";
//					// xs_pDiv.style.top=31;
//				}
//				xs_endpt=(document.body.offsetWidth/2)-160;
//				xs_tuck();
//			}
//		}
	}
}
function xs_pd(){
	xs_ranonce=1;
	if (((xs_pHeight<601)&&(xs_updown==0)) || ((xs_pHeight>3)&&(xs_updown==1 || xs_updown==-1))) {
		if(xs_pHeight==601){xs_pDiv.style.display=""}
		//2004 06 10
		//xs_pHeight-=3;
		//xs_pTop+=3;		
		(xs_updown==0)?xs_pHeight+=3:xs_pHeight-=3;
		(xs_updown==0)?xs_pTop-=3:xs_pTop+=3;
		//2004 06 10
		xs_pDiv.style.clip="rect(" + xs_pHeight + ",401,601,0)";
		xs_pDiv.style.top=(xs_pTop+"px");
		setTimeout("xs_pd();",15); //scroll down speed
	} else {
		if (xs_updown==1){
			xs_pDiv.style.clip="rect(0,401,601,0)";
			xs_pDiv.style.top=baseline.y;
			//xs_pDiv2.style.top=baseline.y + "px";
			xs_updown=0;
			//xs_pDiv2.style.display='';
			setTimeout("xs_pd();",5000); 
		} else{
			//xs_pDiv.style.display='none';
			//xs_pDivSeen = 1;
			//xs_endpt=(document.body.offsetWidth/2)-160;
			//xs_tuck();
		}
	}
}
function xs_tuck(){
if(xs_endpt<(document.body.offsetWidth-355)){
xs_endpt+=5;
//xs_pDiv2.style.left=xs_endpt;
setTimeout("xs_tuck();",15);
}
else{xs_pTuck = 1}
}
function getPageCoords(element) {
var coords = {x: 0, y: 0};
while (element) {
coords.x += element.offsetLeft;
coords.y += element.offsetTop;
element = element.offsetParent;
}
return coords;
}
function bodyLoad() {
 //alert((document.body.offsetWidth - 800) / 2 + 700);
 if (document.body.offsetWidth > 900 && document.body.offsetWidth <= 1024) {
	 xs_pDiv.style.left = (document.body.offsetWidth - 660) / 2  - 12;;		//+ 160; //document.body.offsetWidth - 181; // ((document.body.offsetWidth - 800) / 2 + 600); //780); 2004 06 10
	 xs_pDiv.style.display = "";
	 xs_pdEx();
 } else if (document.body.offsetWidth > 1024) {
 	 xs_pDiv.style.left = (document.body.offsetWidth - 660) / 2  - 12;		//+ 160;//document.body.offsetWidth - 181; //((document.body.offsetWidth - 800) / 2 + 620); //820);
	 xs_pDiv.style.display = "";
	 xs_pdEx();
 } else {
 	xs_pDiv.style.left = 170 //(document.body.offsetWidth - 660) / 2 - 12;		// + 160; //document.body.offsetWidth - 181; //600;
	xs_pDiv.style.display = "";
	xs_pdEx();
 	//xs_pDiv.style.display = "none";
	//xs_pDiv.style.left = document.body.offsetWidth;
 }
}

function openSusbWindow(theURL) { //v2.0
  window.open(theURL,"test","scrollbars=yes,width=569,height=503");
}
