/**********************************************
* Define Navigation
***********************************************/
var overviewBorderColor  = "#808080";//"#0099cc";  // Overview area border color
var mainHeaderImg = "new_header_preferred.gif";  // Main Header Image

var tabName = new Array();
var tabURL = new Array();

var topLineName = new Array();
var topLineURL = new Array();
var bottomLineName = new Array();
var bottomLineURL = new Array();
var searchEngName = new Array();
var searchEngLink = new Array();
var keytermsName = new Array();
var keytermsLink = new Array();
var citiesName = new Array();
var citiesLink = new Array();


tabName[0] = "Reservation Online";
tabURL[0] = "ReservationType.html";
tabName[1] = "Home";
tabURL[1] = "index.html";
tabName[2] = "Corporate Limousine";
tabURL[2] = "Corporate_Limousine.html";
tabName[3] = "Wine Country Tour";
tabURL[3] = "Wine_Country_Tour.html";
tabName[4] = "Airport Transportation";
tabURL[4] = "Airport_Transportation.html";
tabName[5] = "East Bay Limousine";
tabURL[5] = "East_Bay_Limousine.html";
tabName[6] = "San Francisco Limousine";
tabURL[6] = "San_Francisco_Limousine.html";
tabName[7] = "Oakland Limousine";
tabURL[7] = "Oakland_Limousine.html";
tabName[8] = "Livermore Wine Tour";
tabURL[8] = "Livermore_Wine_Tour.html";
tabName[9] = "Russian River Wine Tour";
tabURL[9] = "Russian_River_Tour.html";
tabName[10] = "California Wine Tour";
tabURL[10] = "California_Wine_Tour.html";
tabName[11] = "Weddings";
tabURL[11] = "Wedding_Limousine.html";
tabName[12] = "Corporate Events";
tabURL[12] = "Corporate_Events.html";
tabName[13] = "Sporting Events";
tabURL[13] = "Sporting_Events.html";
tabName[14] = "Bachelor / Bachelorette";
tabURL[14] = "Bachelor_Bachelorette.html";
tabName[15] = "Limousine Tours";
tabURL[15] = "Limousine_Tours.html";
tabName[16] = "Prom Limousine";
tabURL[16] = "Prom_Limousine.html";
tabName[17] = "SFO Limousine and Sedan";
tabURL[17] = "SFO_Limousine_and_Sedan_Transportation.html";
tabName[18] = "OAK Limousine and Sedan";
tabURL[18] = "OAK_Limousine_and_Sedan_Transportation.html";
tabName[19] = "SJC Limousine and Sedan";
tabURL[19] = "SJC_Limousine_and_Sedan_Transportation.html";
tabName[20] = "Sonoma Wine Tour";
tabURL[20] = "Sonoma_Wine_Tour.html";
tabName[21] = "San Francisco Tour";
tabURL[21] = "San_Francisco_Tours.html";
tabName[22] = "Bay Area Tours";
tabURL[22] = "Bay_Area_Tours.html";
tabName[23] = "Napa Wine Tours";
tabURL[23] = "Napa_Wine_Tours.html";
tabName[24] = "Contra Costa Limousine";
tabURL[24] = "Contra_Costa_limousine.html";
tabName[25] = "Terms & Conditions";
tabURL[25] = "Terms_and_Conditions.html";
tabName[26] = "Our Fleet";
tabURL[26] = "Our_Fleet.html";
tabName[27] = "About Us";
tabURL[27] = "About_Preferred.html";
tabName[28] = "Contact Us";
tabURL[28] = "Contact_Us.html";



/*****************************************************************
* Create TOP LINE links
******************************************************************/
topLineName[0] = "Bay Area Service Area";
topLineURL[0] = "Bay_Area_Tours.html";
topLineName[1] = "Online Reservations";
topLineURL[1] = "ReservationType.html";
topLineName[2] = "Wine Country Tour";
topLineURL[2] = "Wine_Country_Tour.html";
topLineName[3] = "Napa Valey Tour";
topLineURL[3] = "Napa_Wine_Tours.html";

