﻿var isIE, isNs;
isIE = false;
isNs = false;
if (navigator.appName == "Netscape") {isNs=true;}else{isIE= true;}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function Show(id)
{    
    var obj = MM_findObj(id);
    if (obj.style) obj = obj.style;    
    obj.display = "block";    
}

function open_popup_window(url, win_width, win_height, resize, scrollbars)
{
   newWindow=window.open(url,'popup', 'menubar=no,toolbar=no,resizable=yes,scrollbars='+scrollbars+',width='+win_width+',height='+win_height);
}	


function Hide(id)
{
    var obj = MM_findObj(id);
    if (obj.style) obj = obj.style;    
    obj.display = "none";    
}

function roll(id, newSrc) {
    var theImage = MM_findObj(id);
    if (theImage)theImage.src = newSrc;

}

function showhideInfo(id, detail, img)
{
    var obj1 = MM_findObj(id);
    var obj2 = MM_findObj(detail);
    var obj3 = MM_findObj(img);
    if (obj1.style) obj1 = obj1.style;
    if (obj1.display == "none")
    {
        obj2.innerHTML = "(Hide Details ...)";
        obj3.src = "/Library/Image/collapse_blue.jpg"
        if (isNs)
			obj1.display = "table-row";
		else
			obj1.display = "block";
			
	    
    }
    else
    {
        obj2.innerHTML = "(Show Details ...)";
        obj3.src = "/Library/Image/expand_blue.jpg"
        obj1.display = "none";
    }
}

function modifyItemQuantity(o, qty)
{
	var obj = MM_findObj(o);		
	var oldVal = 0;
	if (obj != null)
	{		
		oldVal = Number(obj.value);
		obj.value = oldVal + Number(qty);
	}
		
}
