//ad
//头部通栏广告
var tlAdtop=document.getElementById("tlAdtop");    
 if (tlAdtop!=null)
 {
	 temp = $('#tlAdtop').detach();
	 $('#mfNav').after(temp);
	tlAdtop.innerHTML="<iframe marginwidth=0 marginheight=0 frameborder=0 bordercolor='#FAFEFF' scrolling=no src='http://d.12291.com/9haot.html' width=990 height=90></iframe>" 
	$(tlAdtop).css({"margin-top":"3px"});
	$('#tlAdtop + div').css({"margin-top":"3px"});
 }
//底部通栏广告  
var tlAdbot=document.getElementById("tlAdbot");    
 if (tlAdbot!=null)
 {
	//tlAdbot.innerHTML="<iframe marginwidth=0 marginheight=0 frameborder=0 bordercolor='#FAFEFF' scrolling=no src='/skin2012/js/html/tlAdbot.html' width=990 height=90></iframe>" 
	//$(tlAdbot).css({"margin-top":"10px"});
 }

 
if($(tlAdtop).html()==""){$(tlAdtop).remove();} 
if($(tlAdbot).html()==""){$(tlAdbot).remove();} 



//====================函数过程===================
 //读取Cookies值
function getCookie(cookieName) 
{ 
 var cookieString =document.cookie; 
 var start = cookieString.indexOf(cookieName + '='); 
 // 加上等号的原因是避免在某些 Cookie 的值里有 
 // 与 cookieName 一样的字符串。 
 if (start == -1) // 找不到
 return null; 
 start += cookieName.length + 1; 
 var end = cookieString.indexOf(';', start); 
 if (end == -1) 
 return unescape(cookieString.substring(start));
 return unescape(cookieString.substring(start, end)); 
}

 //写入Cookie PostCookie("Softview=Yes");
 function PostCookie(cookieName)
 {
  var expdate = new Date();
   expdate.setTime(expdate.getTime() + 60480);
   document.cookie=cookieName+";expires="+expdate.toGMTString()+";path = /;";
 }

 //用于产生随机轮转广告 i 随机个数
function GetRandom(i)
 {
     var dt = new Date();
     var hr = dt.getSeconds();
     hr = hr%i; 
	 return hr;
 }
 

if (getCookie('IsPopAd')!="Yes")
	 {
	
//document.writeln("<script src=\"http:\/\/p.qiyou.com\/view.php?uid=14442\"><\/script>")
	                  	
	  PostCookie("IsPopAd=Yes");
	 }