/*****************************************************************
* Create BOTTOM LINE links
******************************************************************/
bottomLineName[0] = "Bay Area Service Area";
bottomLineURL[0] = "Bay_Area_Tours.html";
bottomLineName[1] = "Online Reservations";
bottomLineURL[1] = "ReservationType.html";
bottomLineName[2] = "Wine Country Tour";
bottomLineURL[2] = "Wine_Country_Tour.html";
bottomLineName[3] = "Napa Valey Tour";
bottomLineURL[3] = "Napa_Wine_Tours.html";

/*****************************************************************
* Create Friendly SEARCH ENGINES links
******************************************************************/
searchEngName[0] = "www.yahoo.com";
searchEngLink[0] = "http://www.yahoo.com";
searchEngName[1] = "www.msn.com";
searchEngLink[1] = "http://www.msn.com";
searchEngName[2] = "www.google.com";
searchEngLink[2] = "http://www.google.com";
searchEngName[3] = "www.excite.com";
searchEngLink[3] = "http://www.excite.com";
searchEngName[4] = "www.altavista.com";
searchEngLink[4] = "http://www.altavista.com";
searchEngName[5] = "www.dogpile.com";
searchEngLink[5] = "http://www.dogpile.com";
searchEngName[6] = "www.hotbot.com";
searchEngLink[6] = "http://www.hotbot.com";
searchEngName[7] = "www.overture.com";
searchEngLink[7] = "http://www.overture.com";
searchEngName[8] = "www.craigslist.com";
searchEngLink[8] = "http://www.craigslist.com";
searchEngName[9] = "www.lycos.com";
searchEngLink[9] = "http://www.lycos.com";
searchEngName[10] = "www.searchengine.com";
searchEngLink[10] = "http://www.searchengine.com";
searchEngName[11] = "www.alexa.com";
searchEngLink[11] = "http://www.alexa.com";

/*****************************************************************
* Create Our Friendly Search Keyterms links
******************************************************************/
keytermsName[0] = "California Wine Tour";
keytermsLink[0] = "California_Wine_Tour.html";
keytermsName[1] = "Wine Country Tour";
keytermsLink[1] = "Wine_Country_Tour.html";
keytermsName[2] = "Napa Valley Tour";
keytermsLink[2] = "http://www.limonapa.com";
keytermsName[3] = "Napa Valley Wine Tours, Napa Valley Limousine Tour";
keytermsLink[3] = "http://www.napatour.com";
keytermsName[4] = "Sonoma Wine Tour";
keytermsLink[4] = "http://www.sonomavalleywinecountrytours.com";
keytermsName[5] = "San Francisco Tours";
keytermsLink[5] = "San_Francisco_Tours.html";
keytermsName[6] = "Bay Area Tours";
keytermsLink[6] = "Bay_Area_Tours.html";
keytermsName[7] = "Calistoga Wine Tour";
keytermsLink[7] = "Calistoga_Limousines.html";
keytermsName[8] = "Airport Transportation";
keytermsLink[8] = "Airport_Transportation.html";
keytermsName[9] = "Corporate Limousine";
keytermsLink[9] = "Corporate_Limousine.html";
keytermsName[10] = "San Francisco Limousine";
keytermsLink[10] = "San_Francisco_Limousine.html";
keytermsName[11] = "Napa Limousine";
keytermsLink[11] = "http://www.www-napa.com";
keytermsName[12] = "Contra Costa limousine";
keytermsLink[12] = "Contra_Costa_limousine.html";
keytermsName[13] = "Walnut Creek Limousines";
keytermsLink[13] = "Walnut_Creek_Limousines.html";
keytermsName[14] = "Concord Limousines";
keytermsLink[14] = "Concord_Limousines.html";

