 function imgPopup( querystring ) {
	var window_width = 640
	var window_height = 480
	var window_options = "'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,copyhistory=no,height=" + window_height + ",width=" + window_width + "'";
	window.open( "/asp/popup.asp?" + querystring, "imgpop", window_options )
}
 


function getQueryStringValue(queryStringName, queryString) {
		var value = "";
		var qsName = queryStringName + "=";
		var theURL = new String(queryString);
		var startValue = 0;
		var endValue = 0;
		
		var remainStr = "";
		
		//check to see if the queryStringName is in the url
		if (theURL.indexOf(qsName) > -1) {
			startValue = theURL.indexOf(qsName) + qsName.length;
		}
		
		remainStr = theURL.substring(startValue);
		
		if(remainStr.indexOf("&") > -1) {
			endValue = remainStr.indexOf("&");
		} else {
			endValue = remainStr.length;
		}
		
		if(endValue > 0) {
			if(remainStr.substring(0,endValue) == theURL){
			return "";
			
			}else{
			return remainStr.substring(0,endValue);
			}
		} else {
			return "";
		}
	}	
var aImages;

//PRELOAD IMAGES
var hasPreloads = typeof(strPreloads);
var bHasPreloads = (hasPreloads != "undefined");
if(bHasPreloads){
if (document.images) {
		var aPreloads = new Array();
		aImages = new Array();
		aPreloads = strPreloads.split(",");
		aImages.length = aPreloads.length + 1;
			
		for(i=0;i < aPreloads.length + 1;i++){
			aImages[i] = new Image();
			aImages[i].src = aPreloads[i];
		}	 
}
}

	
function turnOn(stype, row) {
	
	var strSrc;
	
	if (document.images) {
		strSrc = eval('arrow' + stype + row + ".src");
		
		if(strSrc == aImages[0].src){ 
			document['arrow' + stype + row].src = aImages[stype].src;
		}
	}
}

