document.write('<DIV id=pip_ad style="HEIGHT:200px; WIDTH:250px; '
	+ 'POSITION:absolute; VISIBILITY:hidden;">');
document.write('<IMG border=0  src="image/show2.bmp"></DIV>');
document.write('<DIV id=moving_ad style="height:70px; width:60px; POSITION:absolute; VISIBILITY:visible"><A href="#" onmouseout=mouse_out_ad() onmouseover=mouse_over_ad() ><IMG border=0 height=70 width=60 src="image/show1.bmp"> </A></DIV>');

var xPos_ad = 700; <!--第一圖示所起始X座標位置-->
var step_ad = 1;
var delay_ad = 30; 
var yPos_ad = 0; <!--第一圖示所起始Y座標位置-->
var height_ad = 0;
var offset_ad = 0;
var yon_ad = 0;
var name = navigator.appName;

if (name == "Microsoft Internet Explorer")
{
   //yPos_ad = document.body.clientHeight;
   yPos_ad = 0;
   moving_ad.style.top = yPos_ad;
}
else
{
   //yPos_ad = window.innerHeight;
   //document.moving_ad.pageY = yPos_ad;
   yPos_ad = 0;
   document.moving_ad.pageY = window.innerHeight;
   document.moving_ad.visibility = "hidden";
}

function changePos_ad()
{
   if (yon_ad == 0)
   {
      yPos_ad = yPos_ad - step_ad;
   }
   else
   {
      yPos_ad = yPos_ad + step_ad;
   }
   if (name == "Microsoft Internet Explorer")
   {
      height_ad = document.body.clientHeight;
      offset_ad = moving_ad.offsetHeight;
   }
   else
   {
      height_ad = window.innerHeight;
      offset_ad = document.moving_ad.clip.height;
   }  
   if (yPos_ad < 0)
   {
      yon_ad = 1;
      yPos_ad = 0;
   }
   if (yPos_ad >= (height_ad - offset_ad))
   {
      yon_ad = 0;
      yPos_ad = (height_ad - offset_ad);
   }
   if (name == "Microsoft Internet Explorer")
   {
      moving_ad.style.left = xPos_ad;
      moving_ad.style.top = yPos_ad + document.body.scrollTop;
   }
   else
   {
      document.moving_ad.pageX = xPos_ad;
      document.moving_ad.pageY = yPos_ad + window.pageYOffset;
   }
}

function myload_movepip_ad()
{
   if (name != "Microsoft Internet Explorer") 
   {
      document.moving_ad.visibility = "visible";
   }
   loopfunc_ad();
}

function loopfunc_ad()
{
   changePos_ad();
   movobj_ad = setTimeout("loopfunc_ad()",delay_ad);
}


ns4=  (document.layers) ? true : false;
ie4 = (document.all) ? true : false;


function mouse_over_ad()
{
   if (ns4)
   {
		document.moving_ad.document.pip_ad.visibility = "show";
	}
	else
	{
	   if (ie4)
	   {
           document.all.pip_ad.style.left=parseInt(document.all.moving_ad.style.left) + (-200); <!-- pop出圖示的位置控制 -->
	   document.all.pip_ad.style.top=parseInt(document.all.moving_ad.style.top) + (0);
	   document.all.pip_ad.style.visibility="visible";
	   }
	}
	//staytime = setTimeout("MouseOut()", 5000); // If want to stay 5 sec
	clearTimeout(movobj_ad);
}	

function mouse_out_ad()
{
	//clearTimeout(staytime);
   if (ns4)
   {
		document.moving_ad.document.pip_ad.visibility = "hide";
	}
	else
	{
	   if (ie4)
	   {  
	      document.all.pip_ad.style.visibility="hidden";
	   }
	}
   movobj_ad = setTimeout("loopfunc_ad()",delay_ad);
}

myload_movepip_ad();

var agt=navigator.userAgent.toLowerCase();
var is_major	= parseInt(navigator.appVersion);
var is_minor	= parseFloat(navigator.appVersion);
var is_nav	= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
		&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
		&& (agt.indexOf('webtv')==-1));
var is_nav2	= (is_nav && (is_major == 2));
var is_nav3	= (is_nav && (is_major == 3));
var is_nav4	= (is_nav && (is_major == 4));
var is_nav4up	= (is_nav && (is_major >= 4));
var is_navonly	= (is_nav && ((agt.indexOf(";nav") != -1) ||
		(agt.indexOf("; nav") != -1)) );
var is_nav5	= (is_nav && (is_major == 5));
var is_nav5up	= (is_nav && (is_major >= 5));
var is_ie	= (agt.indexOf("msie") != -1);
var is_ie3	= (is_ie && (is_major < 4));
var is_ie4	= (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up	= (is_ie  && (is_major >= 4));
var is_ie5	= (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up	= (is_ie  && !is_ie3 && !is_ie4);
var is_aol	= (agt.indexOf("aol") != -1);
var is_aol3	= (is_aol && is_ie3);
var is_aol4	= (is_aol && is_ie4);
var is_opera	= (agt.indexOf("opera") != -1);
var is_webtv	= (agt.indexOf("webtv") != -1);

var is_js;
if (is_nav2 || is_ie3) is_js = 1.0
else if (is_nav3 || is_opera) is_js = 1.1
else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2
else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3
else if (is_nav5) is_js = 1.4
else if (is_nav && (is_major > 5)) is_js = 1.4
else if (is_ie && (is_major > 5)) is_js = 1.3
else is_js = 0.0;