/*****************************************************************
* Create Cities links
******************************************************************/
citiesName[0] = "Home";
citiesLink[0] = "index.html";
citiesName[1] = "About Preferred Limousine";
citiesLink[1] = "About_Preferred.html";
citiesName[2] = "Airport Transportation";
citiesLink[2] = "Airport_Transportation.html";
citiesName[3] = "Bachelor & Bachelorette";
citiesLink[3] = "Bachelor_Bachelorette.html";
citiesName[4] = "Bay Area Tours";
citiesLink[4] = "Bay_Area_Tours.html";
citiesName[5] = "California Wine Tour";
citiesLink[5] = "California_Wine_Tour.html";
citiesName[6] = "Calistoga Limousines";
citiesLink[6] = "Calistoga_Limousines.html";
citiesName[7] = "Clayton Limousines";
citiesLink[7] = "Clayton_Limousines.html";
citiesName[8] = "Concord Limousines";
citiesLink[8] = "Concord_Limousines.html";
citiesName[9] = "Contra Costa limousine";
citiesLink[9] = "Contra_Costa_limousine.html";
citiesName[10] = "Corporate Events";
citiesLink[10] = "Corporate_Events.html";
citiesName[11] = "Corporate Limousine";
citiesLink[11] = "Corporate_Limousine.html";
citiesName[12] = "East Bay Limousine";
citiesLink[12] = "East_Bay_Limousine.html";
citiesName[13] = "Foster City Limousines";
citiesLink[13] = "Foster_City_Limousines.html";
citiesName[14] = "Limousine Tours";
citiesLink[14] = "Limousine_Tours.html";
citiesName[15] = "Martinez Limousines";
citiesLink[15] = "Martinez_Limousines.html";
citiesName[16] = "Napa Limousines";
citiesLink[16] = "Napa_Limousines.html";
citiesName[17] = "Napa Wine Tours";
citiesLink[17] = "Napa_Wine_Tours.html";
citiesName[18] = "OAK Limousine and Sedan Transportation";
citiesLink[18] = "OAK_Limousine_and_Sedan_Transportation.html";
citiesName[19] = "Oakland Limousine";
citiesLink[19] = "Oakland_Limousine.html";
citiesName[20] = "Pacheco Limousines";
citiesLink[20] = "Pacheco_Limousines.html";
citiesName[21] = "Pleasant Hill Limousines";
citiesLink[21] = "Pleasant_Hill_Limousines.html";
citiesName[22] = "Prom Limousine";
citiesLink[22] = "Prom_Limousine.html";
citiesName[23] = "San Francisco Limousine";
citiesLink[23] = "San_Francisco_Limousine.html";
citiesName[24] = "San Francisco Tours";
citiesLink[24] = "San_Francisco_Tours.html";
citiesName[25] = "SFO Limousine and Sedan Transportation";
citiesLink[25] = "SFO_Limousine_and_Sedan_Transportation.html";
citiesName[26] = "SJC Limousine and Sedan Transportation";
citiesLink[26] = "SJC_Limousine_and_Sedan_Transportation.html";
citiesName[27] = "Sonoma Limousines";
citiesLink[27] = "Sonoma_Limousines.html";
citiesName[28] = "Sonoma Wine Tour";
citiesLink[28] = "Sonoma_Wine_Tour.html";
citiesName[29] = "Sporting Events";
citiesLink[29] = "Sporting_Events.html";
citiesName[30] = "Walnut Creek Limousines";
citiesLink[30] = "Walnut_Creek_Limousines.html";
citiesName[31] = "Danville Limousines";
citiesLink[31] = "Danville_Limousines.html";
citiesName[32] = "Diablo Limousines";
citiesLink[32] = "Diablo_Limousines.html";
citiesName[33] = "San Ramon Limousines";
citiesLink[33] = "San_Ramon_Limousines.html";
citiesName[34] = "Wedding Limousine";
citiesLink[34] = "Wedding_Limousine.html";
citiesName[35] = "Wine Country Tour";
citiesLink[35] = "Wine_Country_Tour.html";
citiesName[36] = "Livermore Wine Tour";
citiesLink[36] = "Livermore_Wine_Tour.html";
citiesName[37] = "Alamo Limousines";
citiesLink[37] = "Alamo_Limousines.html";
citiesName[38] = "Dublin Limousines";
citiesLink[38] = "Dublin_Limousines.html";
citiesName[39] = "Pleasanton Limousines";
citiesLink[39] = "Pleasanton_Limousines.html";
citiesName[40] = "Russian River Tour";
citiesLink[40] = "Russian_River_Tour.html"
citiesName[41] = "Our Fleet";
citiesLink[41] = "Our_Fleet.html";
citiesName[42] = "Terms and Conditions";
citiesLink[42] = "Terms_and_Conditions.html";
citiesName[43] = "Contact Us";
citiesLink[43] = "Contact_Us.html";

