var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

function alphaImage(strPath, intWidth, intHeight) 
{ 
	if (isIE)
	{
		document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" /></div>');
	}
	else
	{
	    document.write('<img src="'+strPath+'.png" border="0" height='+intHeight+' width='+intWidth+' />');
	}
}

function prodOver(objid){
var tdover = "tdprod" + objid;
var tdpimglprod = "pimglprod" + objid;
document.getElementById(tdover).className = "td-prodOn";
document.getElementById(tdpimglprod).className = "td-prodOn-img";
}
function prodOff(objid){
var tdover = "tdprod" + objid;
var tdpimglprod = "pimglprod" + objid;
document.getElementById(tdover).className = "td-prod";
document.getElementById(tdpimglprod).className = "td-prod-img";
}
function imageLargeOn(a,b){
var ima = document.getElementById('im');
v = a + 10;
z = b + 10;
ima.style.display = "block";
ima.style.right = v + "px";
ima.style.top = z + "px";
}
function imageLargeOff(){
var ima = document.getElementById('im');
ima.style.display = "none";
}
function amazonWidget(a,b) 
{
   var mainLog = document.getElementById("jaxdiv");
   var imLoc = document.getElementById(b);
   var valueA = 10;
   var t = findPosY(imLoc);
   var tfin = t - 20;
   mainLog.style.width = "270px";
   mainLog.style.display = "block";
   mainLog.style.opacity = valueA/10;
   mainLog.style.filter = 'alpha(opacity=' + valueA*10 + ')';
   mainLog.style.zIndex = '1000';
   mainLog.style.top = tfin + "px";
   
   var testObj = document.getElementById("mainidDiv");
   var value = 6;
   testObj.style.opacity = value/10;
   testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
   
   calljax("/?action=frjax&node=" + a + "&type=amazonWidget","GET",null,displayDiv);
}
function amazonWidgetOff() 
{
   var mainLog = document.getElementById("jaxdiv");
   var testObj = document.getElementById("mainidDiv");
   mainLog.style.display = "none";
   var value = 10;
   testObj.style.opacity = value/10;
   testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }
 function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
function amazonSortClick() {
	var w = document.amazonsortform.amazonsortvalue.selectedIndex;
    var selected_text = document.amazonsortform.amazonsortvalue.options[w].value;
	var node_text = document.amazonsortform.amazonsortnode.value;
    var searchindex_text = document.amazonsortform.amazonsortsearchindex.value;
	document.location = "/Shop/" + node_text + "/" + searchindex_text + "/" + selected_text;
}
function detailProduct(a,b,c,d,e) 
{
   var mainLog = document.getElementById("jaxdiv");
   var imLoc = document.getElementById(b);
   var valueA = 10;
   var t = findPosY(imLoc);
   var tfin = t - 20;
   mainLog.style.display = "block";
   mainLog.style.opacity = valueA/10;
   mainLog.style.filter = 'alpha(opacity=' + valueA*10 + ')';
   mainLog.style.zIndex = '1000';
   mainLog.style.top = tfin + "px";
   
   var testObj = document.getElementById("mainidDiv");
   var value = 6;
   testObj.style.opacity = value/10;
   testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
   
   calljax("/?action=frjax&pc=" + a + "&b=" + c + "&a=" + d + "&c=" + e,"GET",null,displayDiv);
}
function detailProductOff() 
{
   var mainLog = document.getElementById("jaxdiv");
   var testObj = document.getElementById("mainidDiv");
   mainLog.style.display = "none";
   var value = 10;
   testObj.style.opacity = value/10;
   testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
