var percentRead=0;window.onunload=resetforms;$(function(){resetforms()});jQuery(document).ready(function(){jQuery("a[rel='gallery_02']").colorbox()});function resetforms(){var b=document.location.href.substring(document.location.href.length,document.location.href.lastIndexOf("=")+1);if(b=="booking"){tb_switch(false,"tb_enable","re_det");$("bookingForm").reset();var a=document.getElementById("bia_frame");if((/MSIE (\d+\.\d+);/.test(navigator.userAgent))&&new Number(RegExp.$1)==6){a.contentWindow.document.body.onscroll=function(){scrollMe(a)}}else{a.contentWindow.onscroll=function(){scrollMe(a)}}}if(b=="quote"){$("quoteForm").reset();document.getElementById("pid").style.visibility="hidden"}}function findval(c,e){var d=document.getElementById(c);var a=d.checked?true:false;var b=a?"tb_disable":"tb_enable";tb_switch(a,b,e)}function tb_switch(c,d,g){var f=document.getElementById(g);var b=f.getElementsByTagName("input");var h=f.getElementsByTagName("label");for(var e=0;e<h.length;e++){document.getElementById(h[e].id).disabled=c}for(var e=0;e<b.length;e++){document.getElementById(b[e].id).disabled=c;var a=document.getElementById(b[e].id).className;a=a.split(" ");document.getElementById(b[e].id).className=d+" "+a[1]}}function processForm(a){progbar();$(a).request({onSuccess:function(e){if(e.responseText.match(/^OK/)!=null){if(a=="bookingForm"){var d="<h3>Thank You.</h3><p>Your booking request has been submitted.<br>A confirmation e-mail has been sent to you outlining payment details.</p>";jAlert(d,"Message",function(f){jQuery.scrollTo(0,800)})}if(a=="quoteForm"){var c="<h3>Thank You.</h3><p>Your quotation request has been submitted.<br>We will be in contact with you shortly.</p>";jAlert(c,"Message",function(f){jQuery.scrollTo(0,800)})}$(a).reset();if(a=="bookingForm"){percentRead=0;document.getElementById("bia_frame").contentWindow.scrollTo(0,0);findval("age_na","re_det")}document.getElementById("siimage").src="si/securimage_var.php?sid="+Math.random()}else{jQuery.alerts._hide();str=e.responseText;str=str.split("*");alert(str[0]);if(str[1]!=null){jQuery.scrollTo(str[1],800)}var b=document.getElementById(str[2]);if(b){b.focus()}}}});return false}function printMe(){window.frames.bia_frame.focus();window.frames.bia_frame.print()}function scrollMe(b){var a=b.contentWindow.document.body.scrollTop;var c=b.contentWindow.document.body.scrollHeight;var e=b.contentWindow.document.body.clientHeight;var d=Math.round((a/(c-e))*100);if(percentRead<d){percentRead=Math.round((a/(c-e))*100)}document.getElementById("print_agree").value=percentRead+"% read"}function phoneMail(a){if(a.value=="Phone"){document.getElementById("eid").style.visibility="hidden";document.getElementById("pid").style.visibility="visible"}else{document.getElementById("eid").style.visibility="visible";document.getElementById("pid").style.visibility="hidden"}};