/****************************************************************
* Get today's date
*****************************************************************/
var today = new Date();
var month = today.getMonth() + 1;
var day = today.getDate();
var year = today.getFullYear();

/**********************************************
* Create Navigation Links
***********************************************/
function buildNavigation(path) {
	var returnVal = "";
		
	for ( i=0; i < tabName.length; i++ ) {
		if ( i == 0 ) {
			returnVal += '<tr><td><a href="'+ path + tabURL[i] +'" class="overviewW" style="color:white">'+ tabName[i] +'</a></td></tr>';
			returnVal += '<tr><td bgcolor="#ffffff"><img src="../images/spacer.gif" height="1"></td></tr>';
			returnVal += '<tr><td height="3"><img src="../images/spacer.gif" height="1"></td></tr>';
		} else {
			returnVal += '<tr><td><a href="'+ path + tabURL[i] +'" class="overviewW" style="color:white">'+ tabName[i] +'</a></td></tr>';
		}
	}
	returnVal += '<tr><td height="15" class="overview">&nbsp;</td></tr>';

	document.write(returnVal);
}

/****************************************************************
* Create TOP and BUTTOM line of the page with links 
*****************************************************************/
function printTopButtomLine(position) {
	printTopButtomLine(position, "page");
}

function printTopButtomLine(position, page) {

	var pageWidth = 0;
	if ( page == "home" )
		pageWidth = 1000;
	else
		pageWidth = 800;
		
		
	var returnVal = '<table border="0" cellpadding="0" cellspacing="0" width="'+ pageWidth +'" align="center">'+
					'<tr><td class="top-bg-gray">';
		
	if ( position == "top" ) {
		for ( i=0; i < topLineName.length; i++ ) {
			if ( i == topLineName.length - 1 )
				returnVal += ' <a href="'+ topLineURL[i] +'">'+ topLineName[i] +'</a>';
			else
				returnVal += ' <a href="'+ topLineURL[i] +'">'+ topLineName[i] +'</a> |';
		}
		
	} else {
		for ( i=0; i < bottomLineName.length; i++ ) {
			if ( i == bottomLineName.length - 1 )
				returnVal += ' Copyright &copy; '+ year +' &nbsp;';
			else
				returnVal += ' <a href="'+ bottomLineURL[i] +'">'+ bottomLineName[i] +'</a> |';
		}
	}
	
	returnVal += '</td></tr></table>';
	document.write(returnVal);
}

/****************************************************************
* Create Friendly LINKS
*****************************************************************/
function printFriendlySearch(names, links, title) {
	var out = "<p>";
	// Print header
	if ( title != "" ) out += '<u>'+ title +'</u><br>';
	// Print links
	for ( s=0; s < names.length; s++ ) {
		if ( s == names.length - 1 ) 
			out += '<a href="'+ links[s] +'" target="_blank">'+ names[s] +'</a>';
		else
			out += '<a href="'+ links[s] +'" target="_blank">'+ names[s] +'</a>,&nbsp; ';
	}
	out += "</p>";
	document.write(out);
}

/****************************************************************
* Create Cities LINKS
*****************************************************************/
function printCities() {
	var out = "<p>";
	

	// Print links
	for ( s=0; s < citiesName.length; s++ ) {
		if ( s == citiesName.length - 1 ) 
			out += '<a href="'+ citiesLink[s] +'">'+ citiesName[s] +'</a>';
		else
			out += '<a href="'+ citiesLink[s] +'">'+ citiesName[s] +'</a>&nbsp;| ';
	}
	out += "</p>";
	document.write(out);
}

