function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return false;
}

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}


function apply_groupID( FormName ) {

	var groupID = get_cookie ("groupID");

	if(groupID) {
		eval( "document." + FormName + ".USERIDENTRY.value = groupID;" );

		eval ( "document." + FormName + ".submit();" );
	}
	else {
		window.open('http://coolride.hudsonltd.net/res');
	}

}

function display_phone() {

	var groupID = get_cookie("groupID");
	
	if(groupID == "code1") {
		document.write( "<font color=#040404 size=3>(323) 963-7900</font>");
	}
	else {
		document.write("<img src='../images/home-number.gif' alt='CoolRide Phone Number - Contact for Limousine Service in Acton'>");
	}
	
}

function PostData (type, option, FormName) {

	var groupID = get_cookie ("groupID");

	if(groupID) {
		eval( "document." + FormName + ".USERIDENTRY.value = groupID;" );

//		eval( "document." + FormName + ".LINKNAME.value= type;" );

		eval( "document." + FormName + "." + type + ".value = option;" );

		eval( "document." + FormName + ".INTV1.value = 'laxfares.db|/var/\w\w\w/cgi-bin/html/skins/HudsonFX/v105/s0urt.html|0|DEFAULT||||||" + groupID + "|03||||||cr1||||';" );

		eval ( "document." + FormName + ".submit();" );
	}
	else {
		window.open('http://coolride.hudsonltd.net/res');
	}
}

