
//Swatches
// top nav carpet swatches that are to the right of the top nav rotating banner

swatchNo1 = Math.floor((Math.random()*100) % 6);
swatchtoShow1 = '/images/swatches/sm_mh_swth_'+ (swatchNo1 + 1) +'.gif';




bversion="4";

//***********************************//
//set up vars for different browsers//
//*********************************//


var ns=0;
var ie =0;
if(document.getElementById && (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1)){
	ns=6; ie=6;
}
else if (document.all) { ns=0; ie=1;}

else if (document.layers) { ns=1; ie=0;}

else {document.location.href = '/get.html'; }


//***************************//
//        functions          //
//***************************//
//actions

function bannerPopUp(popupname, poptext, h, w) {
window.open(popupname,poptext,"height=" + h + ", width=" + w + ", menubar=no, scrollbar=no, status=no, toolbar=no, location=no, resizable=no");
}


function browserDetect()  {
	ns4 = (document.layers)&&(navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==4) ? 'ns4' : false;
	ie4 = (document.all)&&(navigator.appName.indexOf("Microsoft") > -1)&&(parseInt(navigator.appVersion)==4) ? 'ie4' : false;
	ie5 = (document.getElementById)&&(navigator.appName.indexOf("Microsoft") > -1) ? 'ie5' : false;
	ns6 = (document.getElementById)&&(navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)>4) ? 'ns6' : false;
	op5 = (document.getElementById)&&(navigator.appName=="Opera")&&(parseInt(navigator.appVersion)>4) ? 'op5' : false;
	return (ns4 || ie5 || ie4 || ns6 || op5);
}
var browser = browserDetect();

function myDOM(id)  {
	if (browser == 'ns4')  {return document.layers[id];}
	if (browser == 'ie4')  {return eval('document.all.'+ id);}
	if (browser == 'ie5')  {return document.getElementById(id);}
	if (browser == 'ns6')  {return document.getElementById(id);}
	return false;
}

function getStyle(id){
	if(browser == 'ns4'){return myDOM(id);}
	if((browser == 'ie4') || (browser == 'ie5') || (browser == 'ns6')){return myDOM(id).style;}
}	

function popMovieWin(page) {

	MovieWin = window.open(page, 'MovieWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=305,height=315');
		MovieWin.focus();

}

function popMovieWin2(page) {

	MovieWin = window.open(page, 'MovieWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=305,height=400');
		MovieWin.focus();

}

function popMovieWinWide(page) {

	MovieWin = window.open(page, 'MovieWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=415');
		MovieWin.focus();

}



