

function openWindow(url,x,y) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + x + ',height=' + y + '');
mywin.focus();
}

function submitThis() {
give = true;
txtMsg = "Please select an option for: \n\n";
choiceTripValue = document.quote.choiceTrip.options[document.quote.choiceTrip.selectedIndex].value;
gatewayValue = document.quote.gateway.options[document.quote.gateway.selectedIndex].value;
dateValue = document.quote.date.options[document.quote.date.selectedIndex].value;

if( choiceTripValue == "" || choiceTripValue == "PC-TCNL" || choiceTripValue == "TO-TCNL" || choiceTripValue == "CR-THNL" || choiceTripValue == "SO-CHNL" || choiceTripValue == "QC-TCNL" || choiceTripValue == "AC-TCNL") {give = false; txtMsg += "> Golfcan \"Choice Trip\"\n"}
if( gatewayValue == "") {give = false; txtMsg += "> Departure Point\n"}
if( dateValue == "") {give = false; txtMsg += "> Departure Date Range\n"}

if ( choiceTripValue != "" && choiceTripValue != "PC-TCNL" && choiceTripValue != "CR-THNL" && choiceTripValue != "TO-TCNL" && choiceTripValue != "SO-CHNL" && choiceTripValue != "QC-TCNL" && choiceTripValue != "AC-TCNL"){
//alert("In")
//alert(choiceTripValue)
//Find out where the choice trip is available from
choiceTripAvilFrom = document.quote.choiceTrip.options[document.quote.choiceTrip.selectedIndex].value
choiceTripAvilFromAR = choiceTripAvilFrom.split("-");
//Find out the gateway code from the selected gateway (in this case it's the first charater)
selectedGateway = document.quote.gateway.options[document.quote.gateway.selectedIndex].value.charAt(0)

if (choiceTripAvilFromAR[1].indexOf(selectedGateway)==-1){give = false; txtMsg = "Pricing for the choice trip you have selected is not available from this departure gateway.\nPlease select again or contact Golfcan for more detailed pricing information.\n"}

}
if(!give){
alert (txtMsg);
}
if(give){
//win = window.open(url,"popup",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + x + ',height=' + y + '');
document.quote.submit();
//win.focus();
//} else {
//win.close();
//return false;
}
}


var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printPage() {
  if (pr) // NS4, IE5
    window.print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  return false;
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

function fixElement(element, message) {
alert(message);
element.focus();
}

function chkForm(form) {
var passed = false;
    if (form.name.value == "") {
    fixElement(form.name, "Please include your name.");
    }
    else if (form.phone.value == 0) {
    fixElement(form.phone, "Please include a daytime phone number.");
    }
    else if (form.email.value == "") {
    fixElement(form.email, "Please include your email address.");
    }
    else {
    //getInfo(form);
    //setSubject(form);
    passed = true;
    }
return passed;
}