/* Zbox stylez */
function changeheight(){
	if (window.innerHeight && window.scrollMaxY) {
		var yWithScroll = window.innerHeight + window.scrollMaxY;
		var lightBoxOverlayHeight = yWithScroll;
	} else {
		var yWithScroll = document.body.scrollHeight;
		var yHeight = document.body.clientHeight;
		var lightBoxOverlayHeight = yWithScroll + yHeight;
	}
	e = MM_findObj("lightBoxOverlay");
	e.style.height = lightBoxOverlayHeight + 'px';
}
function showLB(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
	changeheight();
	hideSelectBoxes();
}
function showLBMain(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';

	var whatsTheWidth = (obj.offsetWidth)/2;
	obj.style.marginLeft = '-' + whatsTheWidth + 'px';
	
	var whatsTheHeight = (obj.offsetHeight)/2;
	obj.style.marginTop = '-' + whatsTheHeight + 'px';
	
	showLB('lightBoxOverlay');
}
function hideLB(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
function hideAll(){
	hideLB('lightBox');
	hideLB('lightBoxHelp');
	hideLB('lightBoxOverlay');
	showSelectBoxes();

	hideAll3();
}
function hideAll2(){
	parent.hideLB('lightBox');
	hideLB('lightBoxHelp');
	parent.hideLB('lightBoxOverlay');
	parent.showSelectBoxes();
}
function hideAll3() {
    hideLB('divLBHelp_20LBag');
    hideLB('divLBHelp_25LBag');
    hideLB('divLBHelp_40LBag');
    hideLB('divLBHelp_50LBag');
    hideLB('divLBHelp_1_4m3BulkBag');
    hideLB('divLBHelp_1_2m3BulkBag');
    hideLB('divLBHelp_1m3BulkBag');
    hideLB('divLBHelp_Bulk');
    hideLB('divLBHelp_Each');
    hideLB('lightBoxPalletDepositHelp');
    hideLB('lightBoxDeliveryInstructionsHelp');
    hideLB('lightBoxOverlay');

    showSelectBoxes();
}
function hideSelectBoxes(){
	if (window.innerHeight && window.scrollMaxY) {
		return false;
	} else {
		obj = MM_findObj('countrySelect');
		if (!obj) return;
		obj.style.visibility = 'hidden';
		obj2 = MM_findObj('levelSelect');
		if (!obj2) return;
		obj2.style.visibility = 'hidden';
	}
    /*for (var i = 0; i < document.forms.length; i++) {
        for (var e = 0; e < document.forms[i].length; e++) {
            if (document.forms[i].elements[e].tagName == 'SELECT') {
                document.forms[i].elements[e].style.visibility = 'hidden';
            }
        }
    }*/
}
function showSelectBoxes(){
	if (window.innerHeight && window.scrollMaxY) {
		return false;
	} else {
		obj = MM_findObj('countrySelect');
		if (!obj) return;
		obj.style.visibility = 'visible';
		obj2 = MM_findObj('levelSelect');
		if (!obj2) return;
		obj2.style.visibility = 'visible';
	}
    /*for (var i = 0; i < document.forms.length; i++) {
        for (var e = 0; e < document.forms[i].length; e++) {
            if (document.forms[i].elements[e].tagName == 'SELECT') {
                document.forms[i].elements[e].style.visibility = 'visible';
            }
        }
    }*/
}
