﻿// JScript 文件

function ControlImgShow(objUrl, proName, proDetail)
{

    document.getElementById("product_show").getElementsByTagName("img")[0].src = objUrl;
	
    // document.getElementById("product_name").innerText = proName;
    // document.getElementById("product_detail").innerText = proDetail;

	// innerText -> innerHTML	by Gorden 20080604
	document.getElementById("product_name").innerHTML = proName;
	document.getElementById("product_detail").innerHTML = " &nbsp;" +  proDetail;
}

function isIE(){ //ie?
   if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1)
    return true;
   else
    return false;
}

if(!isIE()){ //firefox innerText define
   HTMLElement.prototype.__defineGetter__(     "innerText",
    function(){
     var anyString = "";
     var childS = this.childNodes;
     for(var i=0; i<childS.length; i++) {
      if(childS[i].nodeType==1)
       anyString += childS[i].tagName=="BR" ? '\n' : childS[i].innerText;
      else if(childS[i].nodeType==3)
       anyString += childS[i].nodeValue;
     }
     return anyString;
    }
   );
   HTMLElement.prototype.__defineSetter__(     "innerText",
    function(sText){
     this.textContent=sText;
    }
   );
}

function EnableFeaturItem()
{
   var Href = window.location.href;
   if(Href.substring(Href.length-1,Href.length)=="/" || Href.substring(Href.length-12,Href.length).toUpperCase() == "DEFAULT.ASPX")
   {
        document.getElementById("featur_bottom").style.display = "";
   } 
}
