function openAWindow( pageToLoad, winName, width, height, center) {
  xposition=0; yposition=0;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=1,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  newwindow = window.open( pageToLoad, winName, args );
  newwindow.focus();
  return false;
}

function openPopup( pageToLoad, winName, width, height, x, y, center) {
  xposition=x; yposition=y;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=0,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  window.open( pageToLoad, winName, args );
}

function authorize()
{
  if( window.frameElement != null )
  {
    parent.location.href = "/cms/admin/security/authorize.asp";
  }
  else
  {
    location.href = "/cms/admin/security/login.asp";
  }
}

function center_popup(str,x,y,w,h){
  xposition=x; yposition=y;
  
  if (parseInt(navigator.appVersion) >= 4 ) {
   xposition = (screen.width - w) / 2;
   yposition = (screen.height - h) / 2 - 45;
  }
	if(document.layers){
		document.layers(str).top=yposition;
		document.layers(str).left=xposition;
	}
	if(document.all){
		document.all(str).style.top=yposition;
		document.all(str).style.left=xposition;
	}
	if(!document.all && document.getElementById){
		document.getElementById(str).style.top=yposition;
		document.getElementById(str).style.left=xposition;
	}
}				

function no_show(str) {				
		if(document.layers){
			document.layers(str).visibility='hidden';
		}
		if(document.all){
			document.all(str).style.visibility='hidden';
		}
		if(!document.all && document.getElementById){
			document.getElementById(str).style.visibility="hidden";
		}
}
function show(str) {				
		if(document.layers){
			document.layers(str).visibility='visible';
			temp=eval("IFRAME"+str+".location");
			temp.href=document.layers("IFRAME"+str).src;
		}
		if(document.all){
			document.all(str).style.visibility='visible';
			temp=eval("IFRAME"+str+".location");
			temp.href=document.all("IFRAME"+str).src;
		}
		if(!document.all && document.getElementById){
			document.getElementById(str).style.visibility="visible";
			temp=eval("IFRAME"+str+".location");
			temp.href=document.getElementById("IFRAME"+str).src;
		}
}

	
var scrollspeed=cache=2
var initialdelay=500

function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top="190px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj.offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
scrollDiv()
}

function scrollDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="190px"
setTimeout("scrollDiv()",60)
}

function InsertSampleMovie()
{
  document.write('<OBJECT id=intro       codeBase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0       height=420 width=732 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>');
  document.write('<PARAM NAME="_cx" VALUE="19368"><PARAM NAME="_cy" VALUE="11113"><PARAM NAME="FlashVars" VALUE="">');
  document.write('<PARAM NAME="Movie" VALUE="intro4.swf"><PARAM NAME="Src" VALUE="intro4.swf"><PARAM NAME="WMode" VALUE="Window">');
  document.write('<PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High">');
  document.write('<PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE="">');
  document.write('<PARAM NAME="AllowScriptAccess" VALUE="sameDomain"><PARAM NAME="Scale" VALUE="ShowAll">');
  document.write('<PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="C7CBCD">');
  document.write('<PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1">');
  document.write('<PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0">');
  document.write('<embed  src="intro4.swf" quality="high"             bgcolor="#c7cbcd"                                     width="732"      height="420"             name="intro" align="middle"                         allowscriptaccess="sameDomain"                     type="application/x-shockwave-flash"                                       pluginspage="http://www.macromedia.com/go/getflashplayer">                 </embed>                                                ');
  document.write('</object>');
}

function InsertSampleMovie_New()
{
  document.write('<OBJECT id=intro       codeBase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0       height=420 width=732 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>');
  document.write('<PARAM NAME="_cx" VALUE="19368"><PARAM NAME="_cy" VALUE="11113"><PARAM NAME="FlashVars" VALUE="">');
  document.write('<PARAM NAME="Movie" VALUE="intro7_new.swf"><PARAM NAME="Src" VALUE="intro7_new.swf"><PARAM NAME="WMode" VALUE="Window">');
  document.write('<PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High">');
  document.write('<PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE="">');
  document.write('<PARAM NAME="AllowScriptAccess" VALUE="sameDomain"><PARAM NAME="Scale" VALUE="ShowAll">');
  document.write('<PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="C7CBCD">');
  document.write('<PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1">');
  document.write('<PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0">');
  document.write('<embed  src="intro7_new.swf" quality="high"             bgcolor="#c7cbcd"                                     width="732"      height="420"             name="intro" align="middle"                         allowscriptaccess="sameDomain"                     type="application/x-shockwave-flash"                                       pluginspage="http://www.macromedia.com/go/getflashplayer">                 </embed>                                                ');
  document.write('</object>');
}

