//--Notice of Copyright --//
/*
Copyright (C) 2003, Juxta Media LLC
All rights reserved.
Reproduction or use of code contained herein is strictly prohibited without
the expressed permission of Juxta Media LLC.

Under no circumstances shall this copyright notice be removed from this file.
*/
//--End Notice --//

function onColor(blah,bgColor){
	//3366CC
	blah.style.backgroundColor=bgColor;	
}

function offColor(blah,bgColor){
	//003399
	blah.style.backgroundColor=bgColor;
}


function validate_size() {
	if ( document.frmAddCart.prmSizeID != null) {
		if ( document.frmAddCart.prmSizeID.value == 0 ) {
		   alert ( "Please select a Size / Color." );
		   return false;
		}
	}
	document.frmAddCart.submit();
	return true;
}

function searchProducts(prmKeywords)
{
    //document.frmSearch.action='/searchmedia.php';
    document.location.href='/searchmedia.php?prmKeywords='+prmKeywords;
}

function deleteConfirm( theURL) {
	if (confirm('Are you absolutely sure you wish to delete this record?  This is not recoverable.')) 
		top.location.href = theURL;
}

function openDimWindow(file, width, height, winname, nodim) {
	if (!winname) winname = 'win1';
	if (!nodim) nodim = false;
	if (nodim)
		dimension="toolbar=no,status=no,location=no,scrollbars=no,resizable=no,width="+width+",height="+height; 
	else 
		dimension="toolbar=yes,status=no,location=no,scrollbars=yes,resizable=yes,width="+width+",height="+height; 
	window.open(file, winname, dimension);
}

function openWindow(file,winname) {
	var width = 600;
	var height = 500;
	openDimWindow(file, width, height, winname, false);
}

function openFullWindow(file,winname) {
	if (!winname) winname = 'fullwin';
	var width = 800;
	var height = 600;
	openDimWindow(file, width, height, winname, false);
}



function clearConfirm( theURL) {
	if (confirm('Are you absolutely sure you wish to clear the sent records?  This is not recoverable.')) 
		top.location.href = theURL;
}

function bookmarkThis(url, desc) {
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4) && (navigator.platform != "MacPPC")) {
		window.external.addFavorite(url, desc);
	}
	else {
		var msg = "Please hit";
		if (navigator.appName == "Netscape") 
			msg += " (CTRL-D) to add to your bookmark.";
		else if (navigator.platform == "MacPPC")
			msg += " (Apple-D) to add to your favorites.";
		else 
			msg += " the \"Favorites\" item in the menu bar to add to your favorites.";
		alert(msg);
	}
}

function ImageLoad( theImageName, theOnSrc, theOffSrc ) {
	if (document.images) {
	  eval(theImageName + "on = new Image()");
	  eval(theImageName + "off = new Image()");
	  eval(theImageName + "on.src = '" + theOnSrc + "'");
	  eval(theImageName + "off.src = '" + theOffSrc + "'");
	}
}
function ImageOn( theImageName ) {
  if (document.images) {
    document.images[theImageName].src = eval(theImageName + "on.src");
  }
}
function ImageOff( theImageName ) {
  if (document.images) {
    document.images[theImageName].src = eval(theImageName + "off.src");
  }
}

var marked_row = new Array;

function setColor (theRow, theRowNum, theColor, theState) {
	rowCellsCnt = theRow.cells.length;
	for (c = 1; c < rowCellsCnt-1; c++) {
		if (theState == 'down') {
			marked_row[theRowNum] = true;
		}
		/*else {
			if (downColor == '')
				theRow.cells[c].setAttribute('bgcolor', theColor, 0);
		}*/
		theRow.cells[c].setAttribute('bgcolor', theColor, 0);
	} 
}

function showDiv(whichLayer)
{
	if (document.getElementById)
	{
	// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	}
	style2.display = "block";
}

function hideDiv(whichLayer)
{
	if (document.getElementById)
	{
	// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	}
	style2.display = "none";
}
