// GLOBAL FUNCTIONS

// check browser

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

// new swap functions
function get(id)
{
    if (document.getElementById!=undefined) return document.getElementById(id);
    else return document.all[id];
}
function showDIV(id)
{
    get(id).style.display = 'block';
}
function hideDIV(id)
{
    get(id).style.display = 'none';
}
function toggleVisible(id)
{
    (get(id).style.display=='block') ? hideDIV(id) : showDIV(id);
}

function popup(url)
{
	var popup = window.open(url,'Quote Form','status=1');
	popup.moveTo(0,0);
}

function showImage(id)
{
	var bath_noi = 10;
	while(bath_noi > 0)
	{
		hideDIV('gallery-image-'+bath_noi);
		bath_noi--;
	}
	var out_noi = 7;
	while(out_noi > 0)
	{
		hideDIV('gallery-image-out-'+out_noi);
		out_noi--;
	}
	get('gallery-image-'+id).style.height = 'auto';
   showDIV('gallery-image-'+id);
}

function showTab(id)
{
	hideDIV('tab1');
	hideDIV('tab2');
	showDIV('tab'+id);
}

// sub nav
sfHover = function() {
	var sfEls = document.getElementById("primary-nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);