// Custom WGC javascripts written by J.P.
// Forces cursor into Access ID field for member login
function LoginInit() {
	document.LoginForm.AccessID.focus(); 
//	document.getElementById("AccessID").focus();
}
// General onvalidate routine to make sure that a cfselect option has been chosen (other than the --select --)
// must have some value other than a null string to be passed as true
// onvalidate always passes 3 parameters: the form object, the field object and the value of the field
function CheckCFSelect(form,field,value) {
	if (value == '')
		{
		return false;
		}
	return true;
}
// special routine for validating the Promotion page URL
function ValPromoURL(form,field,value) {
for (var i=0; i < document.Promo.Action.length; i++)
   {
   if (document.Promo.Action[i].checked)
      {
      var rad_val = document.Promo.Action[i].value;
      }
   }
	if (rad_val == 'U' & value == '')
		{
		return false;
		}
	return true;
}
// special routine for validating the Promotion page Large Image
function ValPromoImage(form,field,value) {
for (var i=0; i < document.Promo.Action.length; i++)
   {
   if (document.Promo.Action[i].checked)
      {
      var rad_val = document.Promo.Action[i].value;
      }
   }
	if (rad_val == 'I' & value == '')
		{
		return false;
		}
	return true;
}



// function to open a CF Ajax window and invoke the code that runs it
function WinGo(WindowName,WindowCode) {
	ColdFusion.Window.show(WindowName);
	ColdFusion.navigate(WindowCode,WindowName);
}

// from common.js
function turnoff(id) 
{
	var e = document.getElementById(id);
	e.style.display = 'none';
}

function turnon(id) 
{
	var e = document.getElementById(id);
	e.style.display = 'block';
}

