if (typeof(peerID) == "undefined" || peerID == null) {
	peerID = null;
	try {
		peeridobj = new ActiveXObject("DapCtrl.DapCtrl");
		if (peeridobj != null)
			peerID = "xlpeeruuid=" + peeridobj.Get("sPeerID");
	} 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 = '&';"
		+ "	}"
		+ "	return fullurl.substring(0, index + 1) + peerID + split + fullurl.substring(index + 1);"
		+ "}"
	);
}

if (typeof(window.mz) == "undefined") {
	eval(
		  "var mz=document.createElement('script'); "
		+ "mz.type='text/javascript'; mz.async=true; "
		+ "mz.src='http://js.miaozhen.com/sd.js'; "
		+ "var t=document.getElementsByTagName('script')[0]; "
		+ "t.parentNode.insertBefore(mz,t); "
		+ "function domz(posid){ "
		+ "var _mzh= window._mzh || []; "
		+ "_mzh.push(['_clear']); "
		+ "_mzh.push(['_set_pid', '1']); "
		+ "_mzh.push(['_set_tid', posid]); "
		+ "_mzh.push(['_set_cid', '-']); "
		+ "_mzh.push(['_set_sid', '-']); "
		+ "if(peerID&&peerID.length>11) "
		+ "_mzh.push(['_set_uid', peerID.substr(11)]); "
		+ "_mzh.push(['_send']); "
		+ "} "
	);
}

if (typeof(peerID_CM) == "undefined" || peerID_CM == null) {
	peerID_CM = null;
	try {
		peeridobj = new ActiveXObject("DapCtrl.DapCtrl");
		if (peeridobj != null)
			peerID_CM = "pid=" + peeridobj.Get("sPeerID");
	} catch(e) {
	 	peerID_CM = null;
	}
}

if (typeof(window.getUrlWithPID_CM) == "undefined") {
	eval(
		  "function getUrlWithPID_CM(fullurl, split) {"
		+ "	if(peerID_CM == null || fullurl == null) "
		+ "		return fullurl;"
		+ "	var index = fullurl.indexOf('?'); "
		+ "	if(index < 0) return fullurl;"
		+ "	if (index == fullurl.length - 1) "
		+ "		return  fullurl + peerID_CM;"
		+ "	if (split == null) {"
		+ "		split = '&';"
		+ "	}"
		+ "	return fullurl.substring(0, index + 1) + peerID_CM + split + fullurl.substring(index + 1);"
		+ "}"
	);
}

if (typeof(window.addEventHandler_CM) == "undefined") {
	eval(
		  "function addEventHandler_CM(oTarget, sEventType, fnHandler){"
		+ "	if (oTarget.addEventListener) {"
		+ "		oTarget.addEventListener(sEventType, fnHandler, false);"
		+ "}"
		+ "else"
		+ " if (oTarget.attachEvent) {"
		+ "		oTarget.attachEvent(\"on\" + sEventType, fnHandler);"
		+ "}"
		+ "else {"
		+ "		oTarget[\"on\"+ sEventType] = fnHandler;"
		+ "}"
		+"}"
	);
}

if (typeof(window.removeEventHandler_CM) == "undefined") {
	eval(
		  "function removeEventHandler_CM(oTarget, sEventType, fnHandler){"
		+ "	if (oTarget.removeEventListener) {"
		+ "		oTarget.removeEventListener(sEventType, fnHandler, false);"
		+ "}"
		+ "else"
		+ " if (oTarget.detachEvent) {"
		+ "		oTarget.detachEvent(\"on\" + sEventType, fnHandler);"
		+ "}"
		+ "else {"
		+ "		oTarget[\"on\" + sEventType] = null;"
		+ "}"
		+"}"
	);
}

if (typeof(window.position_CM) == "undefined") {
	eval(
		  "function position_CM(o){"
		+ "	var p = {"
		+ "		Top: 0,"
		+ " 	Left: 0"
		+ " };"
		+ " while (!!o) {"
		+ "		p.Top += o.offsetTop;"
		+ " 	p.Left += o.offsetLeft;"
		+ " 	o = o.offsetParent;"
		+ "	}"
		+ " return p;"
		+ "}"
	);
}

