/*
DHTML/Flash Superimposed Ad
John Topp
Ininfet Communications
www.infinetcommunications.com
*/

function detectPlatform() {
	if (navigator.appVersion.indexOf("Windows") != -1) return true;
	else return false;
}

var isCompatible = false;

var intAdNumber = Math.round(Math.random());
/* intAdNumber = intAdNumber + 1; */
intAdNumber = 1;

var strAdDivHTML = '<div id="adDiv" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; visibility: hidden;">'
strAdDivHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100%" height="100%">'
strAdDivHTML += '<param name="movie" value="/nuvaringAds/nuvaRing'
strAdDivHTML += intAdNumber
strAdDivHTML += '.swf?page=4" />'
strAdDivHTML += '<param name="quality" value="high" />'
strAdDivHTML += '<param name="wmode" value="transparent" />'
strAdDivHTML += '<embed src="/nuvaringAds/nuvaRing'
strAdDivHTML += intAdNumber
strAdDivHTML += '.swf" quality="high" wmode="transparent" width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'
strAdDivHTML += '</object>'
strAdDivHTML += '</div>'

function writeAdDiv() {
	if ((detectPlatform()) && (hasRightVersion) && (document.getElementById) && !(navigator.appName.indexOf("Netscape")>(-1))) {
		isCompatible = true;
		document.write(strAdDivHTML);
	}
}

function showAdDiv() {
	if (isCompatible) {
		document.getElementById('adDiv').style.visibility = 'visible';
		document.getElementById('trackingFrame').src = 'nuvaringAd_impressions.asp?ad=' + intAdNumber;
	}
}

function hideAdDiv() {
	document.getElementById('adDiv').style.visibility = 'hidden';
}