function closeRightBottomAd() 
{ 
 document.getElementById('ck100RightBottomAd').style.visibility = 'hidden'; 
} 

function showRightBottomAd()
{
 weiZhi();
 //setTimeout(function(){showRightBottomAd();},50);
 setTimeout(function(){showGif();},10000);
}

function weiZhi()
{
 var ckrb = document.getElementById("ck100RightBottomAd");
 var ckrbHeight = document.getElementById("ck100RightBottomAd").offsetHeight;
 ckrb.style.top = document.documentElement.scrollTop+document.documentElement.clientHeight-ckrbHeight+"px"; 
}

function showFlash()
{
	var flash1 = document.getElementById("ck100ShowFlash");
	flash1.style.display="";
	var gif1 = document.getElementById("ck100ShowGif");
	gif1.style.display="none";
}

function showGif()
{
	var gif1 = document.getElementById("ck100ShowGif");
	gif1.style.display="";
	var flash1 = document.getElementById("ck100ShowFlash");
	flash1.style.display="none";
}

function rightBottomAd()
{
 if(getQueryStringRb("tp")=="1") //flash
 {
 	document.write('<div id="ck100RightBottomAd" style="position:absolute;border:0px solid #000;right:0;z-index:1000;"><div id="ck100ShowFlash"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+getQueryStringRb("kk")+'" height="'+getQueryStringRb("gg")+'"><param name="movie" value="'+getQueryStringRb("imgurl")+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+getQueryStringRb("imgurl")+'" quality="high" pluginspage="http://www.adobe.com/sockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+getQueryStringRb("kk")+'" height="'+getQueryStringRb("gg")+'"></embed></object> <DIV style="right:0px;POSITION:absolute;TOP:0px;"><a href="http://www.ck100.com/table/lmorder.asp?lmc='+getQueryStringRb("lmc")+'&ggc='+getQueryStringRb("ggc")+'&km='+getQueryStringRb("km")+'" target=_blank><img src="http://www.ck100.com/lm/images/kong.gif" width="'+getQueryStringRb("kk")+'" height="'+getQueryStringRb("gg")+'" border=0 /></a></div><DIV style="right:7px;POSITION:absolute;TOP:2px;"><a href=JavaScript:; onclick="showGif()"><img border=0 src="http://www.ck100.com/lm/images/close1.gif" ></a></div></div><div id="ck100ShowGif" style="display:none;"><div style="text-align:right;"><a href=JavaScript:; onclick="closeRightBottomAd()"><img border=0 src="http://www.ck100.com/lm/images/close1.gif" ></a></div><a href=JavaScript:; onmouseover="showFlash()"><img border=0 src="http://www.ck100.com/lm/lmgg/flashxiaotu.gif" ></a></div></div>');
 }
 else //pic
 {
	 document.write('<div id="ck100RightBottomAd" style="position:absolute;border:0px solid #000;right:0;z-index:1000;"><div id="ck100ShowFlash"><a href="http://www.ck100.com/table/lmorder.asp?lmc='+getQueryString("lmc")+'&ggc='+getQueryString("ggc")+'&km='+getQueryString("km")+'" target=_blank><img src="'+getQueryString("imgurl")+'" border="0"></img> </a><DIV style="right:7px;POSITION:absolute;TOP:2px;"><a href=JavaScript:; onclick="closeRightBottomAd()"><img src="http://www.ck100.com/lm/images/close1.gif" border=0></img> </a></div></div><div id="ck100ShowGif" style="display:none;"><a href=JavaScript:; onmouseover="showFlash()"><img border=0 src="http://www.ck100.com/lm/lmgg/flashxiaotu.gif" ></a></div></div>');
 }
 
 showRightBottomAd();
 
}

function getQueryStringRb(name)  
{  
  var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
  var srcurl=document.getElementById("ck100right").src;
  if (reg.test(srcurl)) return RegExp.$2; return ""; 
}

rightBottomAd();
window.setInterval("weiZhi()",50);
