/************************************************************************/
/*                        START SNEAK PEEK POP-UP                       */
/************************************************************************/
function shownewwin(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) {
	var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 660, h = 300;  
	if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
	if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
	if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
		if (document.all || document.layers || document.getElementById) {
			w = screen.availWidth; h = screen.availHeight;
		}
		if (winAlign.indexOf("center") != -1) {
			topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;
		}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight;
		if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0;
		if (winAlign.indexOf("top") != -1) topPos = 0; 						
		features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;
	}
	if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
	if (window["popupWindow"] == null) window["popupWindow"] = new Array();
	var wp = popupWindow.length;
	popupWindow[wp] = window.open(theURL,winName,features);
	if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
	if (document.all || document.layers || document.getElementById) {
		if (borderless && borderless != "") {
			popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);
		}
		if (alwaysOnTop && alwaysOnTop != "") {
			ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
			popupWindow[wp].document.body.onload = function() {
				window.setInterval("window.focus();", 50);
		};
		}
		if (autoCloseTime && autoCloseTime > 0) {
			popupWindow[wp].document.body.onbeforeunload = function() {
				if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
				window.onbeforeunload = null;
			}  
			autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000);
		}
		window.onbeforeunload = function() {
			for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();
		};
	}   
	document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}
/************************************************************************/
/*                         END SNEAK PEEK POP-UP                        */
/************************************************************************/


/************************************************************************/
/*                        START BOOKMARK FUNCTION                       */
/************************************************************************/
// This is a cross browser (Firefox 1.x+, IE4+ and Opera7+) 
// script for allowing the user to easily bookmark the site, 
// by clicking on a link on the page.
// Add this to the href link: javascript:bookmarksite('Bookmark Name/Title','URL');
function bookmarksite(title,url){
	if (window.sidebar) // opens firefox bookmark dialogue
	window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print) { // opens opera bookmark dialogue
		var lvll = document.createElement('a');
		lvll.setAttribute('href',url);
		lvll.setAttribute('title',title);
		lvll.setAttribute('rel','sidebar');
		lvll.click();
	} 
	else if(document.all) // opens ie bookmark dialogue
	window.external.AddFavorite(url, title);
}

/************************************************************************/
/*                         END BOOKMARK FUNCTION                        */
/************************************************************************/


/************************************************************************/
/*                         START PRINT FUNCTION                         */
/************************************************************************/
function printme() { 
	window.print(); 
}
/************************************************************************/
/*                          END PRINT FUNCTION                          */
/************************************************************************/

/************************************************************************/
/*                 START MULTIPLE ADD TO CART FUNCTION                  */
/************************************************************************/
// Make sure that at lease one item has been selected
function checkMultipleAddToCart() {	
	var foundSelected = false;	
	for(var i=0;i<document.forms[0].length;i++){		
		if(document.forms[0].elements[i].type == 'select-one' && document.forms[0].elements[i].id.substr(0, 41) == '_ctl0__ctl0_OESMultipleAddToCart1_select_'){			
			
			if(document.forms[0].elements[i].selectedIndex > 0){
				foundSelected = true;				
				break;
			}
		}
	}	
	if(!foundSelected)alert('Please select one benefit');		 
	return foundSelected; 
}
/************************************************************************/
/*                 END MULTIPLE ADD TO CART FUNCTION                    */
/************************************************************************/



/*########################################*/
/*      START THE POPUP WINDOW SCRIPT     */
/*########################################*/
function shownewwin(windowURL, windowName, windowFeatures) {
	var newWindow = window.open(windowURL, windowName, windowFeatures);
	newWindow.focus(); 
	return;
 }
/*######################################*/
/*      END THE POPUP WINDOW SCRIPT     */
/*######################################*/

