document.write("<style>ul{list-style:none;margin:0;padding:0;}</style>");
var orderDest=["10669501"];
var username=["张扬","小样"];
var identity=["520236198308122366"];
var searchURL="http://www.qling.com/search.do";
var indexPage="http://www.qling.com/html/index.html?";
var mmsIndex="http://www.qling.com";
var toMphone="http://www.qling.com/mphone.do";
function GetLocationParam(param){ //获取页面参数
    var request = { 
        QueryString : function(val) { 
        var uri = window.location.search; 
        var re = new RegExp("" +val+ "=([^&?]*)", "ig"); 
        return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null); 
        } 
    }
	if(param=="serviceId"){
		if(request.QueryString(param)==null)return "100001";
	}
	if(param=="webownerId"){
		if(request.QueryString(param)==null)return "10000";
	}
if(param=="goPage"){
		if(request.QueryString(param)==null)return "2";
	}

   return  request.QueryString(param); 
}
var webownerId=GetLocationParam("webownerId");
var serviceId=GetLocationParam("serviceId");
var a=GetLocationParam("a");
var b=GetLocationParam("b");
var c=GetLocationParam("c");
var d=GetLocationParam("d");
var e=GetLocationParam("e");
var f=GetLocationParam("f");
function MMSiframe(id,frameObj){
	//href=/mphone.do?type=1&webownerId=${webownerId}&amp;serviceId=${serviceId}&amp;id=${ring.id};
	var href=toMphone+"?type=1&webownerId="+webownerId+"&serviceId="+serviceId+"&id="+id;
	href=href+"&goPage=2";
  frameObj.src = href;
}
function SearchSinger(singerName){
	//search singer
         
	var url='/search.php?singer='+singerName+'&aid='+aid;
	t=window.open(url,"singerName");
	t.focus();
}
function SearchSongOrPic(){
	 
	var keyWords=document.getElementById('keyWords').value;
	if(arguments.length!=0){

		keyWords=document.getElementById(arguments[0]).value;
	}
	var typenameArray=document.getElementsByName('typename');
	var typename="songname";
	if(typenameArray.length==1){
		typename=typenameArray[0].value;
	}else{
	for(var i=0;i<typenameArray.length;i++){
		if(typenameArray[i].checked==true){
			if(typenameArray[i].value==""){
				break;
			}else{
		     	typename=typenameArray[i].value;
			    break;
			}
		}
	}
	}
	var urlStr=searchURL+"?"+"keyWords="+ keyWords +"&typename="+ typename +"&webownerId="+ webownerId +"&serviceId="+ serviceId;
	window.open(urlStr);
	return false;
}
function ToSendWindow(fileId,mphoneNum){
	
	 var urlStr=mmsIndex+"/mphone.do?webownerId="+ webownerId +"&serviceId="+ serviceId +"&id="+ fileId;
	 if(mphoneNum=='0'){	
	   var t=window.open(mmsIndex+"/html/index2.html?serviceId="+serviceId+"&webownerId="+webownerId+"&fileId="+fileId+"&goPage=2");
	   t.focus();
     }else{
		urlStr=urlStr+"&goPage="+mphoneNum;
		var iWidth=500; 
        var iHeight=325;
		
		var iTop=(screen.height-iHeight)/2;
        var iLeft=(screen.width-iWidth)/2;
	 	 var t=window.open(mmsIndex+"/html/index2.html?serviceId="+serviceId+"&webownerId="+webownerId+"&fileId="+fileId+"&goPage=2");
		//var t=window.open(urlStr,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
	    t.focus();
	 }
}
function ToRingOrPicListWindow(opentype,CatalogId,fatherCatalogId,fatherTitle,title){
          
	if(opentype=="ring"){
		var urlStr=mmsIndex+ "/ringlist.do?type=1&id="+ CatalogId +"&webownerId="+ webownerId +"&serviceId="+ serviceId +"&fatherCatalogId="+fatherCatalogId+"&fatherTitle="+fatherTitle+"&title="+title;
	    var t=window.open(urlStr);
	    t.focus();
	}else if(opentype=="pic"){
		var urlStr=mmsIndex+"/piclist.do?id="+ CatalogId +"&type=2&title="+ title +"&webownerId="+ webownerId +"&serviceId="+ serviceId;
		var t=window.open(urlStr);
	    t.focus();
	}
	
}
function ToIndexWindow(){
        
	var urlStr= indexPage+"webownerId="+ webownerId +"&serviceId="+ serviceId;
	var t=window.open(urlStr);
	t.focus();
}
function cutCharacter(str){
	var checkChatacter=false;
	 var array = [];
	 for(var i=0;i<arguments.length;i++){
	 	array[i]=arguments[i];
	 }
for(var i=0;i<str.length;i++)   
   if(str.charCodeAt(i)>=10000){
   	checkChatacter=true;
	break;
   }  
   if(array[1]==null){
   	if(checkChatacter){
		str=str.substring(0,5)
	}else{
		str=str.substring(0,12)
	}
	document.write(str);
   }else{
   	if(checkChatacter){
		str=str.substring(0,parseInt(arguments[1]));
	}else{
		str=str.substring(0,parseInt(arguments[1])+parseInt(arguments[1]));
	}
   	document.write(str);
   }
	
}
function SingRingSendWindow(varStr){
	    var goPage='8';
	    var iWidth=500; 
        var iHeight=325;
		var iTop=(screen.height-iHeight)/2;
        var iLeft=(screen.width-iWidth)/2;
		var t=window.open(varStr + "&goPage="+goPage,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
                 t.focus();
}
function ToMoreInfoWindow(catalogid,type,title){
          
	var urlStr=mmsIndex+"/moreinfo.do?catalogid="+ catalogid +"&type="+ type +"&title="+ title +"&webownerId="+ webownerId +"&serviceId="+ serviceId;
	var t=window.open(urlStr);
	    t.focus();
}
function ToPicIndexWindow(){
	var urlStr=mmsIndex+"/picIndex.do?webownerId="+ webownerId +"&serviceId="+ serviceId;
	var t=window.open(urlStr);
	    t.focus();
}
function ToFriends(songname){
	 var iWidth=500; 
        var iHeight=325;
		var iTop=(screen.height-iHeight)/2;
        var iLeft=(screen.width-iWidth)/2;
var urlStr=toMphone+"?webownerId="+ webownerId +"&serviceId="+ serviceId +"&id=&songname="+ songname +"&goPage=8";
	var t=window.open(urlStr,"detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
	    t.focus();

}
function ToYoudayIndexWindow(){
	var t=window.open('http://www.youday.cn');
	    t.focus();  
}
function ShowSinger(num,styleClass){
var singerArray1=new Array("陈楚生","SHE","刘德华","马天宇","林俊杰","张学友","飞轮海","王心凌");//发送页
var singerArray2=new Array("周杰伦","张靓颖","刘德华","蔡依林","林俊杰","张学友","王菲","花儿乐队","S.H.E","王力宏","Twins","张韶涵","潘玮柏","梁静茹","孙燕姿","王心凌");//首页
var singerArray3=new Array("周杰伦","李宇春","S.H.E","蔡依林","林俊杰","Twins","梁静茹","孙燕姿","花儿乐队","王菲","王心凌","陶??","周华健","张惠妹","刘德华","莫文蔚","潘玮柏","张靓颖","容祖儿","五月天","陈奕迅","F.I.R","周传雄","任贤齐","光良","周笔畅","张信哲","水木年华");//发送页
var singerArray4=new Array("周杰伦","刘德华","林俊杰","张韶涵","王力宏","Twins","梁静茹","蔡依林","张学友","张靓颖","潘玮柏","孙燕姿","王菲","陶??","王心凌","莫文蔚","梁咏琪","S.H.E","五月天","陈奕迅","容祖儿","任贤齐","光 良","F.I.R","周笔畅","张信哲","张惠妹","周华健","李宇春","萧亚轩","周传雄","刘若英","张国荣","阿杜","王杰","游鸿明","郑秀文","刀郎","许如芸","水木年华","谭咏麟");//首页
var singerArray5=new Array("Twins","郑源","陈奕迅","凤凰传奇","林俊杰","张学友","张韶涵","SHE","刘德华","蔡依林","林俊杰","张学友","王力宏");//发送页
if(num!=0){
	num=num+"";
	var singer=eval("singerArray"+num);
for(var i=0;i< singer.length ;i++){
if(styleClass!="null"){
document.write("<a class="+styleClass+" href=\"javascript:SearchSinger(\'"+ singer[i]+"\')\" >["+singer[i]+"]</a> ");
}else{
document.write("<a href=\"javascript:SearchSinger(\'"+ singer[i]+"\')\" >["+singer[i]+"]</a> ");
}

};
	
}
}
function showOrderDiv(hidden_element_id,show_element_id){
$(hidden_element_id).style.display="none";
$(show_element_id).style.display="block";
}