var startHeight = null;
var navStartHeight = null;
var slideshow=new TINY.slideshow("slideshow");

window.onload = function () {
	slideshow.auto=true;
	slideshow.speed=6;
	slideshow.init("slideshow","image");
	if (document.getElementById("billingAddressDiv")){
		bA = document.getElementById("billingAddressDiv");
		bA.style.display = "none";
	}
	
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
		getSizes();
	}
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	 	getSizesIE();
	 }
	}
}

window.onresize = function(){
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
		getSizes();
	}
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	 	getSizesIE();
	 }
	}
}
function getSizesIE(){
	myBody = document.getElementById("body");
	startHeight =  startHeight== null ? myBody.offsetHeight: startHeight;
	//alert(document.body.offsetHeight);
	var windowheight = document.documentElement.clientHeight;
	if (windowheight == 0){
		windowheight = document.body.offsetHeight;
	}	
	if (startHeight < windowheight){
		myBody.style.height = (windowheight-10)+"px";
		myNav = document.getElementById("navigationContainer");
		myNav.style.height = (windowheight-140)+"px";
		document.getElementById("contact").style.position = "absolute";
		document.getElementById("contact").style.bottom = "25px";
		
	}
	else {
		myBody.style.height = startHeight-10+"px";
		myNav = document.getElementById("navigationContainer");
		myNav.style.height = (startHeight-140)+"px";
		document.getElementById("contact").style.position = "static";
		document.getElementById("contact").style.bottom = "25px";
	}
	
	if (windowheight < document.getElementById("contentContainer").offsetHeight+120){
		myBody.style.height = (document.getElementById("contentContainer").offsetHeight+120)+"px";
		myNav = document.getElementById("navigationContainer");
		myNav.style.height = (document.getElementById("contentContainer").offsetHeight)+"px";
		document.getElementById("contact").style.bottom = "25px";
	}
	
}

function getSizes(){
	myBody = document.getElementById("body");
	startHeight =  startHeight== null ? myBody.offsetHeight: startHeight;
	
	if (startHeight < window.innerHeight){
		myBody.style.height = (window.innerHeight-10)+"px";
		myNav = document.getElementById("navigationContainer");
		myNav.style.height = (window.innerHeight-140)+"px";
		document.getElementById("contact").style.bottom = "0";
	}
	else {
		myBody.style.height = (startHeight-10)+"px";
		myNav = document.getElementById("navigationContainer");
		myNav.style.height = (startHeight-140)+"px";
		document.getElementById("contact").style.bottom = "0";
	}
	
}

function showBilllingAddress(el){
	if (el.checked){
		if (document.getElementById("billingAddressDiv")){
			bA = document.getElementById("billingAddressDiv");
			var inputs = bA.getElementsByTagName("input");
			for (i =0; i< inputs.length; i++){
				if (inputs[i].type == "text"){
					inputs[i].removeAttribute("disabled");
				}
			}
			var inputs = bA.getElementsByTagName("select");
			for (i =0; i< inputs.length; i++){
				inputs[i].removeAttribute("disabled");
			}
			bA.style.display = "block";
		}
	}
	else {
		if (document.getElementById("billingAddressDiv")){
			bA = document.getElementById("billingAddressDiv");
			var inputs = bA.getElementsByTagName("input");
			for (i =0; i< inputs.length; i++){
				if (inputs[i].type == "text"){
					inputs[i].disabled = "disabled";
				}
			}
			
			var inputs = bA.getElementsByTagName("select");
			for (i =0; i< inputs.length; i++){
				inputs[i].disabled = "disabled";
			}
			bA.style.display = "none";
		}
	}
	if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
                getSizes();
        }
         if (navigator.appName.indexOf("Microsoft")!=-1) {
                getSizesIE();
         }
        }

}
