// Written by Owen O Doherty 25/04/09
// Purpose - Shows the script for advanced Camper search

function toggleSearch()
{

   var txt='';
   var element = document.getElementById("search");
   if (element.innerHTML == "")
   { 
        txt = "<table border=0 width=100% >"+
                    "<tr>"+
                        "<td CLASS=rboxtextLeft><input type=checkbox name=toilet>Toilet</td>"+
                    "</tr>"+
                    "<tr>"+
                        "<td CLASS=rboxtextLeft><input type=checkbox name=shower>Shower</td>"+
                    "</tr>"+
                    "<tr>"+
                         "<td CLASS=rboxtextLeft><input type=checkbox name=stove>Stove</td>"+
                    "</tr></table>";
         element.innerHTML = txt;
   }
   else
   {
        element.innerHTML = "";
   }
}

// These Functions Use by Drop CSS Menu
function showYourRental()
{
   document.getElementById("fixYourrental1").style.display="block";
   document.getElementById("popoutYourRental").style.display="block";
} 
function hideYourRental()
{
   document.getElementById("fixYourrental1").style.display="none";
   document.getElementById("popoutYourRental").style.display="none";
}

function showCampervans()
{
   document.getElementById("fixCampervans1").style.display="block";
   document.getElementById("popoutCampervans").style.display="block";
} 
function hideCampervans()
{
   document.getElementById("fixCampervans1").style.display="none";
   document.getElementById("popoutCampervans").style.display="none";
}

function showHolidays()
{
   document.getElementById("fixHolidays1").style.display="block";
   document.getElementById("popoutHolidays").style.display="block";  
} 
function hideHolidays()
{
   document.getElementById("fixHolidays1").style.display="none";
   document.getElementById("popoutHolidays").style.display="none";
}

function showSuppliers()
{
   document.getElementById("fixSuppliers1").style.display="block";
   document.getElementById("popoutSuppliers").style.display="block";

} 
function hideSuppliers()
{
   document.getElementById("fixSuppliers1").style.display="none";
   document.getElementById("popoutSuppliers").style.display="none";
}

function showAboutus()
{
   document.getElementById("popoutAboutus").style.display="block";
} 
function hideAboutus()
{
   document.getElementById("popoutAboutus").style.display="none";
}


 function popslideshow(url) {
    newwindow=window.open(url,'sswin','height=700,width=850,scrollbars=yes');
    if (window.focus) {
         newwindow.focus()
    }
    return false; 
 } 
 
 
function showdropdown(element){ 
    document.getElementById(element).style.display='block'; 
    
    return false;
}

function hidedropdown(element){
    document.getElementById(element).style.display='none'; 
    
    return false;
}


// Start by hiding popouts - think this is mistake
// hideYourRental();

//Launch the Virtual Tou

function launchTour(url)
{
    var newwindow=window.open('../viewTour.php?loc='+url,'info','height=500,width=600,scrollbars=yes');
    if (window.focus) {
         newwindow.focus()
    }
    return false;

}//end tour


function popup(url, width, height)
{
  var newwindow=window.open(url,'info','height='+height+',width='+width+',scrollbars=no');
    if (window.focus) {
         newwindow.focus()
    }
    return false; 

}

function popupstd(url)
{
  var newwindow=window.open(url,'info','height=500,width=600,scrollbars=yes');
    if (window.focus) {
         newwindow.focus()
    }
    return false; 

}

//Gets a div id and opens a new window for printing. (requires jquery included)
function print_div(idname) 
{
   w=window.open();

   w.document.write('<html>');
   w.document.write('<head><LINK REL="stylesheet" HREF="/printview.css" type="text/css" > </head>');
   w.document.write('<body><p><img src=\"/images/logo.jpg\" /> http://www.discovery-campervans.com.au Ph: +61 7 3442 2900 </p>');
   w.document.write($('#'+idname).html());
   w.document.write('</body></html>');
   w.print();
   w.document.close();
   //w.document.execCommand("Stop");
}
