/* Disable Right Click */
//document.oncontextmenu = new Function("return false;");

/* START:Flash Detect*/
/* START: Force Numeric */
function ForceNumeric(field)
{
	var inputStr = field.value.toString();
	var strLength = inputStr.length;
	var newStr = "";
	for (var i = 0; i < strLength; i++) 
{
	var oneChar = inputStr.charAt(i); 
	if (!( isNaN(oneChar) || oneChar == ' ') || oneChar == '-' ) 
	{ 
		newStr = String(newStr) + String(field.value.substring(i,i+1));
	}
}
	if (newStr != field.value) 
	{
		field.value = newStr;
	}
}
function NumericKeyUp(fieldToEval,fieldToEvalLength,objToJumpTo) 
{
	ForceNumeric(fieldToEval);
	if ((fieldToEval.value.length == fieldToEvalLength)&& (fieldToEval.value != prevValue) && (objToJumpTo != null))
	{ 
		objToJumpTo.focus() 
	} 
		prevValue = fieldToEval.value;
}
/* END: Force Numeric */

/* START: Zip Code Validation */
function ValidateZip (sZip)
{
	var regZip = /(^\d{5}$)|(^\d{5}-\d{4}$)/;

	if (sZip == '')
	{
		alert('Please Enter Your Zip Code');
		return false;
	}
	else if (!regZip.test(sZip))
	{
		alert('The Zip Code Entered Is Not Valid');
		return false;
	}
	else return true;
}
/* END: Zip Code Validation */

/* START: Show Help Window */
var m_oHelpWin

function ShowHelp(helpType) 
{	
	//var URL = "store/include/savon_help_menu.asp?Type=" helpType;
	popupWin = window.open("store/include/savon_help_menu.asp?Type=" + helpType + "",'Menu','width=520,height=420,scrollbars,titlebar=no')
	window.top.name = 'opener';	
}
function Certify(URL) {
  popupWin = window.open(URL, 'Participant', 'width=450,height=300,scrollbars,titlebar=no')
  window.top.name = 'opener';
}
function ShowTerms() {
  popupWin = window.open('store/include/terms_conditions.asp','Terms','width=520,height=420,scrollbars,titlebar=no')
  window.top.name = 'opener';
}
/* END: Show Help Window */





function swapImg(imgid,id) {
  o = document.getElementById(imgid);
  o.src = o.src.replace(/_\d\./,'_'+id+'.');
}

/* OpenWindow
ACTION:
Open a new instance of browser
NOTES:
Multiple calls will re-use the same window;
Scrollable arg should be "scroll" or "no_scroll" for ease of reading(nothing cryptic)
*/
function OpenWindow(url,height,width,top,left,scrollable){
  var owcscroll = (scrollable=='scroll')?'yes':'no';
  cm_ow = window.open(url,'cm_ow','height='+height+',width='+width+',resizable=1,top='+ top +',left='+ left +',scrollbars='+owcscroll);
  cm_ow.focus();
}