var a="hfJEN3I";
var path_1= "zjcq/sl";
var path_2= "dfxx/cn";

var w_body = 250;
var h_body = 200;

var ref = "";
try{
	ref = escape(document.referrer);
}
catch(e){
}

var cookie_name="91pf"+aid;
var state=getcookie(cookie_name);
if(!state){
	setcookie(cookie_name,"1");
	var path=path_1;
} else if(state=="1"){
	setcookie(cookie_name,"2");
	var path=path_2;
} else {
	setcookie(cookie_name,"1");
	var path=path_1;
}

var img_src = "http://c.chinaih.com/code_img/250x200.gif";
var img= "http://c.chinaih.com/img_1/"+path+"/250x200.swf?a="+a;
var gourl = "http://g.kx365.com/"+path+"/index.html?agent_id="+aid;


document.writeln("<div id=\"ShowQQ\" style=\"position:absolute; z-index: 100;\"> ");
document.writeln("<div id=\"ImgLayer\" style=\"position:absolute; z-index:1; left: 0px;\"> ");
document.writeln("<div style=\"position:absolute; z-index:1\"><a href=\"" + gourl + "\" target=\"_blank\"><img src=\"" + img_src + "\"  width=\"" + w_body + "\" height=\"" + h_body + "\" border=\"0\" usemap=\"#QQinMap\"></a></div>");

document.write('<map name="QQinMap" id="QQinMap"><area shape="rect" coords="1,0,168,38" href="'+gourl+'" target="_blank" />');
document.write('<area shape="rect" coords="0,0,210,200" href="'+gourl+'" target="_blank" />');
document.write('<area shape="rect" coords="210,20,250,200" href="'+gourl+'" target="_blank" />');
document.write('<area shape="rect" coords="210,0,250,20" href="'+gourl+'" target="_blank" onclick="closeDiv()" />');
document.write('</map>');

document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + w_body + '" height="' + h_body + '">');
document.write('<param name="movie" value="'+img+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="transparent">');
document.write('<embed src="'+img+'" width="' + w_body + '" height="' + h_body + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>');
document.write('</object>');

document.writeln("</div>");
document.writeln("</div>");

var QQfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var QQst = document.getElementById("ShowQQ").style;
QQst.top = ( QQfrm.clientHeight - h_body ) + "px";
QQst.left = ( QQfrm.clientWidth - w_body - 1 ) + "px";

function moveR() {
	QQst.top = ( QQfrm.scrollTop + QQfrm.clientHeight - h_body ) + "px";
	QQst.left = ( QQfrm.scrollLeft + QQfrm.clientWidth - w_body - 1 ) + "px";
}

setInterval("moveR();", 80);

function CloseIt(){
	QQst.display='none';
}

function closeDiv(){
document.getElementById('ImgLayer').style.visibility='hidden';
}

function getcookie(cName)
{
	var search = cName + "="
	var returnvalue = "";
	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;
			returnvalue=unescape(document.cookie.substring(offset, end));
		}
	}
	return returnvalue;
}

function setcookie(cName,value)
{
	cookie_time = 24*60*60;
	var then = new Date();
	then.setTime(then.getTime() + cookie_time*1000);
	document.cookie=cName+'='+value+';expires='+ then.toGMTString()+';path=/;';
}