/*########################################*/
/* START THE FLASH FIX FOR THE INDEX PAGE */
/*########################################*/
function playSXAFlash() { 
document.write('<script language="JavaScript" type="text/javascript">  \n');
document.write('var requiredMajorVersion = 6; \n');
document.write('var requiredMinorVersion = 0; \n');
document.write('var requiredRevision = 0; \n');
document.write('var jsVersion = 1.0; \n');
document.write('</script>  \n');
document.write('<script language="VBScript" type="text/vbscript">  \n');
document.write('Function VBGetSwfVer(i)  \n');
document.write('  on error resume next  \n');
document.write('  Dim swControl, swVersion  \n');
document.write('  swVersion = 0  \n');
document.write('  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))  \n');
document.write('  if (IsObject(swControl)) then  \n');
document.write('    swVersion = swControl.GetVariable("$version")  \n');
document.write('  end if  \n');
document.write('  VBGetSwfVer = swVersion  \n');
document.write('End Function  \n');
document.write('</script>  \n');
document.write('<script language="JavaScript1.1" type="text/javascript">  \n');
document.write('var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; \n');
document.write('var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; \n');
document.write('var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; \n');
document.write('jsVersion = 1.1; \n');
document.write('function JSGetSwfVer(i) { \n');
document.write('	if (navigator.plugins != null && navigator.plugins.length > 0) { \n');
document.write('		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { \n');
document.write('			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; \n');
document.write('      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; \n');
document.write('			descArray = flashDescription.split(" "); \n');
document.write('			tempArrayMajor = descArray[2].split("."); \n');
document.write('			versionMajor = tempArrayMajor[0]; \n');
document.write('			versionMinor = tempArrayMajor[1]; \n');
document.write('			if ( descArray[3] != "" ) { \n');
document.write('				tempArrayMinor = descArray[3].split("r"); \n');
document.write('			} \n');
document.write('			else { \n');
document.write('				tempArrayMinor = descArray[4].split("r"); \n');
document.write('			} \n');
document.write('      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0; \n');
document.write('            flashVer = versionMajor + "." + versionMinor + "." + versionRevision; \n');
document.write('      	} \n');
document.write('		else { \n');
document.write('			flashVer = -1; \n');
document.write('		} \n');
document.write('	} \n');
document.write('	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; \n');
document.write('	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; \n');
document.write('	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; \n');
document.write('	else { \n');
document.write('		flashVer = -1; \n');
document.write('	} \n');
document.write('	return flashVer; \n');
document.write('}  \n');
document.write('function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)  {  \n');
document.write(' 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);  \n');
document.write('	for (i=25;i>0;i--) {	  \n');
document.write('		if (isIE && isWin && !isOpera) {  \n');
document.write('			versionStr = VBGetSwfVer(i);  \n');
document.write('		}  \n');
document.write('		else {  \n');
document.write('			versionStr = JSGetSwfVer(i);  \n');		
document.write('		}  \n');
document.write('		if (versionStr == -1 ) {   \n');
document.write('			return false;  \n');
document.write('		}  \n');
document.write('		else if (versionStr != 0) {  \n');
document.write('			if(isIE && isWin && !isOpera) {  \n');
document.write('				tempArray         = versionStr.split(" ");  \n');
document.write('				tempString        = tempArray[1];  \n');
document.write('				versionArray      = tempString .split(",");  \n');				
document.write('			}  \n');
document.write('			else {  \n');
document.write('				versionArray      = versionStr.split(".");  \n');
document.write('			}  \n');
document.write('			versionMajor      = versionArray[0];  \n');
document.write('			versionMinor      = versionArray[1];  \n');
document.write('			versionRevision   = versionArray[2];  \n');
document.write('			versionString     = versionMajor + "." + versionRevision;     \n');
document.write('			versionNum        = parseFloat(versionString);  \n');
document.write('			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {  \n');
document.write('				return true;  \n');
document.write('			}  \n');
document.write('			else {  \n');
document.write('				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	  \n');
document.write('			}  \n');
document.write('		}  \n');
document.write('	}	  \n');
document.write('	return (reqVer ? false : 0.0);  \n');
document.write('}  \n');
// -->
document.write('</script>  \n');
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) { 
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="531" height="239" id="23591_sxa_flash" align="middle"> \n');
         document.write('<param name="allowScriptAccess" value="sameDomain" /> \n');
         document.write('<param name="movie" value="../flash/sxa_flash.swf" /> \n');
         document.write('<param name="menu" value="false" /> \n');
         document.write('<param name="allowFullScreen" value="false" /> \n');
         document.write('<param name="quality" value="high" /> \n');
         document.write('<param name="bgcolor" value="#939393" /> \n');
         document.write('<param name="wmode" value="opaque" /> \n');
         document.write('<embed src="../flash/sxa_flash.swf" quality="high" bgcolor="#939393" width="531" height="239" id="flash_player2" name="flash_player2" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n');
        document.write('</object>\n');
	}
	else { 
        document.write('<a href="http://www.macromedia.com/go/getflash/" target="_blank">Visit Adobe for the latest plugin</a>\n');
  	}
}

/*######################################*/
/* END THE FLASH FIX FOR THE INDEX PAGE */
/*######################################*/
