/** 
* Browser detection
*/

var IE = ((parseInt(navigator.appVersion)>=4)&&(navigator.appName.indexOf("Microsoft")!=-1))? 1:0;


/**			
*			Function: showFlashDiv
*			@author Stephen McCall
*			This function was written specifically to ensure that the Flash content
*			on the Income Annuity pages would load and play appropriately only when
*			the DIV containing it is visible to the user.
*			
*			@param {String} divID name of div to hide/show
*			@param {Boolean} visibility 1 or 0, sets visiblity of divID
*			@param {String} flashURL URL to flash file to be displayed in divID
*			@param {String} flashHeight height of flash file
*			@param {String} flashWidth width of flash file
*
*			Note: this function depends on the "flash.js" file for flash detection
*			@see "flash.js"
*/

var IE = ((parseInt(navigator.appVersion)>=4)&&(navigator.appName.indexOf("Microsoft")!=-1))? 1:0;

function closeFlashDiv(divID) {
	var div_visibility;
	div_visibility = "hidden";
	
	document.getElementById(divID).style.visibility = div_visibility;
	document.getElementById(divID).innerHTML = flashObject;
}


function showFlashDiv(divID,visibility,flashURL,flashHeight,flashWidth){

var div_visibility;

if (parseInt(flash.version) >= 7) {

var flashObject = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="'+flashWidth+'" HEIGHT="'+flashHeight+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ID=testcommand><PARAM NAME="MOVIE" VALUE="'+flashURL+'"><param name="wmode" value="transparent" /><param name="allowFullScreen" value="true" /><PARAM NAME="PLAY" VALUE="false"><PARAM NAME="LOOP" VALUE="false"><PARAM NAME="QUALITY" VALUE="high"><PARAM NAME="SCALE" VALUE="SHOWALL"><PARAM NAME="BASE" VALUE="flv/"><EMBED SRC="'+flashURL+'" wmode="transparent" allowFullScreen="true" WIDTH="'+flashWidth+'" HEIGHT="'+flashHeight+'" PLAY="false"  LOOP="false" QUALITY="high" TYPE="application/x-shockwave-flash" SCALE="SHOWALL"  swLiveConnect="true" PLUGINSPAGE="http://www.macromedia.com/go/flashplayer/"  BASE="flv/" /></EMBED></OBJECT>';


 	if(visibility == 1) { div_visibility = "visible"; }
	else { div_visibility = "hidden"; }
	
	document.getElementById(divID).style.visibility = div_visibility;
	document.getElementById(divID).innerHTML = flashObject;
	
}

else {

ofPopWinVideo("/products/annuities/income/download_flash.shtml");

	}
	
	if (visibility == 2) {
	showFlashDiv(divID, 0);
	document.quizlink.submit();
	}
	
}

/**
* Custom window opening function to ensure window stays on top of parent window
*/
function ofPopWinIntermediate(theURL) {

newWindow = window.open(theURL,'infowindow','toolbar=no,location=no,scrollbars=yes,status=no,menubar=no,resizable=yes,fullscreen=no,left=80,top=80,height=376,width=418');
newWindow.focus();
}
