 
//普通显示广告
function adShow1(adCode)
{
	document.write(adCode+" ");	
}


//跳窗广告

function adShow3(adCode,adHeight,adWidth)
{
	window.open (adCode, '', 'height='+adHeight+', width='+adWidth+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
}

//挂旗广告
/*
var adRight;
var adLeft;
var adTime;
var adId;
*/
var rightbar;
var coupletcode;
rightbar = window.screen.width-150+20;

coupletcode = "<DIV id=leftbar style='LEFT: 0px; POSITION: absolute; TOP: 110px; VISIBILITY: hidden;' width=130>32</div><DIV id=rightbar style='LEFT: " + rightbar + "px; POSITION: absolute; TOP: 110px; VISIBILITY: hidden' width=130>32</div>";
if (window.screen.width>=1024)
{
	document.write(coupletcode);
}

function InsertCouplet(adRight,adLeft,adTime,adId)
{
	if (
		window.screen.width>=1024){	
		document.getElementById("leftbar").style.visibility = "visible";
		document.getElementById("rightbar").style.visibility = "visible";
		document.getElementById("leftbar").innerHTML = adLeft;
		document.getElementById("rightbar").innerHTML = adRight;
		}
}

// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
 // Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
function adShow2(adRight,adLeft,adTime,adId)
{
	if(adTime!=null)
	{
		if(readCookie(adId)=="")
		{
			writeCookie(adId,adId,adTime)
			InsertCouplet(adRight,adLeft,adTime,adId);
		}
	}
	else
	{
		InsertCouplet(adRight,adLeft,adTime,adId);
	}
}


function leftBG_DoFSCommand(command,args){
		if (command == "quit"){
			document.all.leftbar.style.visibility = "hidden";
			document.all.rightbar.style.visibility = "hidden";
		}
}
function rightBG_DoFSCommand(command,args){
		leftBG_DoFSCommand(command,args);
}

if (document.all){
		document.write("<Script language=\"JavaScript\" For=\"rightB\" Event=\"FSCommand(command,args)\">\n");
		document.write("	leftBG_DoFSCommand(command,args);\n");
		document.write("</Script>\n");
		document.write("<Script language=\"JavaScript\" For=\"leftB\" Event=\"FSCommand(command,args)\">\n");
		document.write("	rightBG_DoFSCommand(command,args);\n");
		document.write("</Script>\n");
}