
//修改跳转代码
//网站域名分布
var htmadmin="http://www.rmhappy.com/"
var aspdomain="http://asp.rmhappy.com/"
var sqldomain="sql.rmhappy.com"
var sitename="人民音乐网";
var playwidth=468;

//wma域名分布
var wmaserver=new Array();
wmaserver[0]="http://wma.rmhappy.com/";



var dom=(document.domain).toLowerCase();

var turl=(document.URL).toLowerCase();
var odom="www.rmhappy.com";
var rdom="www.rmhappy.com";

//检查来自哪个会员推荐
if(dom.indexOf(".vip.rmhappy.com")!=-1)
{
var user=dom;
user=user.replace("www.","");
user=user.replace(".vip.rmhappy.com","");
window.open(aspdomain+"SetUpUser.asp?user="+user+"&url="+escape(turl.replace(dom,rdom)),"_self");
}
else if((dom.indexOf(odom)==-1 || dom==odom)&& dom!="asp.rmhappy.com" && dom!="www.rmhappy.com")
{
window.open(turl.replace(dom,rdom),"_self");
}


function Wmaplay(id){
id=eval("document.musiclistform.checked_"+id+".value");
Jsopen(htmadmin+'yxplay.htm?checked=,'+id,'rmhappy', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+playwidth+',height=320,top=200,left=200');
} 

function Wmaplayindex(t,id){

id=eval("document." + t + ".checked_" + id + ".value");
Jsopen(htmadmin+'yxplay.htm?checked=,'+id,'rmhappy', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+playwidth+',height=320,top=200,left=200');
} 


function Allplay(url){
Jsopen(htmadmin+'rmplay.htm?'+url,'rmhappy', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+playwidth+',height=314,top=200,left=200');
} 

function Wmaplay1(id){
Jsopen(htmadmin+'yxplay.htm?checked=,'+id,'rmhappy', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+playwidth+',height=320,top=200,left=200');
} 

function rmhappy(the)
{
var id="?checked=";
for (var i=0;i<the.elements.length;i++)
{
var e = the.elements[i];
if (e.type == 'checkbox')
if(e.checked)
if(!e.disabled)
if(id.length + e.value.length<800)
{
id+=","+e.value;
}
else
{
if(!confirm("所选择的歌曲太多！\n\n所选曲目中只有 《"+eval(e.value.split(",")[1])+ "》之前的曲目被选中\n\n重新选择还是马上试听！"))
{
return false;
}

break;
}
}
if(id!="?checked=")
{
Jsopen(htmadmin+"yxplay.htm"+id,"rmhappy","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=200,left=200,width="+playwidth+",height=320");
}
else
{
alert("没有所选择可以视听的歌曲！");
}
return false;
}

function CheckOthers(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
			if(e.value!=""){e.checked=!e.checked}
	}
}

function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if(e.value!=""){e.checked = true;}
	}
}

function Jsopen(a,b,c)
{
window.open(a,b,c);
}

function sms(key)
{
Jsopen("http://cn4.ijcool.com/ijcool/searchBlue/searchByTitleBlue.jsp?agentId=3793&channelid=null&linkid=null&music_title="+key,"ijcool","left=0,top=0,scrollbars=1,resizable=0,width=800,height=600,menubar=0");
}

function dsong(id)
{
Jsopen(htmadmin+"yxdown.htm?id="+id,"dsong","scrollbars=no,resizable=no,width=510,height=184,menubar=no,top=98,left=198")
}

function msong(key)
{
Jsopen("http://fs.tom.com/sms/ivr/search_ivr_song.php?user_id=84479&code_id=w555&keyword="+key+"&inc=2","tom","left=0,top=0,scrollbars=1,resizable=0,width=800,height=500,menubar=0");
}

function mspecial(id)
{
Jsopen(htmadmin+"Mailalbum.asp?id="+id,"mspecial","scrollbars=no,resizable=no,width=419,height=151,menubar=no,top=98,left=198")
}


