var isNetscape = (navigator.appName == "Netscape");

var bVer=parseInt(navigator.appVersion);
var NS4 = (document.layers) ? true : false;
var IE4 = ((document.all) && (bVer>=4)) ? true : false;
var NS6 = ((isNetscape==true) && (bVer>=5)) ? true : false;

var collectObj = (IE4) ? "all." : "";
var styleObj = (IE4)||(NS6) ? ".style" : "";

if (NS4||NS6) { 
	avail_width = innerWidth;
	avail_height = innerHeight;}
else {
	avail_width = document.body.clientWidth;
	avail_height = document.body.clientHeight;}

function getObj( objName )
{
	if (NS6) { var theObj = document.getElementById(objName).style;}
	else { var theObj = eval( "document." + collectObj + objName + styleObj )}

	return theObj;
}


function mVis (objName)
{
	var visNavObj = getObj(objName);
	visNavObj.visibility = "visible"; 
}

function mInv (objName)
{
	var visNavObj = getObj(objName);
	visNavObj.visibility = "hidden"; 
}

function tgetObj(tabName,objName)
{
	if (NS6) { var theObj = document.getElementById(objName).style;}
	else { 
		if (NS4) {
				var theObj = eval( "document." + tabName + ".document." + collectObj + objName + styleObj )}
		else {
				var theObj = eval( "document." + collectObj + objName + styleObj )}
		}
	return theObj;
}

function mtVis (tabName,objName)
{
	var visNavObj = tgetObj(tabName,objName);
	visNavObj.visibility = "visible"; 
}

function mtInv (tabName,objName)
{
	var visNavObj = tgetObj(tabName,objName);
	visNavObj.visibility = "hidden"; 
}

function img_act(imgID,imgName,src_code,alt_code) {

	if (NS6) { var XImg = document[imgName];}
	else {
		if (NS4) {
			if (imgID == "") {
				var XImg = eval("document.images[imgName]") }
			else {
				var XImg = eval( "document." + imgID + ".document.images[imgName]"); }
		}
		else {
			var XImg = eval( "document.all." + imgName );
		}
	}
	XImg.src=src_code;
	XImg.alt=alt_code;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function orderWindow(wUrl) {
	eval("orderwindow1=window.open(wUrl,'OrderWindow','scrollbars=yes,width=620,height=355')");
}

function detailWindow(wUrl) {
	eval("orderwindow1=window.open(wUrl,'DetailWindow','scrollbars=yes,width=420,height=200')");
}

function popAsp(photoUrl) {
	if (avail_width > 640) {
		eval("popwindow1=open('http://www.backyardblinds.com/BYBPic.asp?Photo='+ photoUrl +'','popwindow1','dependent=yes,scrollbars=yes,width=743,height=490,resizable=yes,screenX=20,screenY=20')");}
	else	{
		eval("popwindow1=open('http://www.backyardblinds.comBYBPic.asp?Photo='+ photoUrl +'','popwindow1','dependent=yes,scrollbars=yes,width=600,height=400,resizable=yes,screenX=20,screenY=20')");}
}

function popup(url,w,h)
{
        newWindow = window.open (url, 'new', 'resizable,scrollbars=0,width='+w+',height='+h);
        newWindow.shadetree = self;
}