/* Design & Code (c) LA Showroom, Inc. 2006 */

/*  OLD SCRIPTS - START  */
// Brian Lee
// Last Update: March.10.2004

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var browser = navigator.appName;

function selectColor(passedvar) {
//colorIndex = document.add_cart.lightColor.options[document.add_cart.lightColor.selectedIndex].value;
//var colorIndex = colorIndex.split("(");
//document.images['productImage'].src = "item_images/" + colorIndex[0];
if (passedvar.indexOf(':') == -1)
	{
document.images['productImage'].src = "item_images/" + passedvar;
		}
else
document.images['productImage'].src = passedvar;
//document.smalllayer.images['theSmallIm'].src = "item_images/" + passedvar;
//document.images['theSmallIm'].src = "item_images/" + passedvar;
//init();

}
/*   OLD SCRIPTS - END   */


// automatic URL jump on drop-down selection
function jumpMenu(targ,selObj,restore) {
  eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
  if (restore) selObj.selectedIndex = 0;
}

// item detail and item list larger view
function viewItem(pid, colorfile) {
  mesg = 'picview.htm?pid=' + pid + '&colorfile=' + colorfile;
  window.open(mesg, 'itemview', 'toolbar=0, scrollbars=yes, location=0, statusbar=0, menubar=1, resizable=1, width=620, height=750, left=50, top=50');
}

// item description and cart view
function quickView(pid, cid) {
  mesg = 'item.quickview.htm?pid=' + pid + '&cid=' + cid;
  window.open(mesg, 'quickview', 'toolbar=0, scrollbars=yes, location=0, statusbar=0, menubar=1, resizable=1, width=640, height=750, left=50, top=50');
}

// view my orders and store orders
function viewOrder(order_id) {
  mesg = 'showorder.htm?order_id=' + order_id;
  window.open(mesg, 'orderview', 'toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=1, resizable=1, width=700, height=750, left=50, top=50');
}

function popUp_ccform(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=750,height=800,left = 340,top = 112');");
}

/* POP-UPS-UP-THE-WAZOO SECTION - END */


/* DISABLE RIGHT-CLICK - START */

//var message = "Function Disabled!";
function clickIE4() {
  if (event.button == 2) {
    //alert(message);
    return false;
  }
}
function clickNS4(e) {
  if (document.layers || document.getElementById&&!document.all) {
    if (e.which == 2 || e.which == 3) {
      //alert(message);
      return false;
    }
  }
}

if (document.layers){
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown = clickNS4;
}
else if (document.all && !document.getElementById) {
  document.onmousedown = clickIE4;
}

// document.oncontextmenu = new Function("alert(message);return false")
document.oncontextmenu = new Function("return false")

/* DISABLE RIGHT-CLICK - END */

/* Open Code - START */

