//////
//validate function
//////////

function noEntry() {
mt=document.contact.eventType.value;
if ((mt.length<1)||(mt.substring(0,6)=="******")) {
alert("You must include your event type");
document.contact.eventType.value="Complete This Entry";
document.contact.eventType.focus();
return false;
}
else { return true; }
}

//////
//validate function register
//////////

function noEntryR() {
mt=document.register.storelocation.value;
if ((mt.length<1)||(mt.substring(0,6)=="******")) {
alert("You must include a store location");
document.register.storelocation.value="Complete This Entry";
document.register.storelocation.focus();
return false;
}
else { return true; }
}

/////////////
//reset function
////////

function resetform(){
	document.contact.reset()
}

////////////


///////////////
//open window function
///////////////

var isClicked=0
var newWindow=null
function openWindow(swap1,swap2)
{
if((isClicked>0)&&(newWindow.closed==false))
        {
        newWindow.close();
        }
newWindow=window.open(swap1,'',swap2);
isClicked++
}
function closeWindow()
{
if(newWindow)
        {
        newWindow.close()
        }
}


//MODIFY ACCORDINGLY FOR WEBSPEED

// An adaptation of Dorcht's function for setting a cookie.
function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

// An adaptation of Dorcht's function for deleting a cookie.
function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// popup window script
var isClicked=0
var newWindow=null

function openWindow2()
{
if((isClicked>0)&&(newWindow.closed==false))
	{
	newWindow.close();
	}
newWindow=window.open('difference.html','','width=600,height=400,top=25,left=150,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes');
isClicked++
}


function closeWindow2()
{
if(newWindow)
	{
	newWindow.close()
	}
}