/****************************************************************
* Create overview frame TOP
*****************************************************************/
function printOverviewTop() {
	
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td colspan="5" bgcolor="'+ overviewBorderColor +'"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" height="1"></td></tr>');
	document.write('<tr>');
	document.write('<td bgcolor="'+ overviewBorderColor +'" width="1"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" width="1"></td>');
	document.write('<td colspan="3" height="5"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" height="5"></td>');
	document.write('<td bgcolor="'+ overviewBorderColor +'" width="1"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" width="1"></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td bgcolor="'+ overviewBorderColor +'" width="1"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" width="1"></td>');
	document.write('<td width="0">&nbsp;</td>');
	document.write('<td class="overview">');
	
}

/****************************************************************
* Create overview frame BOTTOM
*****************************************************************/
function printOverviewBottom() {

	document.write('</td>');
	document.write('<td width="0">&nbsp;</td>');
	document.write('<td bgcolor="'+ overviewBorderColor +'" width="1"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" width="1"></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td bgcolor="'+ overviewBorderColor +'" width="1"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" width="1"></td>');
	document.write('<td colspan="3" height="5"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" height="5"></td>');
	document.write('<td bgcolor="'+ overviewBorderColor +'" width="1"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" width="1"></td>');
	document.write('</tr>');
	document.write('<tr><td colspan="5" bgcolor="'+ overviewBorderColor +'"><img src="http://www.sanfranciscobayarealimo.com/images/spacer.gif" height="1"></td></tr>');
	document.write('</table>');

}

/*****************************************************************
* Trim function will remove spaces around the string
******************************************************************/
function trim(str) {
	var strLen = str.length;
	// Trim spaces at the left side of the string -> LTrim()
	while ( str.substring(0, 1) == " " ) {
		str = str.substring(1, strLen);
	}
	return str;
}


/*****************************************************************
* Print header Image 
******************************************************************/
function printHeaderImg(path) {
	var Img = "";
	Img = '<table width="98%" border="0" cellpadding="0" cellspacing="0">';
	if ( path == "" )
		Img += '<tr align="right"><td height="140"><img src="http://www.sanfranciscobayarealimo.com/images/'+ mainHeaderImg +'" id="headerImg" usemap="#reservation" border="0" align="right"></td></tr>';
	else
		Img += '<tr><td height="140"><img src="'+ path +'images/'+ mainHeaderImg +'" id="headerImg" usemap="#reservation" border="0" align="right"></td></tr>';
	Img += '</table>';
	document.write(Img);
}

/****************************************************************
* Create Header image map
*****************************************************************/
document.write('<map name="reservation">');
document.write('<area shape="rect" coords="604,162,790,185" href="http://www.sanfranciscobayarealimo.com/ReservationType.html">'); //href="http://www.sanfranciscobayarealimo.com/ReservationType.html">');
document.write('<area shape="rect" coords="0,2,790,155" href="http://www.sanfranciscobayarealimo.com/index.html">');
document.write('<area shape="rect" coords="0,162,170,185" href="http://www.sanfranciscobayarealimo.com/ReservationType.html">');
document.write('</map>');



/****************************************************************
* Weather Box
*****************************************************************/
function showWeather(zip) {
	
	// Load XML 
	var xml = new ActiveXObject("Microsoft.XMLDOM");
	xml.async = false;
	xml.load("http://rss.weather.com/weather/rss/local/"+ zip);
	// Load XSL
	var xsl = new ActiveXObject("Microsoft.XMLDOM");
	xsl.async = false;
	xsl.load("gadgets/weather.xsl");
	// Transform
	document.write(xml.transformNode(xsl));
}

/****************************************************************
* Find X position of the given object on the page
*****************************************************************/
function findPosX(obj) {
	var curleft = 0;
	
    if ( obj.offsetParent ) {
	
        while(1) {
          curleft += obj.offsetLeft;
          if (!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
		
    } else if (obj.x)
        curleft += obj.x;
		
    return curleft;
}

/****************************************************************
* Find Y position of the given object on the page
*****************************************************************/
function findPosY(obj) {
    var curtop = 0;
	
    if (obj.offsetParent) {
	
        while(1) {
          curtop += obj.offsetTop;
          if (!obj.offsetParent) 
            break;
          obj = obj.offsetParent;
        }
		
	} else if(obj.y)
        curtop += obj.y;
		
    return curtop;
}
