﻿// JScript 文件

function $(tagid)
{
   return document.getElementById(tagid);
}

function $$(tagname)
{
   return document.getElementsByName(tagname);
}

function gotoaiguang(pname)
{
   window.open('http://www.91cheaper.com/search,000000,'+pname+',,d_1.html');
}

function goshopping(pid)
{
   window.open('http://www.91cheaper.com/rdproduct_'+pid+'.html');
}

function highborder(obj){
document.getElementById(obj).style.borderColor = "#FF6600";
}

function lowborder(obj){
document.getElementById(obj).style.borderColor = "#e0e0e0";
}

function high(obj,inteval){
theobject=obj
highlighting=setInterval("highlightit(theobject)",inteval)
}
function low(obj){
clearInterval(highlighting)
obj.filters.alpha.opacity=20
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=3
else if (window.highlighting)
clearInterval(highlighting)
}
function keephigh(obj){
obj.filters.alpha.opacity=100;
}

function changeMenu(num)
{
   for(var i=1;i<=3;i++)
   {
      var menu = document.getElementById('tabMenu'+i);
      var tab =  document.getElementById('tab'+i);
      if(menu&&tab)
      {
         menu.className='tabNo';
         tab.style.display='none';
      }      
   }
   document.getElementById('tabMenu'+num).className='tabYes';
   document.getElementById('tab'+num).style.display='block';
}

function changeDerection(num)
{
   for(var i=1;i<=4;i++)
   {
      var btn = document.getElementById('direction'+i);
      var img =  document.getElementById('imgDe'+i);
      if(btn&&img)
      {
         btn.className='deretion';
         img.style.display='none';
      }      
   }
   document.getElementById('direction'+num).className='deretionClick';
   document.getElementById('imgDe'+num).style.display='block';
   var img = document.getElementById('imgDe'+num);
   high(img,80);
}

function showcelldetail(ty,obj)
{
    document.getElementById(ty+'_celldetail_'+obj).style.display='block';
}

function hidecelldetail(ty,obj)
{
    document.getElementById(ty+'_celldetail_'+obj).style.display='none';
}

function hidesmallimg(obj)
{
    document.getElementById(obj).style.display='none';
}

function intro_show( )
{

   
    objtag = document.getElementById("introduce_space" );
   
    spec_mode = new String(objtag.innerHTML); 
    
    spec_mode_array = spec_mode.split("&amp;&amp;");
   
    if(spec_mode_array.length>1)
    {
         re_html = new String("<table width='670px' cellpadding='3' cellspacing='1' bordercolor='#ffffff' bgcolor='#CCCCCC' >");
    
        re_html += "<tr><td colspan='4' height='24px'> 详细规格参数</td></tr>";
        re_html += "<colgroup span='4'><col class='cell_name' /><col class='cell_content' /><col class='cell_name' /><col class='cell_content' /></colgroup>";
        
        
        for ( loop=0 ; loop<spec_mode_array.length ; loop++)
        {
        
             temp_string = new String(spec_mode_array[loop]);
             temp_string_array = temp_string.split("##");
     
             
             if (loop%2==0) re_html += "<tr>";
             
             re_html += "<td width='114px'>"+temp_string_array[0]+"</td><td width='221px'>"+temp_string_array[1]+"</td>";
             
             if (loop%2==1) re_html += "</tr>";
        
        
        }
        re_html += "</table>";
        
         objtag = document.getElementById("introduce_space" );
        
        objtag.innerHTML = re_html; 
    }
    
}

function intro_show2( )
{

   
    objtag = document.getElementById("introduce_space" );
   
    spec_mode = new String(objtag.innerHTML); 
    
    spec_mode_array = spec_mode.split("&amp;&amp;");
   
    if(spec_mode_array.length>1)
    {
         re_html = new String("<table width='580px' cellpadding='3' cellspacing='1' bordercolor='#ffffff' bgcolor='#CCCCCC' >");
    
        re_html += "<tr><td colspan='4' height='24px'> 详细规格参数</td></tr>";
        re_html += "<colgroup span='4'><col class='cell_name' /><col class='cell_content' /><col class='cell_name' /><col class='cell_content' /></colgroup>";
        
        
        for ( loop=0 ; loop<spec_mode_array.length ; loop++)
        {
        
             temp_string = new String(spec_mode_array[loop]);
             temp_string_array = temp_string.split("##");
     
             
             if (loop%2==0) re_html += "<tr>";
             
             re_html += "<td width='114px' class='cell_name'>"+temp_string_array[0]+"</td><td width='221px' class='cell_content'>"+temp_string_array[1]+"</td>";
             
             if (loop%2==1) re_html += "</tr>";
        
        
        }
        re_html += "</table>";
        
         objtag = document.getElementById("introduce_space" );
        
        objtag.innerHTML = re_html; 
    }
    
}

function get_absolute(input){
    if(input > 0){
        return input;
    }else{
        return 0-input;
    }
}

function errorPrice(pid)
{

}














