Example 10: Loading pages based on the URL

This behavior is useful when multiple sites are being served up by the same ip address

<script language="javascript">
function f_redirect(){
var url   = document.location ; //capture the contents of the browser location
var temp  = new String(url)   ; //convert the browser location to a string
var url2  = temp.toLowerCase(); //convert the browser location to lower case

//search the browser location
if (url2.indexOf("carsdirect.com") >= 0) {   // go to carsdirect
else {
//  -->
<body onload="f_redirect()" $formtype=this>

<em>Please wait ...</em>