<!-- Hide script from old browsers

/*
This script contains some JavaScript functions used throughout the site
*/
function SlideShow(prod){
	var finalUrl = 'index.cfm?fuseaction=slideshow.' + prod;
	var settings  ='height=550,';
	  settings +='width=750,';
	  settings +='scrollbars=no,';
	  settings +='resizable=no,';
	  settings +='status=yes,';
	  settings +='menubar=no,';
	  settings +='toolbar=no';
	win=window.open(finalUrl,'slideshow',settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
	
	// 	Minimize Browser Window
		function Minimize() 
		{
		window.innerWidth = 100;
		window.innerHeight = 100;
		window.screenX = screen.width;
		window.screenY = screen.height;
		alwaysLowered = true;
		}
		
	// 	Maximize Browser Window	
		function Maximize() 
		{
		window.innerWidth = screen.width;
		window.innerHeight = screen.height;
		window.screenX = 0;
		window.screenY = 0;
		alwaysLowered = false;
		}	

	//Opens Custom Pop-Up Window in Center of User's Screen
	/*  To implement this JavaScript, simply cut/paste the following code into your form and enter the desired values for the stated variables 
	    <a href="JavaScript:NewWindow('url','windowname','w','h','scroll','resizable','location','status','menubar','toolbar');">Text or Image Link</a> */
		function NewWindow(url,windowname,w,h,scroll,resizable,location,status,menubar,toolbar){
		  var winl = (screen.width-w)/2;
		  var wint = (screen.height-h)/2;
		  var settings  ='height='+h+',';
		      settings +='width='+w+',';
		      settings +='top='+wint+',';
		      settings +='left='+winl+',';
		      settings +='scrollbars='+scroll+',';
		      settings +='resizable='+resizable+',';
		      settings +='location='+location+',';
		      settings +='status='+status+',';
		      settings +='menubar='+menubar+',';
		      settings +='toolbar='+toolbar+',';
		  win=window.open(url,windowname,settings);
		  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
		}
		
	//Opens URL in New Full Screen Window
	/*  To implement this JavaScript, simply cut/paste the following code into your form and enter the desired values for the stated variables 
	    <a href="javascript:void(0);" onClick="JavaScript:NewWindowFS('url','windowname','top','left','scroll','resizable','location','status','menubar','toolbar');">Text or Image Link</a> */
		function NewWindowFS(url,windowname,top,left,scroll,resizable,location,status,menubar,toolbar){
		  var settings  ='height='+screen.height+',';
		      settings +='width='+screen.width+',';
		      settings +='top='+top+',';
		      settings +='left='+left+',';
		      settings +='scrollbars='+scroll+',';
		      settings +='resizable='+resizable+',';
		      settings +='location='+location+',';
		      settings +='status='+status+',';
		      settings +='menubar='+menubar+',';
		      settings +='toolbar='+toolbar+',';
		  win=window.open(url,windowname,settings);
		  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
		}

	// Confirms User Action
	/* Sample Usage: onClick="return ConfirmAction('Enter Confirmation Text Here');" */
		function ConfirmAction(ConfirmationTxt)
		{
		if (confirm(ConfirmationTxt))
		{return true;}  
		else
		return false;
		}
		
	// Alerts User
	/* Sample Usage: onClick="return Alert('Enter Alert Text Here');" */
	<!-- Hide script from old browsers
		function Alert(AlertTxt)
		{
			alert(AlertTxt)
		}

	//Prevents user from leaving pop-up in background and not being able to use the link
		window.focus();


	//Preload Images
		function MM_preloadImages() { //v3.0
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}

	//Restore images
		function MM_swapImgRestore() { //v3.0
		  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
		}

	//Find Document Images and put into array
		function MM_findObj(n, d) { //v4.0
		  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		  if(!x && document.getElementById) x=document.getElementById(n); return x;
		}

	//Swap images
		function MM_swapImage() { //v3.0
		  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
		}
		
	//Prevents "ENTER" Key From Submitting Form
		/*
		To implement, place this code in your form that you wish to disable the "ENTER" Key:
		
		<SCRIPT LANGUAGE="JavaScript">
			<!-- Begin
				document.onkeypress = onKeyPress;
			//  End -->
		</script>
		
		*/
			function onKeyPress () {
			var keycode;
			if (window.event) keycode = window.event.keyCode;
			else if (e) keycode = e.which;
			else return true;
			if (keycode == 13) {
			alert("To submit this form, please use the button below.  To advance to another input field, use your 'Tab' key.");
			return false
			}
			return true 
			}	
			
			
		// Disables input fields based on user's current input
			//	onClick="document.FormName???.FormField???.disabled=document.FormName???.FormField???.readOnly = !this.checked;"	
	
		// Check for Flash and write browser plugin appropriate code
		/* Example Usage:
			<script language="JavaScript">
				<!-- //
					FlashCheck('4','<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=6,0,0,0" WIDTH="341" HEIGHT="288" id="ToughQuestions" ALIGN=""> <PARAM NAME=movie VALUE="ToughQuestions.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=##FFFFFF> <EMBED src="ToughQuestions.swf" quality=high bgcolor=##FFFFFF  WIDTH="341" HEIGHT="288" NAME="ToughQuestions" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>','<img src="#VARIABLES.DirLevel#images/BannerAds/341x288_ToughCompQuestions.jpg" alt="" width="341" height="288" border="0">');
				// -->
			</script>
		*/		
			function FlashCheck(FlashVer,FlashCode,NonFlashCode)
				{
					if ((navigator.appName == "Microsoft Internet Explorer" &&
					    navigator.appVersion.indexOf("Mac") == -1 && 
					    navigator.appVersion.indexOf("3.1") == -1) ||
					    (navigator.plugins && navigator.plugins["Shockwave Flash"]) || 
						navigator.plugins["Shockwave Flash" + FlashVer])
						{
						// Insert Flash Object Tag
							document.write(FlashCode);
						}
				   else {
						// Insert Image Tag
							document.write(NonFlashCode);
						}
				}		
	
// End hiding script from old browsers -->


// Prevents machines from grabbing email addresses from our websites
/*
<script language="JavaScript">SafeEmail('John_Smith','SomeSite.com','Subject Line','Link Text');</script>
*/

function moreInfo(fa,ht) {
	var url = '/index.cfm?fuseaction=' + fa;
	NewWindow(url,'moreinfo','785',ht,'no','yes','no','no','no','no')
}

function SafeEmail(EmailName,DomainName,SubjectLine,VisibleLink){
	document.write('<a href=mailto:'+EmailName+'@'+DomainName+'?Subject='+SubjectLine+'>'+VisibleLink+'</a>');
}

function SafeEmailwClass(EmailName,DomainName,SubjectLine,VisibleLink,cls){
	var text = '<a href="mailto:' + EmailName;
	text += '@'+DomainName;
	text += '?Subject='+SubjectLine;
	text += '" class="' + cls + '">'
	text += VisibleLink+'</a>';
	document.write(text);/**/
}

function doVerisign() {
	NewWindow('https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=WWW.ERIERI.COM&lang=en','seal','530','420','no','yes','yes','no','no');
}

function disableButton(obj,text) {
	obj.disabled = true;
	obj.value = text;
}

function addToFavorites(url,name) {
	if (window.external) {
		window.external.AddFavorite(url,name) 
	} else {
		alert("Sorry! Your browser doesn't support this function.");
	}
}
function doFieldsMatch(field1, field2){
	if (field1.value == field2.value) return true;
	else {	msg = 'The values in ' + field1.name + ' and ' +field2.name + ' must match.';
		alert(msg);
		return false;
	}
}



