﻿
function onpageload()
{    
    
    var myWidth = 0, myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
        
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      } 
      
      
       
      
      var lay_div = document.getElementById("HomeMainContentHolder1");
      lay_div.style.height = (myHeight-10) + 'px';
       
      var inner_lay_div = document.getElementById("InnerMainContentHolder1");
      inner_lay_div.style.height = (myHeight-40) + 'px';
      
      var searchbox_div = document.getElementById("BigSearchBoxRep1");
      if(searchbox_div.style.display == "block")
      {
        searchbox_div.style.height = ( myHeight - 584 - 40) + 'px';
      }
      
      
      var hdiv = document.getElementById("HideBackDiv");
      hdiv.style.width = myWidth + 'px';
      hdiv.style.height = (myHeight-30) + 'px';
      
      var BarDetails1Content = document.getElementById("BarDetails1Content");
      BarDetails1Content.style.left = (myWidth/2) - 365 + "px";
      BarDetails1Content.style.top =  (myHeight/2) - 200 + "px";
}


function show_search_results()
{
    var page_content = document.getElementById("MainPageContent1");
    //page_content.innerHTML = "";
    
    
    fo = new FlashObject("../flash_res/fleet.swf", "bars", "870", "620", "8.0.22", "#B9C4CA", true); //"#B9C4CA"
    
    var bar_name = "";
    if("Bar name" != document.getElementById("ctl00_MainSearchControl1_TextBox1").value)
    {
        bar_name = document.getElementById("ctl00_MainSearchControl1_TextBox1").value;
    }
    
    var city = "";
    if("City" != document.getElementById("ctl00_MainSearchControl1_TextBox2").value)
    {
        city = document.getElementById("ctl00_MainSearchControl1_TextBox2").value;
    }
    
    var state = "";
    if("State" != document.getElementById("ctl00_MainSearchControl1_TextBox3").value)
    {
        state = document.getElementById("ctl00_MainSearchControl1_TextBox3").value;
    }
    
    var zip = "";
    if("Zip" != document.getElementById("ctl00_MainSearchControl1_TextBox4").value)
    {
        zip = document.getElementById("ctl00_MainSearchControl1_TextBox4").value;
    }
    
    
    
    var xml_file_path_str = "../flash_res/SearchResults.aspx?Name=" + bar_name + "~City=" + city + "~State=" + state + "~Zip=" + zip + "";
    
    
    var happy_hours = 0;
    if( document.getElementById("ctl00_MainSearchControl1_CheckBox1").checked == true)
    {   
        happy_hours = 1;
        xml_file_path_str += "~With_Happy_Hours=1";
    }
    
    
    var web_site = 0;
    if( document.getElementById("ctl00_MainSearchControl1_CheckBox2").checked == true)
    {
        web_site = 1;
        xml_file_path_str += "~With_Web_Site=1";
    }
    
    
    
    fo.addVariable("XMLFile", xml_file_path_str);
    fo.write("MainPageContent1");
    
    
}


function show_details(id)
{   
    onpageload();
    
    document.getElementById("MainPageContent1").style.visibility = "hidden";
    document.getElementById("MainSearchBox1").style.visibility = "hidden";
    
    var bar_det = document.getElementById("BarDetails1Content");
    bar_det.style.display = "block";
    
    var hdiv = document.getElementById("HideBackDiv");
    hdiv.style.display = "block";
}


/*

function resize()
{
    
    var main_content_holder= document.getElementById("HomeMainContentHolder1");
    
    var winW = 909, winH = 587;
    
      var myWidth = 0, myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
      
    //document.body.width = myWidth;
    //document.body.height = myHeight;
    //window.innerWidth = 400;
    //window.innerHeight = 400;
    
    myHeight = myHeight-65;  
    if(myHeight > 587)
    {
       main_content_holder.style.height = myHeight + "px";
       //alert(main_content_holder.style.height);
    }
    //alert(myWidth + " " + myHeight);
    
}
*/