if (typeof(window.isInView_CM) == "undefined") {
	eval(
		  "function isInView_CM(id){"
		+ "	var min = {};"
		+ "	var max = {};"
		+ " min.Top = document.body.scrollTop + document.documentElement.scrollTop;"
		+ " min.Left = document.documentElement.scrollLeft;"
		+ " max.Top = min.Top + document.documentElement.clientHeight;"
		+ "	max.Left = min.Left + document.documentElement.clientWidth;"
		+ " var obj=document.getElementById(id);"
		+ " if(obj==null || obj==undefined) return true;"
		+ " var width = obj.clientWidth;"
		+ "	var height = obj.clientHeight;"
		+ " var wh = position_CM(obj);"
		+ " if ((wh.Top >= min.Top && wh.Top <= max.Top && wh.Left >= min.Left && wh.Left <= max.Left) ||"
		+ "  ((wh.Top + height) >= min.Top && wh.Top <= max.Top && (wh.Left + width) >= min.Left && wh.Left <= max.Left)) {"
		+ " return true;"
		+ " }else{"
		+ " return false;"
		+ " }"
		+ "}"
	);
}

function getFlashMovieObject_738(movieName){
	if (navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName];
	}else{
		return document.getElementById(movieName);
	}
	if (window.document[movieName]){
		return window.document[movieName];
	}
}

function checkSwf_738(id, index){
	var swf = getFlashMovieObject_738(id);
	if(swf != null && swf != undefined){
		try{
			var frames = swf.PercentLoaded();
			if(frames > 90){
				status_738[index] = true;
			}else{
				status_738[index] = false;
			}
		}catch(e){}
	}
}

var ROLLINGTIME_738 = (86400*1000);
var heights_738 = new Array();
var randomDiv_738 = new Array(); 
var adcount_738 = new Array(); 
var client_738 = new Array(); 
var material_738 = new Array(); 
var status_738 = new Array(); 
var str_738 = ""; 


heights_738[0] = 90;
randomDiv_738[0] = "randomDiv_738_0";
adcount_738[0] = 0;
client_738[0] = 0;
status_738[0] = false; 
material_738[0] = "";

str_738 +=" <div style='position:relative;width:950px;height:90px;display:none' id='randomDiv_738_0'> ";
if( false ){ 
	material_738[0] +="<object id='obj_738_randomDiv_0' codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='950' height='90' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>";
	material_738[0] +="<param name='movie' value='http://20120131.biz5.sandai.net/portal/image/89/n1256624866489.jpg'>";
	material_738[0] +="<param name='salign' value='TL'>";
	material_738[0] +="<param name='wmode' value='Transparent'>";
	material_738[0] +="<param name='wmode' value='opaque'>";
	material_738[0] +="<param name='quality' value='High'>";
	material_738[0] +="<embed src='http://20120131.biz5.sandai.net/portal/image/89/n1256624866489.jpg' quality='high' allowscriptaccess='always' wmode='transparent' type='application/x-shockwave-flash' ";
	material_738[0] +="pluginspage='http://www.macromedia.com/go/getflashplayer' height='90' width='950' name='obj_738_randomDiv_0'> ";
	material_738[0] +="</object>";
	if(true){
		material_738[0] +="<a href='" + getUrlWithPID('http://click.cm.sandai.net/UClick?gs=cmuclick&ad=1327971196820&position=738&materialid=m00067986&location=http%3A%2F%2Fkankan.nubb.com') + "' target='_blank' style='position:absolute;left:0px;top:0px;width:950px;height:90px;'><img src='http://biz5.sandai.net/portal/images/spacer.gif' style='display:block;overflow:hidden;width:950px;height:90px;border:0 none;' /></a>";
	}
	if(738 != 1244){
		status_738[0] = true;
	}
}else{
	material_738[0] +=" <a href='" + getUrlWithPID('http://click.cm.sandai.net/UClick?gs=cmuclick&ad=1327971196820&position=738&materialid=m00067986&location=http%3A%2F%2Fkankan.nubb.com') + "' target=_blank><img src='http://biz5.sandai.net/portal/images/spacer.gif' style='position:absolute;left:0px;top:0px;width:950px;height:90px;border:none;' />";
	material_738[0] += "<img src='http://20120131.biz5.sandai.net/portal/image/89/n1256624866489.jpg' width=950 height='90' border='0' ></img></a>";
	status_738[0] = true;
}
str_738 += "</div>"; 