function aspsearchformcheck(the)
{
if(the.keyword.value!='请输入关键字'){
window.open(the.stype.value+the.keyword.value,'_self');
}
else{
alert('请输入查询关键词');
}
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//飘浮广告类
function GgClass(){ 
 var objName=""; 
 var imageType=0; 
 var imageWidth=imageHeight=0; 
 var iTop=iLeft=0; 
 var topFlag=leftFlag=false; 
 var divID=0,objDiv=null; 
 var offWidth=offHeight=0; 
 var width=document.body.clientWidth; 
 var height=document.body.clientHeight; 
 var delay=30;    var topStep=2,leftStep=3;     var inter; 
 var FloatType=0;
 var FloatPosition=0;
 var toLR=0;
 var toTB=0;
 divID=Math.round(Math.random()*100000) 
 
 this.setImageType=function(sType){ 
   imageType=sType; 
 } 
 
 this.setFloatType=function(fix){
  FloatType=fix;
 }

 this.setFloatPosition=function(pos){
  FloatPosition=pos;
 }

 this.setLRTB=function(lr,tb){
 toLR=lr;
 toTB=tb;
 }

 this.setObjName=function(sName){objName=sName;} 
 
 this.setImagePX=function(iWidth,iHeight){ 
   if(!isNaN(iWidth)){ 
      imageWidth=iWidth; 
   }else{ 
      imageWidth=0; 
   } 
   if(!isNaN(iHeight)){ 
      imageHeight=iHeight; 
   }else{ 
      imageHeight=0; 
   } 
 } 
 
 this.setDivID=function(iDiv){divID=iDiv;} 
  
    
 this.showGg=function(adImgSrc,adHref,adTitle){ 

    if(imageType==0){ 
       showImageHtml(adImgSrc,adHref,adTitle); 
    }else{ 
       showFlashHtml(adImgSrc,adHref,adTitle); 
    } 

    eval("objDiv=document.all.img"+divID+";"); 
     
    offWidth=objDiv.offsetWidth; 
    offHeight=objDiv.offsetHeight; 
    
    iLeft=Math.round(Math.random()*(width-offWidth)); 
    iTop=Math.round(Math.random()*(height-offHeight)); 
    objDiv.style.pixelLeft=iLeft; 
    objDiv.style.pixelTop=iTop; 

 } 

 this.floatScroll=function(){ 
    if(FloatType==1){
	if(FloatPosition==0){
	    objDiv.style.pixelLeft = toLR + document.body.scrollLeft; 
	    objDiv.style.pixelTop = document.body.scrollTop+document.body.offsetHeight-toTB; 
	}
	else{
	    objDiv.style.pixelLeft = document.body.scrollLeft+document.body.offsetWidth-toLR; 
	    objDiv.style.pixelTop = document.body.scrollTop+document.body.offsetHeight-toTB;
	}
    }
    else
    {
    var iRnd; 
    iRnd=Math.round(Math.random()*100);  
    if(objDiv==null)return; 
    objDiv.style.pixelLeft = iLeft + document.body.scrollLeft; 
    objDiv.style.pixelTop = iTop + document.body.scrollTop; 

    if(iRnd>98){leftFlag=!leftFlag;} 
    iRnd=Math.round(Math.random()*100); 
    if(iRnd>99){topFlag=!topFlag;} 
    if(leftFlag){ 
       iLeft=iLeft+leftStep*Math.random(); 
    }else{ 
       iLeft=iLeft-leftStep*Math.random(); 
    } 
    if(topFlag){ 
       iTop=iTop+topStep*Math.random(); 
    }else{ 
       iTop=iTop-topStep*Math.random(); 
    } 
    if(iLeft<0){ 
       iLeft=0; 
    leftFlag=true; 
     } 
    else if(iLeft>width-offWidth){ 
       iLeft=width-offWidth; 
    leftFlag=false; 
    } 
    if(iTop<0){ 
       iTop=0; 
    topFlag=true; 
     } 
    else if(iTop>height-offHeight){ 
       iTop=height-offHeight; 
    topFlag=false; 
    } 
   }
 } 

 function startTimer(){ 
    if(objName=="")return; 
  } 

 function showImageHtml(adImgSrc,adHref,adTitle){ 
   var sWidth,sHeight; 
   if(imageWidth<5){ 
     sWidth=""; 
   }else{ 
     sWidth=" width='"+imageWidth+"'"; 
   } 
   if(imageHeight<5){ 
     sHeight=""; 
   }else{ 
     sHeight=" height='"+imageHeight+"'"; 
   } 
   document.write("<div id='img"+divID+"' style='position:absolute;'>"); 
   document.write("<a href='"+adHref+"' target='_blank' title='"+adTitle+"'>"); 
   document.write("<img src='"+adImgSrc+"' border='0'"+sWidth+sHeight+">"); 
   document.write("</a></div>"); 
 } 

 function showFlashHtml(adImgSrc,adHref,adTitle){ 
   var sWidth,sHeight; 
   if(imageWidth<5){ 
     sWidth=" width='80'"; 
   }else{ 
     sWidth=" width='"+imageWidth+"'"; 
   } 
   if(imageHeight<5){ 
     sHeight=" height='80'"; 
   }else{ 
     sHeight=" height='"+imageHeight+"'"; 
   } 
   document.write("<div id='img"+divID+"' style='position:absolute;'>"); 
   document.write("<a href='"+adHref+"' target='_blank' title='"+adTitle+"'>"); 
   document.write("<object  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'"+sWidth+sHeight+" align='middle'>"); 
   document.write("<param name='movie' value='"+adImgSrc+"'>"); 
   document.write("<param name='quality' value='high'>"); 
   document.write("<embed src='"+adImgSrc+"'"+sWidth+sHeight+" quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>"); 
   document.write("</a></div>"); 
    } 
}
