//======================
// Under construction
// $("html").append("<div class='upgrading'></div>");

// Scrolling Banner
/*
$(document).ready(function(){
  $(window).scroll(function(){
  	// alert($(window).scrollTop());
	// alert($(".smartBanner").css("top") );
	bTop = $(".smartBanner").css("top").replace("px","");
    if  ($(window).scrollTop() > bTop) {
	  // alert($(window).scrollTop());
      $(".rightpanel").css("position", "fixed");
      $(".rightpanel").css("top", "0");
    }
    if  ($(window).scrollTop() <= bTop) {
      $(".rightpanel").css("position", "relative");
      $(".rightpanel").css("top", $(".smartBanner").offset);
    }
   });
}); */

// JavaScript Document
function showBtn(currentB) {
	var currentBtn = document.getElementById(currentB);
	currentBtn.style.display = "block";
}
function hideBtn(currentB) {
	var currentBtn = document.getElementById(currentB);
	currentBtn.style.display = "none";
}
function MM_preloadImages() { //v3.0
  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 openBox(selection) {
	var opened = document.frmenquiry[selection].disabled;
	if (opened == true) {
		document.frmenquiry[selection].disabled = false;
		document.frmenquiry[selection].style.backgroundColor="#fff";
	} else {
		document.frmenquiry[selection].disabled = true;
		document.frmenquiry[selection].style.backgroundColor="#EEE";
	}
}

function onVideo(tvideo) {
	document.getElementById('video_box').style.display = "block";
	getHeight = document.getElementById('video_box').style.height.replace("px", "");
	if (document.documentElement.clientHeight >= getHeight) {
		document.getElementById('video_box').style.height = document.documentElement.clientHeight + "px";
	} else {
		document.getElementById('video_box').style.height = 760 + "px";
	}
	// document.getElementById('video_box').style.height = getHeight + "px";
	document.getElementById('video_in').innerHTML = "<iframe src=\"http://www.youtube.com/v/" + tvideo + "\" width=\"955\" height=\"600\"></iframe>";
}

function offVideo() {
	document.getElementById('video_box').style.display = "none";
	document.getElementById('video_in').innerHTML = "";
}

function copyAddress() {
	if ( $("input[name=txtcheck]:checked").length == 1) {
		if (confirm('Copy Billing Address over?') == true) {	
			$('[name=txtothername]').val($('[name=txtname]').val());
			$('[name=txtotheraddress]').val($('[name=txtaddress]').val());
			$('[name=txtotheraddress2]').val($('[name=txtaddress2]').val());
			$('[name=txtotherpostcode]').val($('[name=txtpostcode]').val());
			$('[name=txtothercity]').val($('[name=txtcity]').val());
			$('[name=selotherstate]').val($('[name=selstate]').val());
			$('[name=selothercountry]').val($('[name=selcountry]').val());
			$('[name=txtotherphone]').val($('[name=txtphone]').val());
			$('[name=txtotheremail]').val($('[name=txthandle]').val());
		}
	} else {
		$('[name=txtothername]').val("");
		$('[name=txtotheraddress]').val("");
		$('[name=txtotheraddress2]').val("");
		$('[name=txtotherpostcode]').val("");
		$('[name=selotherstate]').val("");
		$('[name=selothercountry]').val("");
		$('[name=txtotherphone]').val("");
		$('[name=txtotheremail]').val("");
	}
}
