Hashtable.prototype.hash 	 = null;
Hashtable.prototype.keys 	 = null;
Hashtable.prototype.location = null;

function Hashtable(){
	this.hash = new Array();
	this.keys = new Array();

	this.location = 0;
}


Hashtable.prototype.get = function (key) {
	return this.hash[key];
}

Hashtable.prototype.put = function (key, value){
	if (value == null)
	return null;

	if (this.hash[key] == null)
		this.keys[this.keys.length] = key;

	this.hash[key] = value;
}
//declare an instance
var items = new Hashtable();

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function submitSearch( ) {
		document.frmSearchIt.action = 'showitems.asp';
		document.frmSearchIt.submit()			
	}

	var index= 0;
	var contentWin = null;
	
	
function openWindow3() {
    win2 = new Window('sample3'+index, {className: "dialog", title: "My Wish List", top:346, left:565, width:250, height:340, zIndex:1, opacity:1, resizable: true, url: "my_wish_lists.htm"})
    win2.show();
    index++;
}
function sendForm(strDestUrl)
{	
	var str;
	if (strDestUrl == "add2cart" )
	{
		str = "add2cart.asp";
	}
	else if (strDestUrl == "add2wl")
	{
		str = "add2wl.asp";
	}
	document.form1.action =str
	//opener1.location = str

	var exists = eval(document.form1["Prefix2"]);
	if(exists) {
		document.form1.hidSize.value = document.form1.Prefix2.selectedIndex;
	}

	document.form1.submit();
}
function openWin1(url, width, height) {

	var exists = eval(document.form1["Prefix1"]);
	if(exists) {
		var colorIndexSelected = document.form1.Prefix1.selectedIndex;
		var colorSelected = document.form1.Prefix1.options[colorIndexSelected].value;
		url = url  + "&code=" + colorSelected;
	}


	var windowName;
	var params;
	var win;
	windowName = "buttons";
	params = "toolbar=0,";
	params += "location=0,";
	params += "directories=0,";
	params += "status=0,";
	params += "menubar=0,";
	params += "scrollbars=1,";
	params += "resizable=1,";
	params += "top=50,";
	params += "left=50,";
	params += "width="+width+",";
	params += "height="+height;
	win = window.open(url, windowName, params);
	win.opener.name = "opener";
}

function openWin(url, width, height) {
	var windowName;
	var params;
	var win;
	windowName = "buttons";
	params = "toolbar=0,";
	params += "location=0,";
	params += "directories=0,";
	params += "status=0,";
	params += "menubar=0,";
	params += "scrollbars=1,";
	params += "resizable=1,";
	params += "top=50,";
	params += "left=50,";
	params += "width="+width+",";
	params += "height="+height;
	win = window.open(url, windowName, params);
	win.opener.name = "opener";
}

function subPrintable() {
	allowExit = true
	openWin('showimage.asp','325','300');
}


function LoadIt()
{

	var exists = eval(document.form1.Prefix1);
	if(exists) {

	if (document.form1.hidSize.value == "")
     {
          document.form1.Prefix1.selectedIndex = 0;
     } 
     else
     {
          select1_onchange(document.form1.Prefix1, document.form1.hidSize.value); 
     }
     }
}


function changeImage(img_name,img_src) {
document[img_name].src=img_src;
}

function setImageDD(img_code) {
document.form1.Prefix2.options.value = img_code;
}
	
function openWindow3() {
    win2 = new Window('sample3'+index, {className: "dialog", title: "My Wish List", top:346, left:565, width:250, height:340, zIndex:1, opacity:1, resizable: true, url: "my_wish_lists.htm"})
    win2.show();
    index++;
}

function select1_onchange( strName, SizeIndex   ) {
	//setImage(strName);
	popSelection ( strName, SizeIndex ) ;	
}

function setImage(imageSelect) {

	theImageIndex = imageSelect.options[imageSelect.selectedIndex].value;
	// tlm 11/29/07 just get the image, don't use the hashtable
	//xOptID = items.get(theImageIndex)		

 	//if (xOptID > 0) {
 		//var ImageExists = eval("img" + xOptID );
 		var ImageExists = eval("img" + theImageIndex );

			if (ImageExists.src != "") {
			document.itemimage.src = ImageExists ;
			}
	//}

}

