﻿var domainnums;
var rands;
theDomain = new Array();

domainnums=1;
theDomain[0] = "c.cnxad.com"
theDomain[1] = "c.cnxad.com"

if (domainnums>1)
{
  rands = Math.round(Math.random()*domainnums)
  while (rands >(domainnums-1)) {
   rands = Math.round(Math.random()*domainnums)
  }
}else{rands=0}

if (rands==""){rands=0}
var codedomain=theDomain[rands]

if ((cnxad_width!='300')&&(cnxad_width!='250')){cnxad_width='300';}
if ((cnxad_height!='240')&&(cnxad_height!='200')){cnxad_height='240';}

var cnxad_location = window.location.href
var cnxad_from_url;
try{cnxad_from_url=window.top.document.referrer;}
catch(err)
{cnxad_from_url=document.referrer;};

    if(self!=top)
    {
	var cnxadkeshibody;
	cnxadkeshibody=document.documentElement;
	if (eval(cnxadkeshibody.clientWidth)<=0)
	{
	document.writeln("<body></body>");
	cnxadkeshibody=document.body;
	}	
	if ((cnxadkeshibody.clientWidth<=(parseInt(cnxad_width)+100))||(cnxadkeshibody.clientHeight<=(parseInt(cnxad_height)+100)))
	top.location=self.location; 
    }

cnxad_location=encodeURIComponent(cnxad_location);
cnxad_from_url=encodeURIComponent(cnxad_from_url);

var cnxad_encodes=cnxad_encode;
var cnxad_widths=cnxad_width;
var cnxad_heights=cnxad_height;
var cnxad_userids=cnxad_userid;
var cnxad_subids=cnxad_subid;
var cnxad_logos=cnxad_logo;
var cnxad_exids=cnxad_exid;
var ImgUrl= "http://"+codedomain+"/m1.ashx?w="+cnxad_userids+"&sid="+cnxad_subids+"&logo="+cnxad_logos+"&e="+cnxad_encodes+"&furl="+cnxad_location+"&ffurl="+cnxad_from_url;

if (cnxad_userids=="45045")
{
	//ImgUrl="";
}

var moW=cnxad_width;
var moH=cnxad_height;
var h_cursor = 3;
var l_cursor = moW-36;
var w_cursor = 25;
var t_cursor =14;
(function(x) {
	x.EDSHOW = {};
	EDSHOW.w = function() {
		if (/msie (\d+\.\d)/i.test(navigator.userAgent)) {
			return parseFloat(RegExp.$1);
		} else return 0;
	}
	EDSHOW.k = function() {
		var q = EDSHOW.w();
		if (q==0 || (q>=7&&document.compatMode!="BackCompat")) {
			return true;
		} else {
			return false;
		}
	}
})(window);
var ed_fixed = EDSHOW.k();
if(ed_fixed) 
	document.writeln("<div id='cnxad_fmt"+cnxad_userids+"' style='position:fixed; z-index: 999999999999999999999999;bottom:0;right:0;'> ");
else 
	document.writeln("<div id='cnxad_fmt"+cnxad_userids+"' style='position:absolute; z-index: 999999999999999999999999;'> ");

document.writeln("<div style='z-index:99999999999999999999999; top:"+h_cursor+"px;left:"+l_cursor+"px; width:"+w_cursor+"px; height:"+t_cursor+"px; position:absolute;' onClick='javascript:ED_CloseIt();'><img style='width:25px; height:14px;' src='http://js.cnxad.com/images/Sclose.gif'></div>");
document.writeln('<iframe id="ShowWnd'+cnxad_userids+'" name=""ShowWnd'+cnxad_userids+'" src="'+ImgUrl+'" MARGINWIDTH=0 MARGINHEIGHT=0  HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no WIDTH='+moW+' HEIGHT='+moH+' allowTransparency="true"></iframe>');
if (cnxad_logo!="false")
{document.writeln("<div style='z-index:99999999999999999999999; bottom:0px;right:0px; width:88px; height:18px; position:absolute'><a href='http://www.cnxad.com' target='_blank' title='极限传媒提供的广告'><img alt='极限传媒提供的广告' src='http://js.cnxad.com/images/logo.gif' border='0' width='88' height='18'></a></div>");}
document.writeln("</div>");

var ED_SHOWfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var ED_SHOWst = document.getElementById("cnxad_fmt"+cnxad_userids).style;

function ED_moveR() {
	ED_SHOWst.top = ( ED_SHOWfrm.scrollTop + ED_SHOWfrm.clientHeight - moH ) + "px";
	ED_SHOWst.left = ( ED_SHOWfrm.scrollLeft + ED_SHOWfrm.clientWidth - moW ) + "px";
}

if(!ed_fixed) {
	ED_SHOWst.top = ( ED_SHOWfrm.clientHeight - moH ) + "px";
	ED_SHOWst.left = ( ED_SHOWfrm.clientWidth - moW ) + "px";
	ED_FUNCTION_OBJ=setInterval("ED_moveR();", 80);
}

function ED_CloseIt(){
	setTimeout("document.getElementById('cnxad_fmt'+cnxad_userids).style.display='none';", 1500);
	setTimeout("document.getElementById('cnxad_fmt'+cnxad_userids).style.display='';", 900000);
}
ImgUrl="";

