var EXua,EXan,EXie5,EXie6,EXwin,EXexpires,EXdomain,EXdone,EXcap,EXkeyval,EXlan;
var EXred=EXr0.substring(0,EXr0.length-5);
EXua=navigator.userAgent;
EXan=navigator.appName;
EXie5=EXua.indexOf('MSIE 5')>=0;
EXie6=EXua.indexOf('MSIE 6')>=0;
EXwin=EXua.indexOf('Windows')>=0;
EXcap=false;
EXlan=false;
EXdone=false;

if (EXLANonly) {
 var EXb=document.body;
 EXb.style.behavior='url(#default#clientCaps)';
 if (EXb.connectionType == 'lan') {
  EXlan = true;
 }
}
if (EXie5&&EXwin || EXie6&&EXwin) {
	if (EXLANonly) {
		if (EXlan) {
			EXcap=true;
		}
	} else {
		EXcap=true;
	}
} 
if (EXisRevExp) {
	EXexpires = EXdays*24*60*60*1000;
	EXdomain = ".yahoo.com";
	EXdone = false;
}

function EXsetCook(t) {
 var d = new Date;
 d.setTime(d.getTime() + EXexpires);
 document.cookie = EXckey+'=t='+t+'; expires='+d.toGMTString()+'; domain='+EXdomain+'; path=/';
}
function EXgetCook() {
 var a,s,e;
 a = document.cookie;
 if (a == '') return false;
 s = a.indexOf(EXckey+'=');
 if (s == -1) return false;
 s += EXckey.length+1;
 e = a.indexOf(';',s);
 if (e == -1) e = a.length;
 return a.substring(s,e);
}
if (EXcap&&EXisRevExp) {
 var EXcook=EXgetCook();
 if (EXcook == false) {
  EXsetCook(1);
  EXcook=EXgetCook();
  if (EXcook == false) {
    EXdone = true;
  }
 } else {
  var EXi;
  EXcooks = EXcook.split('&');
  for (EXi=0; EXi<EXcooks.length; EXi++) {
   EXkeyval = EXcooks[EXi].split('=');
   if (EXkeyval == 't') {
    last;
   }
  }
  EXkeyval[1]++;
  if (EXkeyval[1] > EXtimes) {
   EXdone = true;
  } else {
   EXsetCook(EXkeyval[1]);
  }
 }
}

if (EXtest) {
	EXdone=false;
}
function EXtr(s) {
 var srd='http://s'+EXred.substring(7,EXred.length);
 var img=new Image;     
 img.src=srd+s+'/'+Math.random()+'/*1';
}
function EXopenAd1st() {
	document.all.EXiframe1st.style.visibility="visible";
}
function EXopenAd() {
	document.all.EXiframe.style.visibility="visible";
	EXtr('R=10/id=number_of_times_opened');
}
function EXcloseAd() {
	document.all.EXiframe.style.visibility="hidden";
	document.all.EXiframe1st.style.visibility="hidden";
	EXtr('N=1/id=number_of_times_closed');
}
function EXload() {
	EXresizeit();
	EXopenAd1st();
}
function EXsmClicks(x) {
	var startr=200;
	var y;
	y = EXred+'R='+(startr+x)+'/';
	if (EXsmLabels[x]) {
		if (EXsmLabels[x] != "") {	
			m=EXsmLabels[x];			
			m=m.replace(/ /g,"_");
			m=m.replace(/\(/g,"");
			m=m.replace(/\)/g,"");
			m=m.replace(/\:/g,"_");
			m=escape(m);
			y=y+'id='+m+'/';
		}
	}
	y=y+'*'+EXsmFlashTargetURL[x];
	if (EXsmNewWin[x]) {
		if (EXsmNewWinHeight[x]&&EXsmNewWinWidth[x]) {
			window.open(y,'NewWin','height='+EXsmNewWinHeight[x]+',width='+EXsmNewWinWidth[x]);
		} else {
			window.open(y);
		}
	} else {
		window.location=y;
	}
}
function EXlgClicks(x) {
	var startr=100;
	var y;
	y = EXred+'R='+(startr+x)+'/';
	if (EXlgLabels[x]) {
		if (EXlgLabels[x] != "") {
			m=EXlgLabels[x];			
			m=m.replace(/ /g,"_");
			m=m.replace(/\(/g,"");
			m=m.replace(/\)/g,"");
			m=m.replace(/\:/g,"_");
			m=escape(m);
			y=y+'id='+m+'/';
		}
	}
	y=y+'*'+EXlgFlashTargetURL[x];
	if (EXlgNewWin[x]) {
		if (EXlgNewWinHeight[x]&&EXlgNewWinWidth[x]) {
			window.open(y,'NewWin','height='+EXlgNewWinHeight[x]+',width='+EXlgNewWinWidth[x]);
		} else {
			window.open(y);
		}
	} else {
		window.location=y;
	}
}
var EXtimer;
function EXsetTimer() {
	EXtimer = setTimeout("EXcloseAd()", maxTime);
}
function EXsecondTimer() {
	EXtimer = setTimeout("EXcloseAd()", secondTime);
}
function EXclearTimer() {
	clearTimeout(EXtimer);
}

