function MM_reloadPage(init)
{ //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


function MM_displayStatusMsg(msgStr)
{ 
  status=msgStr;
  document.MM_returnValue = true;
}


function pop_Window(theURL,winName,features)
{ 
  window.open(theURL,winName,features);
}


function MM_preloadImages()
{
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function dateString()
{
months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
d = new Date();
year = getRealYear(d);
return (days[d.getDay()] + ", " + d.getDate() + " " + months[d.getMonth()] + ", " + year);
}

function getRealYear(d)
{
var y = d.getYear();
if (y < 1000)
{
y = y + 1900;
}
return y
}

function opennew(img,x,y)
{
  if (screen.width > 800)
  {
  openpage(img,x,y);
  }
  if (screen.width <= 800)
  {
  openplain(img,x,y);
  }
}

function openplain(img,x,y)
{
  var winLeft = ((screen.width/2)-(x/2))
  var msgWindow = window.open('','','Width=' + x + ',Height=' + y + ',top=0,screenX=0,left=' + winLeft + ',screenY=' + winLeft + '');
  var page='<IMG SRC=\"' + img + '\">';
  msgWindow.document.open();
  msgWindow.document.write('<HTML><HEAD><TITLE>Talon Sportscars Image Gallery</TITLE></HEAD>')
  msgWindow.document.write('<BODY LEFTMARGIN=\"0\" TOPMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">')
  msgWindow.document.write(page);
  msgWindow.document.write('</BODY></HTML>')
  msgWindow.document.close();
}

function openpage(img,x,y)
{
  x = x + 100
  if (x < 600)
  {
  x = 600
  }
  y = y + 120;
  var winLeft = ((screen.width/2)-(x/2));
  var msgWindow = window.open('','','Width=' + x + ',Height=' + y + ',top=0,screenX=0,left=' + winLeft + ',screenY=' + winLeft + '');
  var page='<IMG SRC=\"' + img + '\">';
  msgWindow.document.open();
  msgWindow.document.write('<HTML><HEAD><TITLE>Talon Sportscars Image Gallery</TITLE></HEAD>')
  msgWindow.document.write('<BODY BGCOLOR=\"#000033\" LEFTMARGIN=\"0\" TOPMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">')
  msgWindow.document.write('<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"25\" align=\"center\">')
  msgWindow.document.write('<tr><td></td></tr></table>')
  msgWindow.document.write('<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr>')
  msgWindow.document.write('<td height=\"15\"><img src=\"/images/picturegalleryheader.gif\" width=\"500\" height=\"15\" border=\"0\"></td></tr>')
  msgWindow.document.write('<tr><td height=\"25\"></td></tr>')
  msgWindow.document.write('<tr><td align=\"center\" valign=\"top\">')
  msgWindow.document.write(page);
  msgWindow.document.write('</td></tr><tr><td height=\"25\"></td></tr>')
  msgWindow.document.write('<tr><td height=\"13\" align=\"center\"><a href=\"javascript:window.close()\"><FONT COLOR=WHITE>Close Window</FONT></a></td></tr>')
  msgWindow.document.write('</table></BODY></HTML>')
  msgWindow.document.close();
}

function validate_exhaust()
{
  var accepted = ('true');
  
  if (document._xclickexhaust.os0.value == 'Select Vehicle')
  {
    accepted = 'false';
  }  
  if (accepted == 'false') 
    	{
  	alert('You must select a Vehicle');
   	}
	
  if (accepted == 'true') 
  {
  return true;
  }	
  else
  {
  return false;
  }
}
