var SportsVar
var storevar
var tit
var img
var CatPass
var TypeVar = "SportsCars"
var url = "dat.aspx?Category="
var category = "SportsCars"
var city = "Houston"
var topnav
var leftcont
var leftgrid
var leftgridover
var mainpanel
var maincont
var maingridover
var leftnav
var loading
var status
var main
var eng
var ava
var companel
var talk
var push

  function display(imgName, imgUrl) {
  if (document.images && typeof imgUrl != 'undefined')
  document[imgName].src = imgUrl.src;
}

  function highlight(ref, color) {
  document.getElementById(ref).style.backgroundColor = color;
}

  function focusnow() {
  data.FirstName.focus();
}

  function focus2() {
  document.getElementById("CCNumber").focus();
}

  function reservations() {
  status.innerHTML = "Reservations"
  main.innerHTML = "<iframe src=http://www.galleriaexotics.com/reservations.aspx?Where=Houston&Vec=" + tit + "&Image=" + img + " allowtransparency=allowtransparency width=600 height=600 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=MainForm></iframe>"
}

function locations() {
  status.innerHTML = "Locations"
  main.innerHTML = "<iframe src=map.html allowtransparency=allowtransparency width=600 height=600 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=MainForm></iframe>"
}

function requirements() {
  status.innerHTML = "Requirements"
  main.innerHTML = "<iframe src=policies.aspx allowtransparency=allowtransparency width=600 height=600 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=MainForm></iframe>"
}

function contact() {
  status.innerHTML = "Contact Us"
  main.innerHTML = "<iframe src=map.html allowtransparency=allowtransparency width=600 height=600 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=MainForm></iframe>"
}

  function getdetails(title, image, price1, price2, price3, info, thumb, category) {
  status.innerHTML = "Fleet&nbsp;&nbsp;&raquo;&nbsp;&nbsp;" + category + "&nbsp;&nbsp;&raquo;&nbsp;&nbsp;" + title;
  CatPass = category;
  img = thumb;
  tit = title.replace(/ /g, "%20");
  main.innerHTML = "<center><table class=Filter1 align=center border=0 height=190 cellSpacing=0><tr><td class=filter2 colspan=3 align=center valign=bottom><img class=vec onclick=getmenu('" + category + "'); src=images/" + image + "></td></tr></table>"
  main.innerHTML += "<table align=center border=0 height=40 cellSpacing=0><tr><td align=center valign=middle><font face=arial,SAN SERIF color=#ffffff size=+1>" + title + "</font></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>"
  main.innerHTML += "<table align=center><tr><td align=left valign=top><img src=images/fleet_button.gif onmouseover=display('fleetlink',fleetlink_over); onmouseout=display('fleetlink',fleetlink_out); name=fleetlink border=0 vspace=6 class=but1 onclick=getmenu('" + category + "');><br /><img src=images/reserve_button.gif onmouseover=display('reservelink',reservelink_over); onmouseout=display('reservelink',reservelink_out); name=reservelink border=0 class=but1 onclick=reservations();></td><td><img src=images/blank.gif width=10 height=1 /></td><td align=left><font face=arial,SAN SERIF color=#ffffff size=2>" + price1 + "<br />" + price2 + "<br />" + price3 + "</font></b><br /><font size=1 color=#cccccc>" + info + "</font></p></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>"
}

