<!--
var has_customizations = false;
var def_lyr = 'lyr1';
var cur_page;
var cur_lyr;

function swapLayers(id) {
  if (cur_lyr) 
  hideLayer1(cur_lyr);
  showLayer1(id);
  setSrc(id.substring(3,4),cur_lyr.substring(3,4));
  cur_lyr = id;
  
}

function showLayer1(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) 
  lyr.style.display = "block";
}

function hideLayer1(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) 
  lyr.style.display = "none";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function setSrc(g,k){
	//alert(document.getElementById("tab"+g).src)
	switch(g){
		case '2': document.getElementById("tab"+g).src="images/tabs_features_on.gif"
		break;
		case '3': document.getElementById("tab"+g).src="images/tabs_specs_on.gif"
		break;
		case '4': document.getElementById("tab"+g).src="images/tabs_includes_on.gif"
		
		break;
		case '5': document.getElementById("tab"+g).src="images/tabs_policies_on.gif"
		break;
		case '6': document.getElementById("tab"+g).src="images/tabs_reviews_on.gif"
		break;
		default: alert('ff')
	}
	//alert(document.getElementById("tab"+g).src)
	switch(k){
		case '2': document.getElementById("tab"+k).src="images/tabs_features_off.gif"
		break;
		case '3': document.getElementById("tab"+k).src="images/tabs_specs_off.gif"
		break;
		case '4': document.getElementById("tab"+k).src="images/tabs_includes_off.gif"
		break;
		case '5': document.getElementById("tab"+k).src="images/tabs_policies_off.gif"
		break;
		case '6': document.getElementById("tab"+k).src="images/tabs_reviews_off.gif"
		break;
		
	}
	
}

function PrinterVersion(url){
var dimensions = "directory=0,height=480,width=650,left=30,top=80,resizable=1,statusbar=0,hotkeys=0,menubar=0,scrollbars=1,status=0,toolbar=0";
var newWindow = window.open(url + '&pv=pf','print',dimensions);
newWindow.focus();
}

function ViewImages(){
	var top=(screen.height)?(screen.height-530)/2:100;
	var left = (screen.width)?(screen.width-660)/2:100;
	var rows = varImages.length;
	imageViewer = window.open('view-product-images.asp?rows='+ rows ,'zoom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=660,height=530,top=' + top + ',left=' + left + '')
	imageViewer.focus();
}

function EmailPage(product_id){
	var top=(screen.height)?(screen.height-400)/2:100;
	var left = (screen.width)?(screen.width-550)/2:100;
	var dimensions = 'directory=0,height=400,width=550,left=' + left + ',top=' + top + ',resizable=1,statusbar=0,hotkeys=0,menubar=0,scrollbars=1,status=0,toolbar=0';
	EmailWindow = window.open('tell_a_friend.php?to_email_address=&x=13&y=10&products_id=' + product_id ,'EmailWindow',dimensions);
	EmailWindow.focus();
}

//ConCon functions

function confObj(){
this.option_id;
this.option_name;
this.SpecOptID;
this.value;
this.price;
this.selected;
this.page;
this.NotAvail;
this.NotAvailDue;
}

function getConfObj(optID){
var confObj = null
for(var i=0; i < conf.length; i++){
	if (conf[i].SpecCustID == optID){
		confObj = conf[i];
		break;
	}
}
return confObj;
}

function MarkSelected(opt){
var optID = opt.id;
if (opt.type == "checkbox"){
	for(var i=0; i < conf.length; i++){
		if ("spec_opt_" + conf[i].SpecCustID == optID){
			conf[i].selected = opt.checked;
			break;
		}
	}
}
else{
	var optName = opt.name;
	for(var i=0; i < conf.length; i++){
		if (optName == "customizations" + conf[i].option_id){
			conf[i].selected = ("spec_opt_" + conf[i].SpecCustID == optID) ? true : false;
		}
	}
}
}

