var ShockMode = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
	if (navigator.plugins && navigator.plugins["Shockwave Flash"]) 
	ShockMode = 1;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
	document.write('</SCR' + 'IPT\> \n');
}
	

function getAd(flashPath, imagePath, adID, adPlacementID, target, adWidth, adHeight){
	if (ShockMode!=0) {
		if (flashPath=='img'){
			writehtmlpage(flashPath, imagePath, adID, adPlacementID, target, adWidth, adHeight);
		} else {
			writeflashpage(flashPath, imagePath, adID, adPlacementID, target, adWidth, adHeight);
		}
	} else {
		ishtml=true;
		writehtmlpage(flashPath, imagePath, adID, adPlacementID, target, adWidth, adHeight);
	}
}

function writeflashpage(flashPath, imagePath, adID, adPlacementID, target, adWidth, adHeight){
	document.open();
	qstring='?clickTAG=/link.php?adID=' + adID + '%26' + 'adPlacementID=' + adPlacementID + '&target=' + target;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.write(' width="');
	document.write(adWidth);
	document.write('" height="');
	document.write(adHeight);
	document.write('" id="hv" align="">');
	document.write('  <param name="movie" value="');
	document.write(flashPath + qstring);
	document.write('"> <param name="quality" value="high"><param name="bgcolor" value="#FFFFFF"><param name="scale" value="exactfit"><embed src="');
	document.write(flashPath + qstring);
	document.write('" quality=high bgcolor=#ffffff  width="');
	document.write(adWidth);
	document.write('" height="');
	document.write(adHeight);
	document.write('" scale="exactfit" name="hv" align=""');
	document.write('  type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer"></embed>');
	document.write(' </object>');
	document.close();
}

function writehtmlpage(flashPath, imagePath, adID, adPlacementID, target, adWidth, adHeight){
	document.open();
	document.write ('<a href="link.php?adID=');
	document.write (adID);
	document.write ('&adPlacementID=');
	document.write (adPlacementID);
	document.write ('" ');
	document.write (target);
	document.write ('><img src="');
	document.write (imagePath);
	document.write ('" alt="');
	document.write (imagePath);
	document.write ('" border="0" width="');
	document.write (adWidth);
	document.write ('"></a>');
	document.close();
}

// BLANK ADS --------------------------------------------------------------------------------------------------

function getBlankAd(flashPath, imagePath, adID, adWidth, adHeight, url){
	if (ShockMode!=0) {
		if (flashPath=='img'){
			writehtmlpage_blank(imagePath, adWidth, adHeight, url);
		} else {
			writeflashpage_blank(flashPath, adWidth, adHeight, url);
		}
	} else {
		ishtml=true;
		writehtmlpage_blank(imagePath, adID, adWidth, adHeight, url);
	}
}

function writeflashpage_blank(flashPath, adWidth, adHeight, url){
	document.open();
	qstring='?clickTAG=' + url;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.write(' width="');
	document.write(adWidth);
	document.write('" height="');
	document.write(adHeight);
	document.write('" id="hv" align="">');
	document.write('  <param name="movie" value="');
	document.write(flashPath + qstring);
	document.write('"> <param name="quality" value="high"><param name="bgcolor" value="#FFFFFF"><param name="scale" value="exactfit"><embed src="');
	document.write(flashPath + qstring);
	document.write('" quality=high bgcolor=#ffffff  width="');
	document.write(adWidth);
	document.write('" height="');
	document.write(adHeight);
	document.write('" scale="exactfit" name="hv" align=""');
	document.write('  type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer"></embed>');
	document.write(' </object>');
	document.close();
}

function writehtmlpage_blank(imagePath, adWidth, adHeight, url){
	document.open();
	document.write ('<a href="' + url + '">');
	document.write ('<img src="');
	document.write (imagePath);
	document.write ('" alt="');
	document.write (imagePath);
	document.write ('" border="0" width="');
	document.write (adWidth);
	document.write ('"></a>');
	document.close();
}