function getmenu(cat) {
  loadinginit();
  category = cat;
  http.open("GET", url + cat + "&City=" + city, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function handleHttpResponse() {
  if (http.readyState == 4) {
    if (http.status == 200) {
    
    results = http.responseText.split("--");
    var data0 = results[0];
    status.innerHTML = "Fleet&nbsp;&nbsp;&raquo;&nbsp;&nbsp;" + category;
    main.innerHTML = data0;
    
    setTimeout("loadingcomplete()",100);
  }
 } 
}

function loadinginit() {
  loading.style.visibility = 'visible';
}

function loadingcomplete() {
  loading.style.visibility = 'hidden';
}

function LoadImages() {
  document.getElementById("FillAbs2").innerHTML = "<iframe src=LoadImg.aspx?Category=" + TypeVar + " width=0 height=0 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0></iframe>";
}

function BodyLoad() {
loadingimg = new Image();
loadingimg.src = "images/loading.gif";

loading = document.getElementById('loadingpanel');
status = document.getElementById('status');
leftcont = document.getElementById('leftcont');
leftgrid = document.getElementById('leftgrid');
leftgridover = document.getElementById('leftgridover');
mainpanel = document.getElementById('mainpanel');
mainpanel.style.visibility = 'hidden';
mainpanel.style.width = '0px';
maincont = document.getElementById('maincont');
maincont.style.height = '0px';
maingridover = document.getElementById('maingridover');
maingridover.innerHTML = "";
main = document.getElementById('maingridover');
eng = document.getElementById('eng');
ava = document.getElementById('ava');
companel = document.getElementById('companel');
talk = document.getElementById('talk');
push = document.getElementById('push');


leftgridover.innerHTML = "<span class='lft' onmouseover=highlight('lft1','036CFE'); onmouseout=highlight('lft1','000000'); onclick=javascript:parent.location.href='index.aspx'><img src='images/move_icon.gif' class='icon' /><div id='lft1' class='buthover'>Home</div></span><span onmouseover=highlight('lft2','036CFE'); onmouseout=highlight('lft2','000000'); onclick='reservations();'><img src='images/new_icon.gif' class='icon' /><div id='lft2' class='buthover'>Reservations</div></span><span onmouseover=highlight('lft3','036CFE'); onmouseout=highlight('lft3','000000'); onclick='requirements();'><img src='images/search_icon.gif' class='icon' /><div id='lft3' class='buthover'>Requirements</div></span><span onmouseover=highlight('lft4','036CFE'); onmouseout=highlight('lft4','000000'); onclick='locations();'><img src='images/delete_icon.gif' class='icon' /><div id='lft4' class='buthover'>Locations</div></span><span onmouseover=highlight('lft5','036CFE'); onmouseout=highlight('lft5','000000'); onclick='contact();'><img src='images/edit_icon.gif' class='icon' /><div id='lft5' class='buthover'>Contact Us</div></span>";

getmenu("SportsCars", "Houston");

leftcont.style.height = '0px';

document.body.style.scrollbarBaseColor='#696969'
document.body.style.scrollbarArrowColor='#696969'
document.body.style.scrollbarDarkShadowColor='#000000'
document.body.style.scrollbarFaceColor='#2e2e2e'
document.body.style.scrollbarHighlightColor='#2e2e2e'
document.body.style.scrollbarShadowColor='#696969'

sedanslink_out = new Image();
sedanslink_out.src = "images/sedans_button.gif";
sedanslink_over = new Image();
sedanslink_over.src = "images/sedans_button_h.gif";
sportscarslink_out = new Image();
sportscarslink_out.src = "images/sportscars_button.gif";
sportscarslink_over = new Image();
sportscarslink_over.src = "images/sportscars_button_h.gif";
suvslink_out = new Image();
suvslink_out.src = "images/suvs_button.gif";
suvslink_over = new Image();
suvslink_over.src = "images/suvs_button_h.gif";

fleetlink_over = new Image();
fleetlink_over.src = "images/fleet_button_h.gif";
fleetlink_out = new Image();
fleetlink_out.src = "images/fleet_button.gif";
reservelink_over = new Image();
reservelink_over.src = "images/reserve_button_h.gif";
reservelink_out = new Image();
reservelink_out.src = "images/reserve_button.gif";


setTimeout("moveleftpanel()",500);
setTimeout("movemainpanelright()",500);
setTimeout("mainpanel.style.visibility='visible'",650);
setTimeout("cominit()",3500);
setTimeout("flashinit()",1000);
}

function moveleftpanel() {
    if (leftcont.style.height != '150px') {
    leftcont.style.height = parseInt(leftcont.style.height)+10+'px';
    }  else { leftgridover.style.display = "inline"; }
    setTimeout(moveleftpanel,20);
}

function movemainpanelright() {
  if (mainpanel.style.width != '600px') {
    mainpanel.style.width = parseInt(mainpanel.style.width)+60+'px';
    setTimeout(movemainpanelright,20);
  }
  else { 
    movemainpanel();
  }
}

function movemainpanel() {
  if (maincont.style.height != '640px') {
    maincont.style.height = parseInt(maincont.style.height)+40+'px';
  }
  else {
    maingridover.style.display = "inline";
  }
  setTimeout(movemainpanel,20);
}

function flashinit() {
  ava.innerHTML = "<iframe src=http://www.galleriaexotics.com/com.aspx allowtransparency=allowtransparency width=120 height=100 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=comframe ID=comframe>";  
}

function cominit() {
//  document.getElementById("FillAbs2").innerHTML = "<iframe src=LoadImg.aspx?Category=" + TypeVar + " width=0 height=0 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0></iframe>";
  eng.innerHTML = "<iframe src=http://www.galleriaexotics.com/eng_chat_front.aspx allowtransparency=allowtransparency width=170 height=219 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=MainForm></iframe>";
//  document.getElementById("ava").innerHTML = "<iframe src=http://www.galleriaexotics.com/com.aspx allowtransparency=allowtransparency width=1 height=1 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0 name=comframe ID=comframe>";
//  document.getElementById("push").innerHTML = "<iframe src=push.aspx allowtransparency=allowtransparency width=200 height=200 scrolling=no frameborder=0 MARGINHEIGHT=0 MARGINWIDTH=0>";
  var TalkNav = "<input class='BoxStyle1' type='text' name='SayBox' ID='SayBox' /><span style='cursor: hand; cursor: pointer;' ID='SayButton' class='buttontext' onclick='Say();' onMouseOver=this.style.borderStyle='inset'; onMouseOut=this.style.borderStyle='outset';>SAY</span>";
  document.getElementById('talk').innerHTML = TalkNav;
  companel.style.visibility = "visible";
  talk.style.visibility = "visible";
  ava.filters.alpha.opacity='100';
  
//  document.getElementById('SayBox').focus();
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

var http = getHTTPObject2();

function getHTTPObject2() {
  var xmlhttp2;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp2 = false;
      }
    }
  @else
  xmlhttp2 = false;
  @end @*/
  if (!xmlhttp2 && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp2 = new XMLHttpRequest();
    } catch (e) {
      xmlhttp2 = false;
    }
  }
  return xmlhttp2;
}

