var theCollectionWindow;
var windowHeight = 450;
if (document.layers){
	windowHeight = 470;
}

var cached=0;

if (document.images){

the_home_off = new Image()
the_home_off.src = "/navbar/home.gif"
the_home_on = new Image()
the_home_on.src = "/navbar/home_on.gif"

the_glossary_off = new Image()
the_glossary_off.src = "/navbar/glossary.gif"
the_glossary_on = new Image()
the_glossary_on.src = "/navbar/glossary_on.gif"

the_links_off = new Image()
the_links_off.src = "/navbar/links.gif"
the_links_on = new Image()
the_links_on.src = "/navbar/links_on.gif"

the_obtain_a_sample_off = new Image()
the_obtain_a_sample_off.src = "/navbar/obtain_a_sample.gif"
the_obtain_a_sample_on = new Image()
the_obtain_a_sample_on.src = "/navbar/obtain_a_sample_on.gif"

the_veneer_of_the_month_off = new Image()
the_veneer_of_the_month_off.src = "/navbar/veneer_of_the_month.gif"
the_veneer_of_the_month_on = new Image()
the_veneer_of_the_month_on.src = "/navbar/veneer_of_the_month_on.gif"

the_veneer_selector_off = new Image()
the_veneer_selector_off.src = "/navbar/veneer_selector.gif"
the_veneer_selector_on = new Image()
the_veneer_selector_on.src = "/navbar/veneer_selector_on.gif"

the_veneer_trends_off = new Image()
the_veneer_trends_off.src = "/navbar/veneer_trends.gif"
the_veneer_trends_on = new Image()
the_veneer_trends_on.src = "/navbar/veneer_trends_on.gif"

the_environment_off = new Image()
the_environment_off.src = "/navbar/environment.gif"
the_environment_on = new Image()
the_environment_on.src = "/navbar/environment_on.gif"
cached=1;
}

function imageOn(imgName) {
	if (cached==1) {
	lineOn = eval("the_" + imgName + "_on.src");
	document [imgName].src= lineOn;
	}
}

function imageOff(imgName) {
	if (cached==1) {
	lineOff = eval("the_" + imgName + "_off.src");
	document [imgName].src= lineOff;
	}
}

function openSwatch(VeneerName, VeneerID){
	theCollectionWindow = window.open('/veneers/viewCollection.asp?addVeneerName=' + VeneerName + '&addVeneerID=' + VeneerID,'CollectionWindow','width=412,height=' + windowHeight + ',toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no')
}

function viewSwatch(VeneerID){
	theCollectionWindow = window.open('/veneers/viewCollection.asp?Collection=' + VeneerID,'CollectionWindow','width=412,height=' + windowHeight + ',toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no')
}

function viewCurrentSwatch(){
//	if(theCollectionWindow == undefined){
		theCollectionWindow = window.open('/veneers/viewCollection.asp','CollectionWindow','width=412,height=' + windowHeight + ',toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no')
//	}else{
//		theCollectionWindow.focus();
//	}
}

function confirmDelete(thisCollectionID, thisCollectionName) {
	theGUIWindow = window.open('/veneers/deleteWindow.asp?theCollection=' + thisCollectionID + '&theName=' + thisCollectionName ,'GUIWindow','width=420,height=150,toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no,top=' + (self.screenTop+150) +',left=' + self.screenLeft + '')
}

function deleteConfirmed(thisCollection) {
		self.location.href = ("/veneers/index.asp?DeleteCollection=" + thisCollection);
}

function doLogOut(){
	theCollectionWindow = window.open('/veneers/viewCollection.asp?Override=Yes&Action=New&Logout=Yes','CollectionWindow','width=420,height=' + windowHeight + ',toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no')
}

function doPopupImage(theURL){
	theCollectionWindow = window.open(theURL,'ImageWindow','width=420,height=760,toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no')
}

function doPopupWindow(theURL){
	theCollectionWindow = window.open(theURL,'CollectionWindow','width=412,height=' + windowHeight + ',toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no')
}

function doPrintData(ID1, Name1){
	theQS = "";
	theQS += "ID1=" + ID1;
	theQS += "&Name1=" + Name1;
	thePrintWindow = window.open('/veneers/datasheet.asp?' + theQS,'PrintDataWindow','width=600,height=480,toolbar=yes, location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,copyhistory=no, resizable=yes')
}

function toggleCheck(formElement){
	document.loginForm[formElement].checked = (document.loginForm[formElement].checked*-1)+1
}