function CheckOption(OptID, NotAvailWith) {
var a = NotAvailWith.split(",");

var b = false; var NotAvailDue = ""; var NotAvailText = ""; var obj; var s = ""
for(var i=0; i < a.length; i++){
	obj = getConfObj(a[i]);
	if (obj != null){
		if (obj.selected == true){
			b = true;
			NotAvailDue = NotAvailDue + a[i] + ",";
			NotAvailText = NotAvailText + obj.option_name + ', ';
		}
	}
}
var obj_ref
obj_ref = getElemRef("spec_opt_" + OptID)
if(obj_ref == null)
	{return}
obj_ref.disabled = b;
if (b == true) {
	obj = getConfObj(OptID);
	if(obj.selected == true){obj.selected = false; SelectNextOption(obj.option_id);}
	NotAvailDue = NotAvailDue.substr(0, NotAvailDue.length - 1);
	NotAvailText = NotAvailText.substr(0, NotAvailText.length -2);
	NotAvailText = "<a href='javascript:ConConMsg(\"" + NotAvailDue + "\")' class='OptionUnavail'><b>Unavailable</b><br>Due to the " + NotAvailText + " selected</a>";
	getElemRef("Unavail_" + OptID).style.display = "block";
	getElemRef("Unavail_" + OptID).innerHTML = NotAvailText;
	getElemRef("spec_val_" + OptID).className = "grayv8";
	}
else{ if(obj_ref != null){
	getElemRef("Unavail_" + OptID).style.display = "none";
	getElemRef("Unavail_" + OptID).innerText = "";
	getElemRef("spec_val_" + OptID).className = "";}
	}
}

function CurPageSummary(){
var s = "";
for(var i=0; i < conf.length; i++){
	var obj = conf[i];
	if (obj.selected == true && obj.page == null){
		s=s + '<b>' + obj.option_name + '</b>:&nbsp;' + obj.value + '<br>';
	}
}
s=replace(s, " ", "&nbsp;");
return s;
}

function SelectNextOption(OptionGroup) {
var grp = eval("document.Form1.customizations" + OptionGroup);
for (var i=0; i < grp.length; i++) {
   if (grp[i].disabled == true){grp[i].cheked = false}
   else {grp[i].checked = true; MarkSelected(grp[i]); break;}
}
}

function ConConMsg(NotAvailDue){
var MsgText = "This option is unavailable while the following options are selected:<p>";
var obj;
a = NotAvailDue.split(",");
	for(i=0; i < a.length; i++){
//		obj = getElemRef("spec_opt_" + a[i]);
//		obj = getElemRef("opt_" + obj.name);
//		MsgText += "<b>" + obj.innerHTML + "</b>: ";
//		MsgText += getElemRef("spec_val_" + a[i]).innerHTML;
//		DestPage = getElemRef("spec_opt_page_" + a[i]);
		obj = getConfObj(a[i]);
		MsgText += "<b>" + obj.option_name + "</b>: ";
		MsgText += obj.value;
		DestPage = obj.page;
		if (DestPage != null)
			{PageNum = DestPage; MsgText += "&nbsp;<a href='javascript:GoToPage(" + PageNum + ")' class='more'>Change</a>";}	
		MsgText += "<br><br>"	
	}
MsgText = MsgText + "</p>"
textmessagebox = getElemRef('concon_message_textarea');
textmessagebox.innerHTML = MsgText;
descbox('concon_message', 'visible')
}

function validate(){
	var Msg = "";
	for(var i=0; i < conf.length; i++){
		if (conf[i].value == "Choose One" && conf[i].selected == true){
			Msg = Msg + conf[i].option_name + ", ";
		}
	}
	if (Msg != ""){
		Msg = Msg.substr(0, Msg.length - 2);
		Msg = "Please choose a option for " + Msg;
	}
	return Msg;
}

function GoToPage(PageNum){
var s = validate();
if (s != ""){alert(s); return;}
document.Form1.page.value = PageNum;
document.Form1.submit();
return false;
}

function AddToCart(){
var s = validate();
if (s != ""){alert(s); return;}
document.Form1.action = "update-cart.asp";
document.Form1.submit();
return false;
}

function getElemRef(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	return el;
}

function InitDrag(CustID, Pref){
	var r = getElemRef(Pref + CustID);
//	var h = getElemRef('topbar_' + CustID);
//	Drag.init(h,r);
	Drag.init(r);
}
-->