var http2 = getHTTPObject2();

function Say() {
  
  var words = document.getElementById('SayBox').value;
    var url4 = "http://www.galleriaexotics.com/say.aspx?Words2="
    if (words == "") {
      var moron = "";
      document.getElementById('SayBox').focus(); }
    else {
     http2.open("GET", url4 + words, true);
     document.getElementById('SayBox').value = '';
     document.getElementById('SayBox').focus();
     http2.send(null);
}

}

document.onkeypress =
function checkKeyPress(e)
   {
   if(!e)e = window.event;
   var key = (typeof e.which == 'number')?e.which:e.keyCode;
   if(key == 13) Say();
   }

if (document.captureEvents)
   {
   document.captureEvents(Event.KEYPRESS);
   }
if (document.addEventListener)
   {
   document.addEventListener("keypress", checkKeyPress, true);
   }
  
  function focus1() {
  data.FirstName.focus();
}

function y2k(number)    { return (number < 1000) ? number + 1900 : number; }

var today = new Date();
var day   = today.getDate();
var month = today.getMonth();
var year  = y2k(today.getYear());

function padout(number) { return (number < 10) ? '0' + number : number; }

function restart() {
    document.data.PUDate.value = '' + padout(month - 0 + 1) + '/' + padout(day) + '/' + year;
    mywindow.close();
}

function restart2() {
    document.data.DODate.value = '' + padout(month - 0 + 1) + '/' + padout(day) + '/' + year;
    mywindow.close();
}

function newWindow() {
    mywindow=open('calendar.aspx','myname','resizable=no,width=285,height=235,left=475,top=180');
    mywindow.location.href = 'calendar.aspx';
    if (mywindow.opener == null) mywindow.opener = self;
}

function newWindow2() {
    mywindow=open('calendar2.aspx','myname','resizable=no,width=285,height=235,left=475,top=180');
    mywindow.location.href = 'calendar2.aspx';
    if (mywindow.opener == null) mywindow.opener = self;
}

function newWindow3(file,window) {
    msgWindow=open(file,window,'resizable=no,width=485,height=350,left=200,top=150');
    if (msgWindow.opener == null) msgWindow.opener = self;
}