function turnOff(stype, row, current) {
  var strSrc;
  
  if (document.images) {
	strSrc = eval('arrow' + stype + row + ".src");

	if(current != row)//if you are in the current directory then leave the arrows alone
	{
		if(strSrc == aImages[stype].src){
			document['arrow' + stype + row].src = aImages[0].src;
		}
	}
  }
}
//var fordvehicles_pop	= null
function gtpage( window_http, window_name, window_width, window_height, windowX, windowY) 
	{
//		if(windowX == null)
//			{windowX = 50;}
//		if(windowY == null)
//			{windowY = 50;}

	windowX = 170;
	windowY = 180;
	window_width = 575;
	window_height = 200;
				
	var window_options 			= "'directories=yes,toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,copyhistory=no,height=" + window_height + ",width=" + window_width + 
								  ",screenX="+ windowX + ",screenY="+ windowY + ",top="+ windowX + ",left="+ windowY +"'"
		fordvehicles_pop 		= window.open( window_http, 'fordvehicles_pop', window_options );
		
		//fordvehicles_pop.focus();
		
	}	 
	
	function NewWindow(mypage, myname, w, h, wint, winl, scroll, resizable, menubar, status, titlebar, toolbar, location) 
	{
		window.status = "open";
		if (wint == -1)
		{wint = (screen.height - h) / 2;}
		if (winl == -1)
		{winl = (screen.width - w) / 2;}
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+',menubar='+menubar+',status='+status+',titlebar='+titlebar+',toolbar='+toolbar+',location='+location;
		win = window.open(mypage, myname, winprops);
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
	
function gtExternalPage( sURL, sName, iWidth, iHeight, iLeft, iTop ) {
	iLeft = 170;
	iTop = 180;
	iWidth = 575;
	iHeight = 200;
	
	
	var sOptions = "'directories=yes,toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,copyhistory=no,height=" + iHeight + ",width=" + iWidth + ",screenX="+ iLeft + ",screenY="+ iTop + ",top="+ iTop + ",left="+ iLeft +"'"
	
	//if( confirm( "You are linking to a non-Ford web site.  Your browsing and interaction are subject to the rules and policies of that site.  Please read over the site's rules and policies before proceeding." ) ) {
		// Leave Site
		window.open( sURL, sName, sOptions );
	//} else {
		// Don't Leave Site
	//}
}

if (navigator.appName == 'Netscape') {
	window.captureEvents(Event.KEYPRESS);
	window.onKeyPress = MemberName_onkeypress_NS;
}

function MemberName_onkeypress_NS(thisOne) {
	if(thisOne.which == 13){
		document['frmLogin'].submit();
	}
}

function MemberName_onkeypress_IE() {
	if(window.event.keyCode == 13){
		document['frmLogin'].submit();
	}
}

function roll(ele) {
	var img = ele.getElementsByTagName("img")[0];
	var src = img.src;
	img.src = (/on\./i.test(src)) ? src.replace(/on\./i, 'off.') : src.replace(/off\./i, 'on.');
}

function rollbyid(ele) {
	var img = document.getElementById(ele);
	var src = img.src;
	img.src = (/on\./i.test(src)) ? src.replace(/on\./i, 'off.') : src.replace(/off\./i, 'on.');
}

//mouseoverbuttons	
	function TurnOnImage(oElement){	
		img = eval(oElement + "On.src");
		document [oElement].src = img;
	}
		
	function TurnOffImage(oElement){
		img = eval(oElement + "Off.src");
		document [oElement].src = img;
	}	

	var buttonSubmitBlue_On = new Image();
	var buttonSubmitBlue_Off = new Image();
	buttonSubmitBlue_On.src = "/images/global/buttonSubmitBlueOn.gif";
	buttonSubmitBlue_Off.src = "/images/global/buttonSubmitBlueOff.gif";
	
	var buttonLearnMore_On = new Image();
	var buttonLearnMore_Off = new Image();
	buttonLearnMore_On.src = "/images/global/buttonLearnMoreonWhiteOn.gif";
	buttonLearnMore_Off.src = "/images/global/buttonLearnMoreonWhiteOff.gif";

	var buttonLogin_On = new Image();
	var buttonLogin_Off = new Image();
	buttonLogin_On.src = "/images/global/buttonLoginNowonWhiteOn.gif";
	buttonLogin_Off.src = "/images/global/buttonLoginNowonWhiteOff.gif";
	
	var buttonJoinNow_On = new Image();
	var buttonJoinNow_Off = new Image();
	buttonJoinNow_On.src = "/images/global/buttonJoinNowonWhiteOn.gif";
	buttonJoinNow_Off.src = "/images/global/buttonJoinNowonWhiteOff.gif";
	
	var buttonLogin_On = new Image();
	var buttonLogin_Off = new Image();
	buttonLogin_On.src = "/images/global/buttonLoginNowonWhiteOn.gif";
	buttonLogin_Off.src = "/images/global/buttonLoginNowonWhiteOff.gif";

	var buttonBackTo_On = new Image();
	var buttonBackTo_Off = new Image();
	buttonBackTo_On.src = "/images/global/buttonBackToPrevonWhiteOn.gif";
	buttonBackTo_Off.src = "/images/global/buttonBackToPrevonWhiteOff.gif";

	var buttonGo_On = new Image();
	var buttonGo_Off = new Image();
	buttonGo_On.src = "/images/global/buttonGo_on.gif";
	buttonGo_Off.src = "/images/global/buttonGo_off.gif";	
	
	var buttonLeftSelect_On = new Image();
	var buttonLeftSelect_Off = new Image();
	buttonLeftSelect_On.src = "/images/global/MediaSelect_Left_On.jpg";
	buttonLeftSelect_Off.src ="/images/global/MediaSelect_Left_Off.jpg";
	
	var buttonRightSelect_On = new Image();
	var buttonRightSelect_Off = new Image();
	buttonRightSelect_On.src = "/images/global/MediaSelect_Right_On.jpg";
	buttonRightSelect_Off.src ="/images/global/MediaSelect_Right_Off.jpg";
	
	var buttonGalleryRight_On = new Image();
	var buttonGalleryRight_Off = new Image();
	
	var buttonGalleryLeft_On = new Image();
	var buttonGalleryLeft_Off = new Image();
	
	buttonGalleryRight_On.src = "/images/global/gallery_viewer_rightarrow_over.jpg";
	buttonGalleryRight_Off.src = "/images/global/gallery_viewer_rightarrow_off.jpg";	
	buttonGalleryLeft_On.src = "/images/global/gallery_viewer_leftarrow_over.jpg";
	buttonGalleryLeft_Off.src = "/images/global/gallery_viewer_leftarrow_off.jpg";
	
	var buttonPhotos_On = new Image();
	var buttonPhotos_Off = new Image();
	var buttonVideos_On = new Image();
	var buttonVideos_Off = new Image();
	var buttonWallpapers_On = new Image();
	var buttonWallpapers_Off = new Image();
	var buttonPodcasts_On = new Image();
	var buttonPodcasts_Off = new Image();
	
	buttonPhotos_On.src = "/images/global/Button_Photos_Over.jpg";
	buttonPhotos_Off.src = "/images/global/Button_Photos_Off.jpg";
	buttonVideos_On.src = "/images/global/Button_Videos_Over.jpg";
	buttonVideos_Off.src ="/images/global/Button_Videos_Off.jpg";
	buttonWallpapers_On.src = "/images/global/Button_Wallpapers_Over.jpg";
	buttonWallpapers_Off.src = "/images/global/Button_Wallpapers_Off.jpg";
	buttonPodcasts_On.src = "/images/global/Button_Podcasts_Over.jpg";
	buttonPodcasts_Off.src = "/images/global/Button_Podcasts_Off.jpg";
	
		
	var buttonContinue_On = new Image();
	var buttonContinue_Off = new Image();
	buttonContinue_On.src = "/images/global/btnContinueOn.gif";
	buttonContinue_Off.src = "/images/global/btnContinueOff.gif";

	//endmouseovers
	
function ImageSwap(myObj, command1, command2)
{
	var obj = document.getElementById(myObj);
	var src = obj.src;
	obj.src = src.replace(command1,command2);
}

function gtSponsorPage( sURL ) {
	sName = "sponsorWin"
	iLeft = 170;
	iTop = 180;
	iWidth = 575;
	iHeight = 200;
	
	
	var sOptions = "'directories=yes,toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,copyhistory=no,height=" + iHeight + ",width=" + iWidth + ",screenX="+ iLeft + ",screenY="+ iTop + ",top="+ iTop + ",left="+ iLeft +"'"
	
	//if( confirm( "You are linking to a non-Ford web site.  Your browsing and interaction are subject to the rules and policies of that site.  Please read over the site's rules and policies before proceeding." ) ) {
		// Leave Site
		window.open( sURL, sName, sOptions );
	//} else {
		// Don't Leave Site
	//}
}

function InsertHomePageFlash(sHomeFlashVariables) {
	if (canPlayFlash() == true) {
		document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"   codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"768\" height=\"1270\" VIEWASTEXT id=ShockwaveFlash1>");
		document.write("<param name=\"movie\" value=\"/flash/nav/fr_home_global.swf\">");
		document.write("<param NAME=\"wmode\" VALUE=\"opaque\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=FlashVars VALUE=\"" + sHomeFlashVariables + "\">");
		document.write("<param name=\"menu\" value=\"false\">");
		document.write("<embed src=\"/flash/nav/fr_home_global.swf\" wmode=\"opaque\" width=\"768\" height=\"1270\" FlashVars=\"" + sHomeFlashVariables + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" menu=\"false\"></embed></object>");



	}else{
		document.location = "/getflash/index.asp";
	}
}