function checkReadyStatus_738(){
	var isReady = true;
	for(var i=0; i<status_738.length; i++){
		if(!status_738[i]){
			isReady = false;
			setTimeout("checkSwf_738('obj_738_randomDiv_" + i + "', " + i + ")", 100);
		}
	}
	if(isReady){
		var targetDiv = document.getElementById("infotop");
		targetDiv_1244.style.height = "90px";
		
		if(738 == 1244){
			setTimeout(function(){
				var div = document.getElementById("infotop"); 
				if(div != null && div != undefined) {
					clearInterval(interval_738);
					div.style.display = "none";
					div.innerHTML = "";
				}
			}, ROLLINGTIME_738)
		}
	}else{
		setTimeout("checkReadyStatus_738()", 200);
	}
}

var targetDiv_738 = document.getElementById("infotop");
if(targetDiv_738 != null && targetDiv_738 != undefined) {
	targetDiv_738.innerHTML = str_738;
	if(738 == 1244){
		targetDiv_738.style.height = "0px";
		targetDiv_738.style.overflow = "hidden";
		checkReadyStatus_738();
	}else if(738 != 1170 && 738 != 1169){
		targetDiv_738.style.display = "block";
	}
}

var flag_interval_738 = false;
function getNextAd_738(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 || !flag_interval_738){
		var length = divs.length; 
		var randomNumber = -1;
		for(var i = 0 ; 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  == -1){
			randomNumber =  Math.floor(Math.random() * length);
		}else{
			if(randomNumber >= length) randomNumber = 0; 
		}
		var targetDivName = divs[randomNumber];
		var nextDiv = document.getElementById(targetDivName); 
		if(nextDiv !=null && nextDiv != "undefined"){  
			nextDiv.style.display = "block";
			if(nextDiv.innerHTML != null && nextDiv.innerHTML.length < 2){
				nextDiv.innerHTML = material_738[randomNumber];
			}
		}
	}
	flag_interval_738 = true;
}
getNextAd_738(randomDiv_738,heights_738);
var searchbox = document.getElementById("searchbox");
if(searchbox != null){
	searchbox.focus();
}
var interval_738 = setInterval('getNextAd_738(randomDiv_738,heights_738)', ROLLINGTIME_738);   

function infotop_insertAdvertHTML(){
	clearInterval(interval_738);
	var targetDiv = document.getElementById("infotop"); 
	if(targetDiv != null && targetDiv != undefined) { 
		targetDiv.style.display = "block"; 
		targetDiv.innerHTML = str_738;
	}
	flag_interval_738 = false;
	getNextAd_738(randomDiv_738,heights_738);
	interval_738 = setInterval('getNextAd_738(randomDiv_738,heights_738)',ROLLINGTIME_738);
}

function sendPv_738(){
	try{
	var r_738 = Math.floor(Math.random() * 1000);
	if(r_738 < 100){
		var i_738=new Image(1,1);
		i_738.src=getUrlWithPID_CM('http://pv.cm.sandai.net/UPV?gs=cmupvEnhance&pvkey=738&materialid=m00067986');
		i_738.onload=function() {return;}
	}
	if(738 == 1128){
		//miaozhen
		setTimeout("domz(738)", 1000);
	}
	}catch(e){}
}

if(isInView_CM("infotop")){
	sendPv_738();
}else{
	addEventHandler_CM(window,'scroll',resize_CM_738);
}

function resize_CM_738(){
    if(isInView_CM("infotop")){
		sendPv_738();
		removeEventHandler_CM(window,'scroll',resize_CM_738);
	}
}

