function top1_openURL(url) {
	window.open(url);
	if(false){
		try{
			top.fn_banner_click();
		}catch(e){}
	}
}

function top1_sendInfo() {
	var d = new Date();
	var divId = "top1";
	var div = document.getElementById(divId);
	if (!div || div.style.display == "none")
		return;
	if(d.getMinutes() == 1 && d.getSeconds() < 10)
		return;
	
	// zero means don't send randomly
	var isRandom = 20;
	if (Math.floor(Math.random() * isRandom) == 0) {
		var img = document.createElement("img");	
		img.src = getUrlWithPID("http://mediapv.sandai.net/commstat/banner_stat?itemid=1&domain=" + encodeURI(window.location.host) + "&position=1422&ramdon="+Math.random());
	}
}

if (typeof(peerID) == "undefined" || peerID == null) {
	peerID = null;
	try {
		peeridobj = new ActiveXObject("MediaAddin.MediaComm");
		if (peeridobj != null)
			peerID = "xlpeeruuid=" + peeridobj.peerid;
	} catch(e) {
	 peerID = null;
	}
}
if(false && (typeof(peerID)=="undefined"||peerID==null)) {
	peerID=null;
	try{
		thunder_server=new ActiveXObject("ThunderServer.WebThunder.1");
		if(thunder_server!=null){
			peerID="xlpeeruuid="+thunder_server.GetVariable("PEERID");
		}
	}catch(e) {
		peerID=null;
	}
}

if (typeof(window.getUrlWithPID) == "undefined") {
	eval(
		  "function getUrlWithPID(fullurl, split) {"
		+ "	if(peerID == null || fullurl == null) "
		+ "		return fullurl;"
		+ "	var index = fullurl.indexOf('?'); "
		+ "	if(index < 0) return fullurl;"
		+ "	if (index == fullurl.length - 1) "
		+ "		return  fullurl + peerID;"
		+ "	if (split == null) {"
		+ "		split = '&';"
		+ "		var search = fullurl.indexOf('&amp;');"
		+ "		if (search > index) {"
		+ "			split = '&amp;';"
		+ "		} else {"
		+ "			search = fullurl.indexOf('%26');"
		+ "			if (search > index)"
		+ "				split = '%26';"
		+ "		}"
		+ "	}"
		+ "	return fullurl.substring(0, index + 1) + peerID + split + fullurl.substring(index + 1);"
		+ "}"
	);
}

if (true)
	setTimeout("top1_sendInfo()", 10);
 var top1_ROLLINGTIME = 15000;
 var top1_heights = new Array();
 var top1_randomDiv = new Array(); 
 var top1_adcount = new Array(); 
 var top1_client = new Array(); 
 var top1_str = ""; 


 top1_heights[1] = 90; 
 top1_randomDiv[1] = "top1_randomDiv_1";
 top1_adcount[1] = 1;

 top1_client[1] = 0;
 
  top1_str +=" <div style='position:relative;width:960px;height:90px;display:none' id=top1_randomDiv_1> ";
  if(false)
  { 
    top1_str +=" <object id=obj_top1_randomDiv_1 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width=960 height=90  classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>";
    top1_str +=" 	<param name='movie' value='http://biz5.sandai.net/portal/images/n1244110387214.jpg'>";
    top1_str +=" 	<param name='salign' value='TL'>";
    top1_str +="    <param name='wmode' value='Transparent'>";
    top1_str +="    <param name='wmode' value='opaque'>";
    top1_str +="    <param name='quality' value='High'>";
    top1_str +="<embed src='http://biz5.sandai.net/portal/images/n1244110387214.jpg' quality='high' allowscriptaccess='always' wmode='transparent' type='application/x-shockwave-flash' ";
    top1_str +=" pluginspage='http://www.macromedia.com/go/getflashplayer' height='90' width='960'> ";
    top1_str +=" </object>";
    if(!false)
    {
     top1_str +=" <a href='" + getUrlWithPID('http://cknum.sandai.net/fcg-bin/cgi_banner_stat.fcg?id=293056&position=1422&url=http://www.mysanguo.com/uppic/adv2.html') + "' target=_blank style='position:absolute;left:0px;top:0px;width:960px;height:90px;'><img src='http://biz5.sandai.net/portal/images/spacer.gif' style='display:block;overflow:hidden;width:960px;height:90px;border:0 none;' /></a>";
    }
  }
  else
  {  
    top1_str +=" <a href='" + getUrlWithPID('http://cknum.sandai.net/fcg-bin/cgi_banner_stat.fcg?id=293056&position=1422&url=http://www.mysanguo.com/uppic/adv2.html') + "' target=_blank><img src='http://biz5.sandai.net/portal/images/spacer.gif' style='position:absolute;left:0px;top:0px;width:960;height:90;border:none;' />";
    top1_str += "<img src=http://biz5.sandai.net/portal/images/n1244110387214.jpg  width=960  height=90 border=0 ></img></a>";
  }
  top1_str += "</div>"; 
 
 var targetDiv = document.getElementById("top1"); 
 if(targetDiv != null && targetDiv != undefined) { 
 targetDiv.style.display = "block"; 
 targetDiv.innerHTML = top1_str;
   }
var _flagtop1_interval = false;
function getNextAd_top1(divs,heights)
{ 
	var canGetFocus = true;
	var focusEle = null
	try{
		focusEle = document.activeElement;
	}catch(e){
	}
	if(focusEle != null){
 		var focusObj = document.activeElement.nodeName; 
 		if(focusObj != "INPUT" && focusObj != "TEXTAREA" && focusObj != "SELECT" ){
 			canGetFocus = false;
 		}
 	}
	if( !canGetFocus || !_flagtop1_interval){
		var length = divs.length; 
		var randomNumber = 0;
		for(var i = 1 ; i < length; i ++){ 
			var childDiv = document.getElementById(divs[i]);
			if(childDiv != null && childDiv != "undefined"){
				if(childDiv.style.display == "block"){
					randomNumber = i+1;
				}  
				childDiv.style.display = "none";
			}
		} 
		if(randomNumber  == 0){
			if(length <=2) randomNumber = 1; 
			else randomNumber =  Math.floor(Math.random() * (length - 1)) + 1;
		}else{
			if(randomNumber >= divs.length) randomNumber = 1; 
		}
		var targetDivName = divs[randomNumber];
		var nextDiv = document.getElementById(targetDivName); 
		if(nextDiv !=null && nextDiv != "undefined"){  
			nextDiv.style.display = "block";
		}
	}
	_flagtop1_interval = true;
}
getNextAd_top1(top1_randomDiv,top1_heights);
var searchbox = document.getElementById("searchbox");
if(searchbox != null){
	searchbox.focus();
}
var top1_interval = setInterval('getNextAd_top1(top1_randomDiv,top1_heights)',15 * 1000);   

function top1_insertAdvertHTML(){
	clearInterval(top1_interval);
	var targetDiv = document.getElementById("top1"); 
	if(targetDiv != null && targetDiv != undefined) { 
		targetDiv.style.display = "block"; 
		targetDiv.innerHTML = top1_str;
	}
	_flagtop1_interval = false;
	getNextAd_top1(top1_randomDiv,top1_heights);
	top1_interval = setInterval('getNextAd_top1(top1_randomDiv,top1_heights)',15 * 1000);
}

try{
var r_1419=Math.floor(Math.random() * 10)+1;
if(r_1419==1){
var i_1419=new Image(1,1);
i_1419.src="http://mpv.sandai.net/commstat/pv?pvkey=%2Fportal%2Fcompass";
i_1419.onload=function() {return;}
}
}catch(e){
}