function InsertNavigationFlash(sUserState, sSection, sProtocol){
	sHomeFlashVariables = 'config=/flash/nav/config.xml&amp;userstate='+sUserState+'&amp;section='+sSection;
	if (canPlayFlash() == true) {
		document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"   codebase=\"'+sProtocol+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"768\" height=\"171\" VIEWASTEXT id=ShockwaveFlash1>");
		document.write("<param name=\"movie\" value=\"/flash/nav/fr_header_global.swf\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<param name=FlashVars VALUE=\"" + sHomeFlashVariables + "\">");
		document.write("<param name=\"menu\" value=\"false\">");
		document.write("<embed src=\"/flash/nav/fr_header_global.swf\" width=\"768\" height=\"171\" FlashVars=\"" + sHomeFlashVariables + "\" quality=\"high\" pluginspage=\"'+sProtocol+'://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" menu=\"false\"></embed></object>");
		document.write();
	}else{
		document.location = "/getflash/index.asp";
	}

}
function InsertScheduleFlash(){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="768" height="590" ID="Shockwaveflash2" VIEWASTEXT>');
    document.write('<param name="movie" value="/flash/nav/fr_schedule_module.swf">');
    document.write('<param name="quality" value="high">');
    document.write('<param name=FlashVars VALUE="config=/flash/nav/config.xml">');
    document.write('<param name="menu" value="false">');
    document.write('<embed src="/flash/nav/fr_schedule_module.swf" width="768" height="590" FlashVars="config=/flash/nav/config.xml" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed>');
    document.write('</object>');
}