function PostData2 (type) {

	var f=document.RES_PART1;
	
	var groupID = get_cookie ("groupID");

	if (groupID) {

		f.LINKNAME.value= type;
		eval( "f.INTV1.value = 'laxfares.db|/var/\w\w\w/cgi-bin/html/skins/HudsonFX/v105/s0urt.html|0|DEFAULT||||||" + groupID.toUpperCase() + "|03||||||cr1||||';" );
	//	f.INTV1.value = "laxfares.db|/var/www/cgi-bin/html/skins/HudsonFX/v105/s0urt.html|0|DEFAULT||||||GS1|03||||||cr1||||";
		f.action = "https://coolride.hudsonltd.net/res";
	//	f.action = "http://www.hashemian.com/tools/form-post-tester.php";
		f.submit();
	}
	else {
		f.LINKNAME.value = type;

		eval( "f." + type + ".value = 'ROUNDTRIP';" );
		f.submit();
	}
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    // for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

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 changeImages() {
//	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
//	}
}

function mmLoadMenus() {
  window.mm_menu_1 = new Menu("root",185,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_1.addMenuItem("Airport Services", "location='../services/airport_transportation_limo.html'");
  mm_menu_1.addMenuItem("Hourly Charter & Point-to-Point", "location='../services/limousine_charter.html'");
  mm_menu_1.addMenuItem("Special Occasions", "location='../services/limousine_rental.html'");
  mm_menu_1.addMenuItem("Tours & Sightseeing", "location='../services/limo_tours_sightseeing.html'");
   mm_menu_1.fontWeight="bold";
   mm_menu_1.hideOnMouseOut=true;
   mm_menu_1.menuBorder=1;
   mm_menu_1.menuLiteBgColor='#ECECEC';
   mm_menu_1.menuBorderBgColor='#ECECEC';
   mm_menu_1.bgColor='#cccccc';
  window.mm_menu_2 = new Menu("root",175,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_2.addMenuItem("Client Survey", "location='../customer_care/client-survey.php5'");
  mm_menu_2.addMenuItem("Incident Report", "location='../customer_care/incident-report.php5'");
  mm_menu_2.addMenuItem("Travel Policies", "location='../customer_care/limousine_travel_policies.html'");
  mm_menu_2.addMenuItem("Arrival Information", "location='../customer_care/airport_limo_service.html'");
  mm_menu_2.addMenuItem("Terms of Service", "location='../customer_care/limousine_service.html'");
   mm_menu_2.fontWeight="bold";
   mm_menu_2.hideOnMouseOut=true;
   mm_menu_2.menuBorder=1;
   mm_menu_2.menuLiteBgColor='#ECECEC';
   mm_menu_2.menuBorderBgColor='#ECECEC';
   mm_menu_2.bgColor='#cccccc';
  window.mm_menu_3 = new Menu("root",193,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_3.addMenuItem("Corporate Services", "location='../corporate/business_services_limousine.html'");
  mm_menu_3.addMenuItem("Pricing", "location='../corporate/limousine_pricing.html'");
   mm_menu_3.fontWeight="bold";
   mm_menu_3.hideOnMouseOut=true;
   mm_menu_3.menuBorder=1;
   mm_menu_3.menuLiteBgColor='#ECECEC';
   mm_menu_3.menuBorderBgColor='#ECECEC';
   mm_menu_3.bgColor='#cccccc';
  window.mm_menu_4 = new Menu("root",185,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, true, 97);
  mm_menu_4.addMenuItem("Quality Assurance", "location='../about/limousine_quality.html'");
  mm_menu_4.addMenuItem("Professional Drivers", "location='../about/professional_drivers.html'");
  mm_menu_4.addMenuItem("Travel Agency Programs", "location='../about/limousine_travel_policies.html'");
  mm_menu_4.addMenuItem("Owner-Operator Opportunities", "location='../about/owner-operator.html'");
   mm_menu_4.fontWeight="bold";
   mm_menu_4.hideOnMouseOut=true;
   mm_menu_4.menuBorder=1;
   mm_menu_4.menuLiteBgColor='#ECECEC';
   mm_menu_4.menuBorderBgColor='#ECECEC';
   mm_menu_4.bgColor='#cccccc';
	mm_menu_4.writeMenus();

} // mmLoadMenus()

function mmLoadMenus2() {
  window.mm_menu_1 = new Menu("root",185,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_1.addMenuItem("Airport Services", "location='services/airport_transportation_limo.html'");
  mm_menu_1.addMenuItem("Hourly Charter & Point-to-Point", "location='services/limousine_charter.html'");
  mm_menu_1.addMenuItem("Special Occasions", "location='services/limousine_rental.html'");
  mm_menu_1.addMenuItem("Tours & Sightseeing", "location='services/limo_tours_sightseeing.html'");
   mm_menu_1.fontWeight="bold";
   mm_menu_1.hideOnMouseOut=true;
   mm_menu_1.menuBorder=1;
   mm_menu_1.menuLiteBgColor='#ECECEC';
   mm_menu_1.menuBorderBgColor='#ECECEC';
   mm_menu_1.bgColor='#cccccc';
  window.mm_menu_2 = new Menu("root",175,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_2.addMenuItem("Customer Feedback", "location='customer_care/limousine_customer_feedback.html'");
  mm_menu_2.addMenuItem("Travel Policies", "location='customer_care/limousine_travel_policies.html'");
  mm_menu_2.addMenuItem("Arrival Information", "location='customer_care/airport_limo_service.html'");
  mm_menu_2.addMenuItem("Terms of Service", "location='customer_care/limousine_service.html'");
   mm_menu_2.fontWeight="bold";
   mm_menu_2.hideOnMouseOut=true;
   mm_menu_2.menuBorder=1;
   mm_menu_2.menuLiteBgColor='#ECECEC';
   mm_menu_2.menuBorderBgColor='#ECECEC';
   mm_menu_2.bgColor='#cccccc';
  window.mm_menu_3 = new Menu("root",193,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_3.addMenuItem("Corporate Services", "location='corporate/business_services_limousine.html'");
  mm_menu_3.addMenuItem("Pricing", "location='corporate/limousine_pricing.html'");
   mm_menu_3.fontWeight="bold";
   mm_menu_3.hideOnMouseOut=true;
   mm_menu_3.menuBorder=1;
   mm_menu_3.menuLiteBgColor='#ECECEC';
   mm_menu_3.menuBorderBgColor='#ECECEC';
   mm_menu_3.bgColor='#cccccc';
  window.mm_menu_4 = new Menu("root",185,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, true, 97);
  mm_menu_4.addMenuItem("Quality Assurance", "location='about/limousine_quality.html'");
  mm_menu_4.addMenuItem("Professional Drivers", "location='about/professional_drivers.html'");
  mm_menu_4.addMenuItem("Travel Agency Programs", "location='about/limousine_travel_policies.html'");
  mm_menu_4.addMenuItem("Owner-Operator Opportunities", "location='about/owner-operator.html'");
   mm_menu_4.fontWeight="bold";
   mm_menu_4.hideOnMouseOut=true;
   mm_menu_4.menuBorder=1;
   mm_menu_4.menuLiteBgColor='#ECECEC';
   mm_menu_4.menuBorderBgColor='#ECECEC';
   mm_menu_4.bgColor='#cccccc';
	mm_menu_4.writeMenus();

} // mmLoadMenus2()

function mmLoadMenus3() {
  window.mm_menu_1 = new Menu("root",185,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_1.addMenuItem("Airport Services", "location='../../services/airport_transportation_limo.html'");
  mm_menu_1.addMenuItem("Hourly Charter & Point-to-Point", "location='../../services/limousine_charter.html'");
  mm_menu_1.addMenuItem("Special Occasions", "location='../../services/limousine_rental.html'");
  mm_menu_1.addMenuItem("Tours & Sightseeing", "location='../../services/limo_tours_sightseeing.html'");
   mm_menu_1.fontWeight="bold";
   mm_menu_1.hideOnMouseOut=true;
   mm_menu_1.menuBorder=1;
   mm_menu_1.menuLiteBgColor='#ECECEC';
   mm_menu_1.menuBorderBgColor='#ECECEC';
   mm_menu_1.bgColor='#cccccc';
  window.mm_menu_2 = new Menu("root",175,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_2.addMenuItem("Customer Feedback", "location='../../customer_care/limousine_customer_feedback.html'");
  mm_menu_2.addMenuItem("Travel Policies", "location='../../customer_care/limousine_travel_policies.html'");
  mm_menu_2.addMenuItem("Arrival Information", "location='../../customer_care/airport_limo_service.html'");
  mm_menu_2.addMenuItem("Terms of Service", "location='../../customer_care/limousine_service.html'");
   mm_menu_2.fontWeight="bold";
   mm_menu_2.hideOnMouseOut=true;
   mm_menu_2.menuBorder=1;
   mm_menu_2.menuLiteBgColor='#ECECEC';
   mm_menu_2.menuBorderBgColor='#ECECEC';
   mm_menu_2.bgColor='#cccccc';
  window.mm_menu_3 = new Menu("root",193,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, false, 0);
  mm_menu_3.addMenuItem("Corporate Services", "location='../../corporate/business_services_limousine.html'");
  mm_menu_3.addMenuItem("Pricing", "location='../../corporate/limousine_pricing.html'");
   mm_menu_3.fontWeight="bold";
   mm_menu_3.hideOnMouseOut=true;
   mm_menu_3.menuBorder=1;
   mm_menu_3.menuLiteBgColor='#ECECEC';
   mm_menu_3.menuBorderBgColor='#ECECEC';
   mm_menu_3.bgColor='#cccccc';
  window.mm_menu_4 = new Menu("root",185,22,"Arial, Helvetica, sans-serif",11,"#3B143B","#ffffff","#ECECEC","#883388","top","middle",3,0,1000,0,-64,true,true,true,0,true,true, true, 97);
  mm_menu_4.addMenuItem("Quality Assurance", "location='../../about/limousine_quality.html'");
  mm_menu_4.addMenuItem("Professional Drivers", "location='../../about/professional_drivers.html'");
  mm_menu_4.addMenuItem("Travel Agency Programs", "location='../../about/limousine_travel_policies.html'");
  mm_menu_4.addMenuItem("Owner-Operator Opportunities", "location='../../about/owner-operator.html'");
   mm_menu_4.fontWeight="bold";
   mm_menu_4.hideOnMouseOut=true;
   mm_menu_4.menuBorder=1;
   mm_menu_4.menuLiteBgColor='#ECECEC';
   mm_menu_4.menuBorderBgColor='#ECECEC';
   mm_menu_4.bgColor='#cccccc';
	mm_menu_4.writeMenus();

} // mmLoadMenus3()


function sendSurvey() {
	
	$chauffeurOnTime = $('input[name=chauffeurOnTime]:checked').val();
	$chauffeurWaiting = $('input[name=chauffeurWaiting]:checked').val();
	$chauffeurAppearance = $('input[name=chauffeurAppearance]:checked').val();
	$chauffeurOpenedDoor = $('input[name=chauffeurOpenedDoor]:checked').val();
	$chauffeurWater = $('input[name=chauffeurWater]:checked').val();
	$chauffeurPrepared = $('input[name=chauffeurPrepared]:checked').val();
	$chauffeurDroveSafe = $('input[name=chauffeurDroveSafe]:checked').val();
	$chauffeurProfessional = $('input[name=chauffeurProfessional]:checked').val();
	$chauffeurComments = $('textarea[name=chauffeurComments]').val();
	
	$vehicleInterior = $('input[name=vehicleInterior]:checked').val();
	$vehicleExterior = $('input[name=vehicleExterior]:checked').val();
	$vehicleMechanical = $('input[name=vehicleMechanical]:checked').val();
	$vehicleComments = $('textarea[name=vehicleComments]').val();
	
	$resMethod = $('input[name=resMethod]:checked').val();
	
	$agentFriendly = $('input[name=agentFriendly]:checked').val();
	$agentKnowledgable = $('input[name=agentKnowledgable]:checked').val();
	$agentProcessedEfficiently = $('input[name=agentProcessedEfficiently]:checked').val();
	$agentEmailConfirmation = $('input[name=agentEmailConfirmation]:checked').val();
	$agentComments = $('textarea[name=agentComments]').val();
	
	$webSimple = $('input[name=webSimple]:checked').val();
	$webErrorFree = $('input[name=webErrorFree]:checked').val();
	$webEmailConfirmation = $('input[name=webEmailConfirmation]:checked').val();
	$webComments = $('textarea[name=webComments]').val();	
	
	$overallExperience = $('input[name=overallExperience]:checked').val();
	$overallComments = $('textarea[name=overallComments]').val();
	$quote = $('input[name=quote]:checked').val();
	
	$name = $('input[name=name]').val();
	$nameCompleting = $('input[name=nameCompleting]').val();
	$relationship = $('select[name=relationship]').val();
	$date = $('input[name=date]').val();
	$resNumber = $('input[name=resNumber]').val();
	$phone = $('input[name=phone]').val();
	$email = $('input[name=email]').val();
	$company = $('input[name=company]').val();
	
	$mailingList = $('input[name=mailingList]:checked').val();
	$mailingEmail = $('input[name=mailingEmail]').val();
	
	$subject = $('input[name=subject]').val();
	$source = $('input[name=source]').val();
	
	if($name == '') {
		alert("Please enter your name.");
		$('input[name=name]').focus();
		return false;
	}
	
	if($date == '') {
		alert("Please enter your date of travel.");
		$('input[name=date]').focus();
		return false;
	}
	
	if($mailingList == 'Yes' && ($mailingEmail == '' || $mailingEmail == 'Email address')) {
		alert("In order to receive CoolRide news and information, please enter a valid email address.");
		$('input[name=mailingEmail]').focus();
		return false;
	}
	
	var datastr ='CHAUFFEUR=--' + '&Chauffeur was on time for your pickup=' + $chauffeurOnTime + '&Our chauffeur was waiting for you in a professional manner at the correct location=' + $chauffeurWaiting + '&Chauffeur appearance - professionally attired and well groomed=' + $chauffeurAppearance + '&Chauffeur opened doors and handled luggage=' + $chauffeurOpenedDoor + '&Chauffeur provided you with a cool bottle of water=' + $chauffeurWater + '&Chauffeur was prepared for the trip and knew directions=' + $chauffeurPrepared + '&Chauffeur drove in a safe manner=' + $chauffeurDroveSafe + '&Chauffeur was professional and courteous=' + $chauffeurProfessional + '&Chauffeur additional comments=' + $chauffeurComments + '&VEHICLE=--' + '&Interior cleanliness=' + $vehicleInterior + '&Exterior cleanliness=' + $vehicleExterior + '&Mechanical condition=' + $vehicleMechanical + '&Vehicle additional comments=' + $vehicleComments + '&RESERVATIONS=--' + '&What method did you use to make reservation(s)?=' + $resMethod + '&CALL CENTER=--' + '&The agent was friendly and courteous=' + $agentFriendly + '&The agent was knowledgable=' + $agentKnowledgable + '&Your reseravtion was processed efficiently=' + $agentProcessedEfficiently + '&You received an email confirmation within 15 minutes=' + $agentEmailConfirmation + '&Agent additional comments=' + $agentComments + '&WEB RESERVATIONS=--' + '&The process was simple and intuitive=' + $webSimple + '&The process was error free=' + $webErrorFree + '&You received a web email confirmation within 15 minutes=' + $webEmailConfirmation + '&Web additional comments=' + $webComments + '&OVERALL EXPERIENCE=--' + '&How would you rate your overall experience with CoolRide?=' + $overallExperience + '&Overall additional comments=' + $overallComments + '&It is okay to quote me on the CoolRide web site=' + $quote + '&CONTACT INFORMATION=--' + '&Name=' + $name + '&Name Completing Survey=' + $nameCompleting + '&Relationship=' + $relationship + '&Date of travel=' + $date + '&Reservation Number=' + $resNumber + '&Phone=' + $phone + '&Email=' + $email + '&Company=' + $company + '&Please send me CoolRide updates and information =' + $mailingList + '&Subject=' + $subject + '&Source=' + $source;
	
//	$("#response").css("display", "block");
	document.location.hash = "submit";
	$("#response").html("Sending survey results .... ");
//	$('#survey').css('overflow','hidden');
//	$('#survey').animate({height:0},500);
	$('#survey').fadeOut(900);
	$("#response").fadeIn(500);
	setTimeout("send('"+datastr+"')",2000);
	
	return false;
	
}


function sendIncident() {
		
	$name = $('input[name=name]').val();
	$passengerName = $('input[name=passengerName]').val();
	$relationship = $('select[name=relationship]').val();
	$replyBy = $('select[name=replyBy]').val();
	$contactInfo = $('input[name=contactInfo]').val();
	$resNumber = $('input[name=resNumber]').val();
	$date = $('input[name=date]').val();
	$accountName = $('input[name=accountName]').val();
	$description = $('textarea[name=description]').val();
	
	$subject = $('input[name=subject]').val();
	
	if($passengerName == '') {
		alert("Please enter the passenger name.");
		$('input[name=passengerName]').focus();
		return false;
	}
	
	if($contactInfo == '' || $contactInfo == 'Phone Number' || $contactInfo == 'Fax Number' || $contactInfo == 'E-Mail Address') {
		if($contactInfo == '') $contactInfo = "Contact Information";
		alert("Please Enter Your " + $contactInfo);
		$('input[name=contactInfo]').focus();
		return false;
	}
	
	if($resNumber == '' && $date == '') {
		alert("Please enter your reservation number or date of travel.");
		$('input[name=resNumber]').focus();
		return false;
	}
	
	var datastr ='Name=' + $name + '&Passenger Name=' + $passengerName + '&Relationship=' + $relationship + '&' + $replyBy + '=' + $contactInfo + '&Reservation Number=' + $resNumber + '&Date of travel=' + $date + '&Account Name=' + $accountName + '&Description=' + $description + '&Subject=' + $subject;
	
//	$("#response").css("display", "block");
	document.location.hash = "submit";
	$("#response").html("Sending Incident Report .... ");
	$("#response").fadeIn(500);
	setTimeout("send('"+datastr+"')",2000);
	
	return false;
	
}

$(document).ready(function () {
	
	if($('input[name=contactInfo]').val() == '' || $('input[name=contactInfo]').val() == 'Phone Number' || $('input[name=contactInfo]').val() == 'Fax Number' || $('input[name=contactInfo]').val() == 'E-Mail Address') {
		$('input[name=contactInfo]').css('color','#999');
		if($('select[name=replyBy]').val() == 'Phone') $('input[name=contactInfo]').val('Phone Number');
		if($('select[name=replyBy]').val() == 'Fax') $('input[name=contactInfo]').val('Fax Number');
		if($('select[name=replyBy]').val() == 'E-Mail') $('input[name=contactInfo]').val('E-Mail Address');
	}
	
	$('select[name=replyBy]').change(function() {
		if($('input[name=contactInfo]').val() == '' || $('input[name=contactInfo]').val() == 'Phone Number' || $('input[name=contactInfo]').val() == 'Fax Number' || $('input[name=contactInfo]').val() == 'E-Mail Address') {
			if($('select[name=replyBy]').val() == 'Phone') $('input[name=contactInfo]').val('Phone Number');
			if($('select[name=replyBy]').val() == 'Fax') $('input[name=contactInfo]').val('Fax Number');
			if($('select[name=replyBy]').val() == 'E-Mail') $('input[name=contactInfo]').val('E-Mail Address');
		}
	});
	
	$('input[name=contactInfo]').blur(function() {
		if($('input[name=contactInfo]').val() == '') {
			$('input[name=contactInfo]').css('color','#999');
			if($('select[name=replyBy]').val() == 'Phone') $('input[name=contactInfo]').val('Phone Number');
			if($('select[name=replyBy]').val() == 'Fax') $('input[name=contactInfo]').val('Fax Number');
			if($('select[name=replyBy]').val() == 'E-Mail') $('input[name=contactInfo]').val('E-Mail Address');
		}
	});
	
	$('input[name=contactInfo]').focus(function() {
		if($('input[name=contactInfo]').val() == 'Phone Number' || $('input[name=contactInfo]').val() == 'Fax Number' || $('input[name=contactInfo]').val() == 'E-Mail Address') {
			$('input[name=contactInfo]').val('');
			$('input[name=contactInfo]').css('color','#000');
		}
	});
	
	$('input[name=email]').blur(function(){
		if($('input[name=mailingEmail]').val() == '' || $('input[name=mailingEmail]').val() == 'Email address') {
			$('input[name=mailingEmail]').val($('input[name=email]').val());
			$('input[name=mailingEmail]').css('color','#000');
		}
	});
	
	$('input[name=mailingEmail]').blur(function() {
		if($('input[name=mailingEmail]').val() == '') {
			$('input[name=mailingEmail]').val('Email address');
			$('input[name=mailingEmail]').css('color','#999');
		}
	});
	
	$('input[name=mailingEmail]').focus(function() {
		if($('input[name=mailingEmail]').val() == 'Email address') {
			$('input[name=mailingEmail]').val('');
			$('input[name=mailingEmail]').css('color','#000');
		}
	});
	
	$('input[name=mailingList]').change(function() {
		
		if($('input[name=mailingList]:checked').val() == 'No') {
			$('input[name=mailingEmail]').attr('disabled', true);
			$('input[name=mailingEmail]').fadeOut(200);
		}
		else {
			$('input[name=mailingEmail]').removeAttr('disabled');
			$('input[name=mailingEmail]').fadeIn(200);
		}
	});		

	
});

function send(datastr){
	$.ajax({	
		type: "POST",
		url: "/script/mail.php5",
		data: datastr,
		cache: false,
		success: function(html){
			pageTracker._trackPageview('/Questions-Quotes');
			$("#response").fadeIn("slow");
			$("#response").html(html);
//			setTimeout('$("#response").fadeOut("slow")',4000);
		}
	});
}
