
//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.doughoodgolfschool.com"
var bookmarktitle="Doug Hood Golf School"

function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}

function printthis()
{
if (window.print != null) 
{ window.print(); }
 else
 { alert('Unfortunately, your browser does not support this shortcut.  Please select Print from the File menu.'); }
}

function checkContactUs()
{
	if (document.frmData.strContactName.value=="")
	{
		alert("The Contact Name is required information!");
		return false;
	}
	if (document.frmData.strEmail.value=="")
	{
		alert("The eMail Address is required information!");
		return false;
	}
	if (document.frmData.strMessage.value=="")
	{
		alert("The Message is required information!");
		return false;
	}
	return true;
}

function checkReservation()
{	
	if (document.frmData.strContactName.value=="")
	{
		alert("The Contact Name is required information!");
		return false;
	}
	if (document.frmData.strEmail.value=="")
	{
		alert("The eMail Address is required information!");
		return false;
	}
	if (document.frmData.intExperienceId.value=="0")
	{
		alert("The Experience is required information!");
		return false;
	}
	if (document.frmData.intLevelId.value=="0")
	{
		alert("The Level of English is required information!");
		return false;
	}

	var cHand = document.frmData.chkHand;	
	var valid = false;
	for (i = 0; i< cHand.length; ++ i)
        {
            if (cHand [i].checked)
            {
	       valid=true;
            }            		
        }		
	if (valid==false)
	{
	   alert("Please indicate if you are Left or Right Handed!");
	   return false;
	}

	if (document.frmData.strDate.value=="" || document.frmData.strDate.value=="  Click The Icon  >>>")
	{
	   alert("The Date Required is required information!");
	   return false;
	}
	if (document.frmData.intTimeId.value=="")
	{
		alert("The Preferred Time is required information!");
		return false;
	}

	var cTuition = document.frmData.chkTuition;	
	valid = false;	
	for (i = 0; i< cTuition.length; ++ i)
        {
          if (cTuition[i].checked)
          {
	     valid=true;
          }            		
        }
	if (valid==false) 
	{
	   alert("Please select an individual or group lesson");
	   return false;
	}  			
	return true;  
}

function checkEmailFriend()
{
	if (document.frmData.strName.value=="")
	{
		alert("Your Name is required information!");
		return false;
	}
	if (document.frmData.strEmail.value=="")
	{
		alert("Your eMail Address is required information!");
		return false;
	}
	if (document.frmData.strRecipientName(0).value=="")
	{
		alert("The Recipient's Name 1 is required information!");
		return false;
	}
	if (document.frmData.strRecipientEmail(0).value=="")
	{
		alert("The Recipient's eMail Address 1 is required information!");
		return false;
	}
	if (document.frmData.strRecipientName(1).value=="" && document.frmData.strRecipientEmail(1).value!="")
	{
		alert("The Recipient's Name 2 is required information!");
		return false;
	}
	if (document.frmData.strRecipientName(1).value!="" && document.frmData.strRecipientEmail(1).value=="")
	{
		alert("The Recipient's eMail Address 2 is required information!");
		return false;
	}
	if (document.frmData.strRecipientName(2).value=="" && document.frmData.strRecipientEmail(2).value!="")
	{
		alert("The Recipient's Name 3 is required information!");
		return false;
	}
	if (document.frmData.strRecipientName(2).value!="" && document.frmData.strRecipientEmail(2).value=="")
	{
		alert("The Recipient's eMail Address 3 is required information!");
		return false;
	}
	return true;
}