function InsertSampleMovieMenu(str)
{
  document.write('<OBJECT id=menu9 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height=87 width=770 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>');
  document.write('<PARAM NAME="_cx" VALUE="20373"><PARAM NAME="_cy" VALUE="2302"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="/cms/menu10.swf?phoneNumber='+GetPhoneText('NNN-NNN-NNNN')+'&idname='+str+'"><PARAM NAME="Src" VALUE="/cms/menu10.swf?phoneNumber='+GetPhoneText('NNN-NNN-NNNN')+'&idname='+str+'"><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="sameDomain"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0">');
  document.write('<PARAM NAME="BGColor" VALUE="FFFFFF"><PARAM NAME="SWRemote" VALUE="">     <PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1">');
  document.write('<embed src="/cms/menu10.swf?phoneNumber='+GetPhoneText('NNN-NNN-NNNN')+'&idname='+str+'" quality="high" bgcolor="#ffffff"             width="770" height="87" name="menu7" align="middle" allowScriptAccess="sameDomain"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></OBJECT>');  
}

function InsertSampleMovieMenu222(str)
{
  document.write('<OBJECT id=menu9 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height=87 width=770 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>');
  document.write('<PARAM NAME="_cx" VALUE="20373"><PARAM NAME="_cy" VALUE="2302"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="/cms/menu10.swf?phoneNumber=&idname='+str+'"><PARAM NAME="Src" VALUE="/cms/menu10.swf?phoneNumber=&idname='+str+'"><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="sameDomain"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0">');
  document.write('<PARAM NAME="BGColor" VALUE="FFFFFF"><PARAM NAME="SWRemote" VALUE="">     <PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1">');
  document.write('<embed src="/cms/menu10.swf?phoneNumber=&idname='+str+'" quality="high" bgcolor="#ffffff"             width="770" height="87" name="menu7" align="middle" allowScriptAccess="sameDomain"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></OBJECT>');  
}

function InsertSampleMovieIntro(str)
{
  document.write('<OBJECT id=landrover codeBase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height=292 width=770 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000><PARAM NAME="_cx" VALUE="20373"><PARAM NAME="_cy" VALUE="7726">');  
  document.write('<PARAM NAME="FlashVars" VALUE=""><param name="wmode" value="opaque" /><PARAM NAME="Movie" VALUE="pageintro.swf?idname='+str+'"><PARAM NAME="Src" VALUE="pageintro.swf?idname='+str+'"><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="sameDomain"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="C7D0CD"><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1">');  
  document.write('<embed  wmode=opaque src="pageintro.swf?idname='+str+'" quality="high" bgcolor="#c7d0cd" width="770" height="292" name="landrover" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></OBJECT>');  
	  
}

function InsertSampleMovieVirt()
{
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="604" height="396" id="10" align="middle">');  
  document.write('  <param name="allowScriptAccess" value="sameDomain" />');  
  document.write('<param name="movie" value="12.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="12.swf" quality="high" bgcolor="#ffffff" width="604" height="396" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>');  
  document.write('</object>');  
}

  function makeHttpRequest(url, callback_function, return_xml) {
	  var http_request = false;

	  if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType && return_xml == 'xml') {
				 http_request.overrideMimeType('text/xml');
			}
	  } else if (window.ActiveXObject) { // IE
			try {
				 http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				 try {
					  http_request = new ActiveXObject("Microsoft.XMLHTTP");
				 } catch (e) {}
			}
	  }

	  if (!http_request) {
			alert('Unfortunately your browser doesn\'t support this feature.');
			return false;
	  }

	  http_request.onreadystatechange = function() {
			if (http_request.readyState == 4) {
				 if (http_request.status == 200) {
					  if (return_xml == 'xml') {
							eval(callback_function + '(http_request.responseXML)');
					  } else {
							eval(callback_function + '(http_request.responseText)');
					  }
				 } else {
					  alert('There was a problem with the request. (Code: ' + http_request.status + ')');
				 }
			}
	  }
	  http_request.open('GET', url, true);
	  http_request.send(null);
  }
  
  
  function getTestimonial(stat) {
	var obj=document.getElementById('Model');
	while (obj.options.length>1)
		obj.remove(1);

	obj.options[0]=new Option("Please Wait!!!","");

	obj.selectedIndex=obj.options.length-1;
	obj.disabled=true;  
   makeHttpRequest('/code/forms/checkModel.asp?make='+stat, 'displayTestimonial', 'text');
}

function displayTestimonial(text) {   
	obj=document.getElementById('Model');
	obj.disabled=false;
	obj.selectedIndex=obj.options.length-1;
	while (obj.options.length>1)
		obj.remove(1);   
	eval(text);		
}

	  