function EXresizeit() {
 var c,d;
 var x=0;
 var y=0;
 c = 'document.all.EXsmImg';
 while (eval(c)) {
  x += eval(c+'.offsetLeft;');
  y += eval(c+'.offsetTop;');
  c += '.offsetParent';
 }
 document.all.EXiframe1st.style.pixelTop = y+EXlgOffHeight;
 document.all.EXiframe1st.style.pixelLeft = x+EXlgOffWidth; 
 if (EXisRevExp&&!EXdone) {
	 EXsetTimer();
 }
 document.all.EXiframe.style.pixelTop = y+EXlgOffHeight;
 document.all.EXiframe.style.pixelLeft = x+EXlgOffWidth;  

}

if (EXcap) {
	document.write('<SCR'+'IPT LANGUAGE=VBScript> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	document.write('</SCR'+'IPT> \n');
	
	document.write('<iframe border=0 frameborder=0 style="visibility: hidden; position: absolute; z-index: 100; height: '+EXlgHeight+'; width: '+EXlgWidth+'; top: 0; left: 0" id=EXiframe1st src="about:blank" name=EXniframe1st onmouseover="EXclearTimer()" onmouseout="EXsecondTimer()"></iframe>');
	document.write('<iframe border=0 frameborder=0 style="visibility: hidden; position: absolute; z-index: 100; height: '+EXlgHeight+'; width: '+EXlgWidth+'; top: 0; left: 0" id=EXiframe src="about:blank" name=EXniframe></iframe>');
	if (plugin) {
		if (EXsmUseFlash) {
			document.write('<OBJECT id=EXsmImg classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" WIDTH='+EXsmWidth+' HEIGHT='+EXsmHeight+'><PARAM NAME=movie VALUE="'+EXsmFlashURL+'"><PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF></OBJECT>');
		} else {
			document.write('<a href="javascript: EXopenAd()"><img id=EXsmImg border=0 WIDTH='+EXsmWidth+' HEIGHT='+EXsmHeight+' src="'+EXsmImgURL+'"></a>');
		}
		
		document.frames('EXniframe1st').document.open();
		document.frames('EXniframe1st').document.write('<html><body rightmargin=0 leftmargin=0 topmargin=0 bottommargin=0 bgcolor=white>');
		document.frames('EXniframe1st').document.writeln('<scr'+'ipt language=javascript>');
		document.frames('EXniframe1st').document.writeln('function banner_clicks(x) {EXlgClicks(x);}');
		document.frames('EXniframe1st').document.writeln('function EXlgClicks(x) {parent.EXlgClicks(x);}');
		document.frames('EXniframe1st').document.writeln('function EXcloseAd() {parent.EXcloseAd();}');
		document.frames('EXniframe1st').document.writeln('function closeAd() {parent.EXcloseAd();}');
		document.frames('EXniframe1st').document.writeln('</scr'+'ipt>');
		document.frames('EXniframe1st').document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" WIDTH='+EXlgWidth+' HEIGHT='+EXlgHeight+'><PARAM NAME=movie VALUE="'+EXlgFlashURL1st+'"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF></OBJECT>');
		document.frames('EXniframe1st').document.write('</body></html>');
		document.frames('EXniframe1st').document.close();
		
		document.frames('EXniframe').document.open();
		document.frames('EXniframe').document.write('<html><body rightmargin=0 leftmargin=0 topmargin=0 bottommargin=0 bgcolor=white>');
		document.frames('EXniframe').document.writeln('<scr'+'ipt language=javascript>');
		document.frames('EXniframe').document.writeln('function banner_clicks(x) {EXlgClicks(x);}');
		document.frames('EXniframe').document.writeln('function EXlgClicks(x) {parent.EXlgClicks(x);}');
		document.frames('EXniframe').document.writeln('function EXcloseAd() {parent.EXcloseAd();}');
		document.frames('EXniframe').document.writeln('function closeAd() {parent.EXcloseAd();}');
		document.frames('EXniframe').document.writeln('</scr'+'ipt>');
		document.frames('EXniframe').document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" WIDTH='+EXlgWidth+' HEIGHT='+EXlgHeight+'><PARAM NAME=movie VALUE="'+EXlgFlashURL+'"><PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF></OBJECT>');
		document.frames('EXniframe').document.write('</body></html>');
		document.frames('EXniframe').document.close();

	} else {
		document.write('<a href="'+EXsmImgTargetURL+'"><img border=0 WIDTH='+EXsmWidth+' HEIGHT='+EXsmHeight+' src="'+EXsmImgURL+'"></a>');
	}
	
	window.onresize=EXresizeit;
	
	if (EXisRevExp&&!EXdone) {
		window.onload=EXload;
	} else {
		window.onload=EXresizeit;
	}
	
} else {
	document.write('<a href="'+EXsmImgTargetURL+'"><img border=0 WIDTH='+EXsmWidth+' HEIGHT='+EXsmHeight+' src="'+EXsmImgURL+'"></a>');
}
