<!--
function addComment(adID){window.open('/forms/addComment.asp?adID='+adID+'', 'Comment', config='width=400,height=324,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,screeny=100,screenx=100,left=200,top=200');
 }
function launchVideo(adID){window.open('/player/?adID='+adID+'', 'Ad', config='width=400,height=324,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,screeny=100,screenx=100,left=200,top=200');
 }
function addCommentWorld(wID){window.open('/forms/addComment.asp?wID='+wID+'', 'Comment', config='width=400,height=324,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,screeny=100,screenx=100,left=200,top=200');
 }
function sendWorld(wID){window.open('/forms/send.asp?wID='+wID+'', 'Send', config='width=400,height=420,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,screeny=100,screenx=100,left=200,top=200');
 }
function sendPassword(wID){window.open('/forms/password.asp', 'Password', config='width=400,height=420,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,screeny=100,screenx=100,left=200,top=200');
 }

function confirmDel(theStr, msg) 
	{
		if (confirm(msg))
			{
				this.location.href=(theStr);
			}
	}

 

// AJAX  POST
function postWine(userID,menuID,wineID,winePrice,wineVintage){
//	alert (winePrice)
//	alert (wineVintage)
var xmlHttp
xmlHttp=GetXmlHttpObject()
var url = "/data/menuProcess.asp";
var params = "userID="+userID+"&menuID="+menuID+"&wineID="+wineID+"&winePrice="+escape(winePrice)+"&wineVintage="+escape(wineVintage) ;
xmlHttp.open("POST", url, true);

//Send the proper header information along with the request
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");

xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
		alert(xmlHttp.responseText);
	}
//	alert(xmlHttp.readyState)
//	alert(xmlHttp.status)
}
xmlHttp.send(params);

}

function changeList(itemID, wineAddbody){
//alert ("here")
var xmlHttp
xmlHttp=GetXmlHttpObject()
//alert(document.forms[].wineAddbody.value)
var url = "/data/menuProcessDescription.asp";
var params = "itemID="+itemID+"&wineAddbody="+escape(wineAddbody);
xmlHttp.open("POST", url, true);

//Send the proper header information along with the request
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");

xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
		alert(xmlHttp.responseText);
	}
//	alert(xmlHttp.readyState)
//	alert(xmlHttp.status)
}
xmlHttp.send(params);

}

//clear headers
function clearHeader(){
  document.getElementById("txtHeader").innerHTML="";
  return;
  }

// Headers
function showHeader(intItem)
{
xmlHttp=GetXmlHttpObject()
var url="/data/header.asp";
url=url+"?headID="+intItem;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedHeader;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChangedHeader() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHeader").innerHTML=document.getElementById("txtHeader").innerHTML+xmlHttp.responseText;
}
}


// GLOBAL AJAX
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


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;
}

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];}}
}

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;
}

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];}
}

function launchTemplate(tID){window.open('/templatePreview.asp?ref='+tID+'', 'OriginEnlarge', config='height=500,width=700,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no,screeny=100,screenx=100,left=200,top=200');
 }
 
 function containsChars(xvar)
	{
		for (k=0;k<xvar.length;k++)
			{
				if(isNaN(xvar.charAt(k))) return true;
			}
		return false;			
	}
	
	function isWhitespace (s)
		{   
			var i;
			// whitespace characters
			var whitespace = " \t\n\r";

		    // Is s empty?
		    if (isEmpty(s)) return true;

		    // Search through string's characters one by one
			// until we find a non-whitespace character.
		    // When we do, return false; if we don't, return true.

		    for (i = 0; i < s.length; i++)
			    {   
			        // Check that current character isn't whitespace.
			        var c = s.charAt(i);

			        if (whitespace.indexOf(c) == -1) return false;
			    }

		    // All characters are whitespace.
		    return true;
		}		
		
	function isEmpty(s)
		{   
			return ((s == null) || (s.length == 0));
		}		
	
								
function valEmail(el) {
	var invalidChars = " /:,;";
 	if (el.value == "") {
   		alert("Please enter your email address.");
		el.focus();
		return (true);
	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
    	if (el.value.indexOf(badChar,0) != -1) {
		   	alert("Your email address contains an invalid character, please correct it.");
			el.focus();
			return (true);
	    }
	}
	atPos = el.value.indexOf("@",1);
	if (atPos == -1) {
	   	alert("Your email address must contain an @ character.");
		el.focus();
		return (true);
	}
	if (el.value.indexOf("@",atPos+1) != -1) {
	   	alert("Your email address must have letters before the @ character.");
		el.focus();
		return (true);
	}
	periodPos = el.value.indexOf(".",atPos);
	if (periodPos == -1) {
	   	alert("Your email address must contain a . character.");
		el.focus();
		return (true);
	}
	if (periodPos+3 > el.value.length) {
	   	alert("Your email address must have letters after the . character.");
		el.focus();
		return (true);
	}
	return (false);
}

function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }

    if (cnt > -1) return true;
    else return false;
//    if (cnt > -1) return btn[cnt].value;
//    else return null;
}
                  
 
//-->