function InsertMiniScheduleFlash(nSeriesID){
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="217" height="287" VIEWASTEXT ID="Object1">');
			document.write('<param name="movie" value="/flash/nav/fr_schedule_widget.swf">');
			document.write('<param name=FlashVars VALUE="config=/flash/nav/config.xml&amp;seriesID=' + nSeriesID +  '">');
			document.write('<param name="quality" value="high">');
			document.write('<param name="menu" value="false">');
			document.write('<embed src="/flash/nav/fr_schedule_widget.swf" width="217" height="287" FlashVars="config=/flash/nav/config.xml&amp;seriesID=' + nSeriesID +  '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed>');
			document.write('</object>');
}

function InsertGalleryFlash(sVideo){

	var sHTML = "";
	sHTML = "<div align=center>";
	sHTML = sHTML + "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"490\" height=\"310\" id=\"flv_video_controller\" align=\"middle\">";
	sHTML = sHTML + "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	sHTML = sHTML + "<param name=\"FlashVars\" value=\"sameDomain\" />";
	sHTML = sHTML + "<param name=\"movie\" value=\"/flash/video/flv_video_controller.swf?vidFileName=" + sVideo + "\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#999999\" /><embed src=\"/flash/video/flv_video_controller.swf?vidFileName=" + arrImages[iCount] + "\" quality=\"high\" bgcolor=\"#999999\" width=\"490\" height=\"310\" name=\"flv_video_controller\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	sHTML = sHTML + "</object>";
	sHTML = sHTML + "</div>";
	
	return sHTML;
					
}

function InsertGalleryFlashAudio(sAudio){

	var sHTML = "";
	sHTML = "<div align=center>";
	sHTML = sHTML + "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"490\" height=\"300\" id=\"mp3_audio_controller\" align=\"middle\">";
	sHTML = sHTML + "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	sHTML = sHTML + "<param name=\"FlashVars\" value=\"sameDomain\" />";
	sHTML = sHTML + "<param name=\"movie\" value=\"/podcast/mp3_audio_controller.swf?audioFile=" + sAudio + "\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><embed src=\"/podcast/mp3_audio_controller.swf?audioFile=" + arrImages[iCount] + "\" quality=\"high\" bgcolor=\"#000000\" width=\"490\" height=\"300\" name=\"mp3_audio_controller\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	sHTML = sHTML + "</object>";
	sHTML = sHTML + "</div>";
	
	return sHTML;
					
}

function callZoowee() {
	Zoo.makeBubble("#http://www.imdrivingone.com/ImDrivingOne/inline.aspx","Driving One",50,10,765,568)
}
