function Switch(){ var pickup = document.getElementById("toOrfrom").value; if (pickup == 'ToAirport'){ document.getElementById("fromSpan").innerHTML = fromSelect("from"); document.getElementById("toSpan").innerHTML = toSelect("to"); } else if (pickup == 'FromAirport'){ document.getElementById("fromSpan").innerHTML = toSelect("from"); document.getElementById("toSpan").innerHTML = fromSelect("to"); } } function toSelect(selectName){ text = ''; return text; } function fromSelect(selectName){ var text = ''; return text; } function addCities(selectName){ var text = ''; return text; } function getStates(selectName, cityName, selectCityName){ var text = ''; document.getElementById(span).innerHTML = text; } function getSpanBack(){ document.getElementById("quickrate").innerHTML = spanText; } function getRate(form) { spanText = document.getElementById("quickrate").innerHTML; var from = form.from.options[form.from.selectedIndex].value; var to = form.to.options[form.to.selectedIndex].value; var pickupLocation = form.toOrfrom.options[form.toOrfrom.selectedIndex].value; //var oXML = new ActiveXObject("Msxml2.XMLHTTP"); var oXML; if (window.XMLHttpRequest) { oXML = new XMLHttpRequest();} else { try { oXML = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { oXML = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { oXML = false; } } } //alert("quickrates.asp?From=" + from + "&To=" + to + "&pickup=" + pickupLocation); if ((from != 0)&&(to != 0)){ var url = 'quickrates.asp?Action=getRate&From=' + from + '&To=' + to + '&pickup=' + pickupLocation; oXML.open('Get', url , false); //alert(url); oXML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); oXML.send(null); //alert(oXML.responseText); //"Pickup at: " + from + "

Drop-off at: " + to + "

Rate: $" + document.getElementById("quickrate").innerHTML = oXML.responseText + "
"; } return false; } function getRates(radio){ var vehicle = radio.value; //alert(vehicle); if ( vehicle == 'sedanP'){ pointtoPoint('Luxury Sedan'); } else if (vehicle == 'sedanH'){ minHours('Luxury Sedan', 55, 2); return 55; } else if (vehicle == '6pass'){ minHours('6 Passengers Stretch Limousine', 60, 6); return 60; } else if (vehicle == '8pass'){ minHours('8 Passengers Stretch Limousine', 65, 6); return 65; } else if (vehicle == '10pass'){ minHours('10 Passengers Stretch Limousine', 75, 6); return 65; } else if (vehicle == 'navigator'){ minHours('14 Passengers Stretch Navigator', 125, 6); return 110; } else if (vehicle == 'hummer'){ minHours('22 Passengers Super Stretch Hummer', 165, 6); return 150; } else if (vehicle == 'van'){ minHours('14 Passengers & Cargo Van', 65, 6); return 65; } else if (vehicle == 'coach'){ minHours('18 Passengers Luxury Coach Bus', 110, 6); return 110; } } function pointtoPoint(text){ var html; html = ''; html += ''; html += ''; html += ''; html += ''; html += '
' + text + '
Pickup date:
Pickup time: :

Pickup Location
State: ' + getStates("fromState", "fromCity", "from") + '
City: '; html += '

Drop-off Location
State: ' + getStates("toState", "toCity", "to") + '
City: '; html += '
'; document.all['reservation'].innerHTML = html; //document.all['rate'].value = rate; document.all['type'].value = 'Flat'; getCities("fromState", "fromCity", "from" ); getCities("toState", "toCity", "to"); } function minHours(text, rate, min){ var html; html = ''; html += ''; html += ''; html += ''; html += ''; html += ''; //html += ''; //html += ''; html += ''; html += '
' + text + '
Hourly Rate: $' + rate + '
Pickup date:
Pickup time: :
Hours needed:
Pickup town: ' + addCities("from") + '
Final drop off: ' + addCities("to") + '

Pickup Location
State: ' + getStates("fromState", "fromCity", "from") + '
City: '; html += '

Final Drop-off Location
State: ' + getStates("toState", "toCity", "to") + '
City: '; html += '
'; document.all['reservation'].innerHTML = html; document.getElementById('rate').value = rate; document.getElementById('type').value = 'Hourly'; getCities("fromState", "fromCity", "from" ); getCities("toState", "toCity", "to"); //alert(document.getElementById('rate').value); //alert(document.all['type'].value); } function getLink() { var oXML = new ActiveXObject("Msxml2.XMLHTTP"); oXML.Open("GET", "quickrates.asp?Action=getLink", false); oXML.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); oXML.Send(null); document.getElementById("links").innerHTML = oXML.responseText; //setTimeout("getLink();",5 * 1000); return false; } function findPosX(obj) { var curleft = 0; //var obj = document.getElementById('statusFlash'); if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; //var obj = document.getElementById('statusFlash'); if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } function setSelectTowns(townA, townB){ if ((townA != '') && (townB != '')){ var oXML = new ActiveXObject("Msxml2.XMLHTTP"); oXML.Open("GET", "quickrates.asp?Action=getSelectTown&ID=" + townA, false); oXML.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); oXML.Send(null); document.getElementById("fromState").value = oXML.responseText; oXML.Open("GET", "quickrates.asp?Action=getSelectTown&ID=" + townB, false); oXML.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); oXML.Send(null); document.getElementById("toState").value = oXML.responseText; //document.write(oXML.responseText); getCities("fromState", "fromCity", "from" ); getCities("toState", "toCity", "to"); document.getElementById("from").value = townA document.getElementById("to").value = townB; //document.getElementById("pickupdate").focus(); } } function sizeTo(layerName, img, iHeight, iWidth, animate){ var e=document.getElementById(layerName); e.style.width = iWidth; e.style.height = iHeight; e.innerHTML = ""; } function sizesTo(layerName, img, iHeight, iWidth, animate) { var ie4 = (document.all) if (ie4) { var targetLayer = document.all[layerName] // Locate the image to resize var el = targetLayer.children.tags("IMG")[0] // Add a clip sub-object. This is used to hide browser differences. el.clip = new Object } else { // You can't just resize the image. In Netscape we manipulate // the positioned DIV the image is displayed within. var el = document.getElementById[layerName] // Add a style object. This is used to hide browser differences // el.style = new Object // Store current height and width in IE compatible properties // el.style.pixelHeight = el.offsetHeight = el.clip.height // el.style.pixelWidth = el.offsetWidth = el.clip.width } if (!animate) { // No animation, just change image size //if (ie4) { // Change image size directly in IE el.style.pixelWidth = iWidth; el.style.pixelHeight = iHeight //} //else { // Create new image with new size in Netscape // el.document.write(""); // el.document.close(); //} } else if ((el.offsetHeight != iHeight) || (el.offsetWidth != iWidth)) { // Notice we set both the style and clip sub-objects. The clip // object is used in Netscape, the style object is used in IE. // By setting both directly we do not need to distinguish between // browsers. if (el.offsetHeight < iHeight) el.style.pixelHeight = el.clip.height = el.offsetHeight + 1; if (el.offsetWidth < iWidth) el.style.pixelWidth = el.clip.width = el.offsetWidth + 1; if (el.offsetHeight > iHeight) el.style.pixelHeight = el.clip.height = el.offsetHeight - 1; if (el.offsetWidth > iWidth) el.style.pixelWidth = el.clip.width = el.offsetWidth - 1; // IE already resized the image when we set the style properties // In Netscape we need to write out a new image with the new size if (!ie4) { el.document.write(""); el.document.close(); } // Continue animation setTimeout('sizeTo("' + layerName + '","'+img+'",'+iHeight+','+iWidth+','+animate+')',10); } } function getXMLFile(url){ //alert(url); var oXML; if (window.XMLHttpRequest) { oXML = new XMLHttpRequest();} else { try { oXML = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { oXML = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { oXML = false; } } } oXML.open('Get', url , false); oXML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); oXML.send(null); return oXML.responseText; }