function openWindow(URL,W,H,TITLE) {			
	wid = window.open(URL, TITLE, "toolbar=no,status=no,directories=no,location=no,scrollbars=yes,width="+ W + ",height=" + H);
}

function popup(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i < a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  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];}}
}


function MM_findObj(n, d) { 
  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;
}

function MM_swapImage() { 
  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];}
}

function MM_jumpMenu(targ,selObj,restore){ 

		if (selObj.options[selObj.selectedIndex].value != '')
			{		
		  eval("window.open('"+selObj.options[selObj.selectedIndex].value+"')");
		  if (restore) selObj.selectedIndex=0;
		    }
}

function DestSelected(formName,selObj){

	eval("document." + formName + ".itemSelected.value = selObj.options[selObj.selectedIndex].value");
	eval("document." + formName + ".submit()");
}

function DestSelectedRes(formName,selObj){

	eval("document." + formName + ".itemSelectedRes.value = selObj.options[selObj.selectedIndex].value");
	eval("document." + formName + ".submit()");
}

function SubmitIt(formName){ 
	eval("document." + formName + ".submit()");
}

function SubmitIt2(formName,var2Check){ //v3.0
	if(eval("document."+formName+"."+var2Check+".value") != '') {
		eval("document." + formName + ".submit()");
	}
}

function openSaveurPopup() {
	var savSubUrl = "http://www.saveur.com/SubscribePopup/1,3236,,00.html?origin=GD";
	var props = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=620,height=482';
	window.open(savSubUrl,'',props);
}

function filter(field) {
	re = /\$|,|\D/g;
	return field.replace(re, "");
}

function switchPage(direction,formObj) {
  if (direction == "-")
    formObj.page.value--;
  if (direction == "+")
    formObj.page.value++;
  formObj.submit();
}

function switchPageExtra(direction,formObj) {
  if (direction == "-")
    formObj.pageExtra.value--;
  if (direction == "+")
    formObj.pageExtra.value++;
  formObj.submit();
}

function jump(site) {
  if (site != "") {
    window.open(site,"","");
  } else {
    return false;
  }
}


 
function checkrequired(which) {
  var pass=true;
  if (document.images) {
	for (i=0;i<which.length;i++) {
	var tempobj=which.elements[i];
	if (tempobj.name.substring(0,8)=="required") {
	   if (((tempobj.type=="text"||tempobj.type=="textarea")&&
		 tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
		 tempobj.selectedIndex==0)) {
		 pass=false;
		 break;
									}
							 }
						}
					}

	 if (!pass) {
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		alert("Please make sure the "+shortFieldName+" field was properly completed.");
		return false;
				}
	else
	return true;
}

function clearFields()
{
	document.eventForm.eventname.value = "";

}

function openSubscribeWindow() {
	var url="subscribe.html";
	var windowName = "subscribe";
	var characteristics = "width=500,height=400";
	window.open(url,windowName,characteristics);
}

function validateme() {
    
	Xdone=0
	optionbox=document.voterpoll.ANSWER.length

	for (i=0; i < optionbox; i++)
		{
	        if (document.voterpoll.ANSWER[i].checked )      
				Xdone=1;
		}
								      
		    if (Xdone==0) 			
		        alert("Please select an answer");
			else
				document.voterpoll.submit();	
	}
	
function searchIt()
{

	if (document.contentsearch.searchTxt.value != "")
		document.contentsearch.submit();	
}

function validate(formObj) {
			if (formObj.name.value == "" || formObj.address1.value == "" || formObj.city.value == ""
			|| formObj.state.value == "" || formObj.zip.value == "" || formObj.clientType.value == ""
			|| formObj.clientCategory == "" || formObj.phone.value == ""
			|| formObj.contact.value == "" || formObj.email.value == "") {
				alert("You have left a required field blank");
				return;
			} else {
				formObj.submit();
			}		
		}	



function Client_Display(url) {
	var newWindow;
	var props = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300';
	newWindow = window.open(url, "ClientInfo", props);

}	

// This is for the PhpAdsNew banner system - do not delete
function phpads_deliverActiveX(content)
{
	document.write(content);	
}
	
		