function __gC (c_name) {
        if (document.cookie.length>0) {
                c_start=document.cookie.indexOf(c_name + "=")
                if (c_start!=-1) {
                        c_start=c_start + c_name.length+1;
                        c_end=document.cookie.indexOf(";",c_start);
                        if (c_end==-1) {
                                c_end=document.cookie.length;
                        }
                        return unescape(document.cookie.substring(c_start,c_end));
                }
        }
        return null;
}
function showAD(posArr, callback) {
        for (var i=0; i<posArr.length; i++){
                var pos = posArr[i];
                var div = "sogouFrag_"+pos;
                var adid="ADID_"+pos;
                if (!document.getElementById(adid)) {
                        var html_doc = document.getElementsByTagName('head')[0];
                        js = document.createElement('script');
                        html_doc.appendChild(js);
                        js.setAttribute('id', adid);
                        js.setAttribute('type', 'text/javascript');
                        var urlBuff = ["http://sig.brand.sogou.com/cpc_brand?&pid=sogou__music&position="];
                        urlBuff.push(pos);
                        urlBuff.push("&div=");
                        urlBuff.push(div);
                        urlBuff.push("&suid=");
                        urlBuff.push(__gC("SUID"));
                        urlBuff.push("&url=");
                        urlBuff.push(escape(window.location.href));
                        js.setAttribute('src', urlBuff.join(""));
                }
        }
	if (typeof(callback) == "function") callback();
}
function hideCB(divId) {
	var oDiv = document.getElementById(divId);
	if (oDiv) {
		oDiv.style.display="none";
		var pNode = oDiv.parentNode;
		for(var i=0;i<10;i++){
			if (pNode.getAttribute("SFC")=="t") {
				pNode.style.display="none";
				return;
			}
			pNode = pNode.parentNode;
		}
	}
}

