﻿
//套系列表产品明细
function Clickcolandexp(obj,num)
{
    var another = document.getElementsByTagName('td');                                
    if(obj) //收起
    {
        for(var i=0;i < another.length;i++)  {                    
            if(another[i].id.indexOf("Tds_A_"+num+"_") >= 0)
                document.getElementById(another[i].id).style.display = "";
            if(another[i].id.indexOf("Tds_"+num+"_") >= 0)
                document.getElementById(another[i].id).style.display = "none";
        }                
    }
    else {            
        for(var i=0;i < another.length;i++)  {
            if(another[i].id.indexOf("Tds_A_"+num+"_") >= 0)
                document.getElementById(another[i].id).style.display = "none";
            if(another[i].id.indexOf("Tds_"+num+"_") >= 0)
                document.getElementById(another[i].id).style.display = "";
        }                
    }
}

//套系列表产品明细标题
function Contcolandexp(obj,WebKey,url)
{
    if(WebKey)
    {    
        window.location.href = "/CheckWedadvise.aspx?forward="+url;
        return false;
    }
    var another = document.getElementsByTagName('tr');
    if(obj) {
        for(var i=0;i < another.length;i++)  {
            if(another[i].id.indexOf("Trs_") >= 0)
                document.getElementById(another[i].id).style.display = "none";                    
        }                
        document.getElementById("content_div_expand").style.display = "";
    }
    else
    {
        for(var i=0;i < another.length;i++)  {
            if(another[i].id.indexOf("Trs_") >= 0)
                document.getElementById(another[i].id).style.display = "";                    
        }            
        document.getElementById("content_div_expand").style.display = "none";
    }
}

//套系列表礼品明细
function Giftcolandexp(obj)
{
    var another = document.getElementsByTagName('div');
    if(obj) {
        for(var i=0;i < another.length;i++)  {                    
            if(another[i].id.indexOf("gift_div2_") >= 0)
                document.getElementById(another[i].id).style.display = "none";
            if(another[i].id.indexOf("gift_div1_") >= 0)
                document.getElementById(another[i].id).style.display = "";
        }
    }
    else
    {
        for(var i=0;i < another.length;i++)  {                    
            if(another[i].id.indexOf("gift_div1_") >= 0)
                document.getElementById(another[i].id).style.display = "none";
            if(another[i].id.indexOf("gift_div2_") >= 0)
                document.getElementById(another[i].id).style.display = "";
        }
    }
}

function toUTF8(szInput)
{ 
	var wch,x,uch="",szRet="";
	for (x=0; x<szInput.length; x++)
	{
		wch=szInput.charCodeAt(x);
		if (!(wch & 0xFF80))
		{
			szRet += szInput.charAt(x);
		}
		else if (!(wch & 0xF000))
		{
			uch = "%" + (wch>>6 | 0xC0).toString(16) + 
			"%" + (wch & 0x3F | 0x80).toString(16);
			szRet += uch; 
		}
		else
		{
			uch = "%" + (wch >> 12 | 0xE0).toString(16) + 
			"%" + (((wch >> 6) & 0x3F) | 0x80).toString(16) +
			"%" + (wch & 0x3F | 0x80).toString(16);
			szRet += uch; 
		}
	}
	return(szRet);
}