function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function loaded(myimg,mywidth,myheight){
var tmp_img = new Image();
tmp_img.src=myimg.src;
image_x=tmp_img.width;
image_y=tmp_img.height;
	if(image_x > mywidth){//?赤?豕∩車車迆辰a?車
	tmp_img.height=image_y * mywidth / image_x;
	tmp_img.width=mywidth;
		if(tmp_img.height>myheight){
			tmp_img.width=tmp_img.width * myheight / tmp_img.height;
			tmp_img.height=myheight;
			}
	}else if(image_y > myheight)
	{//???豕∩車車迆辰a?車
	tmp_img.width=image_x * myheight / image_y;
	tmp_img.height=myheight;
		if(tmp_img.width>mywidth){
			tmp_img.height=tmp_img.height * mywidth / tmp_img.width;
			tmp_img.width=mywidth;
			}
	}
	myimg.width=tmp_img.width;
	myimg.height=tmp_img.height;

}

function checkFrm(theform,myid)
{
	switch(myid)
	{
	case 4:
		sogouGo(theform);
		//theform.action="http://www.163888.net/search/umusic.asp";
		break;
	case 3:
		theform.action="http://www.163888.net/search/bmusic.asp";
		break;
	case 0:
		theform.action="http://www.163888.net/search/ymusic.asp";
		break;
	case 5:
		gowhere(theform)
		//theform.action="http://www.163888.net/search/word.asp";
		break;
	case 2:
		theform.action="http://www.163888.net/search/user.asp";
		break;
	case 6:
		theform.action="http://www.163888.net/search/photo.asp";
		break;
	case 7:
		theform.action="http://www.163888.net/search/mov.asp";
		break;
	case 1:
		theform.action="http://www.163888.net/search/flash.asp";
		break;
	}
return true
}

function sogouGo(theform)
{
	if(theform.muname[2].checked==true)
	{
		theform.query.value = theform.sword.value;
		theform.target = "_blank";
 		theform.method = "get";
		theform.action="http://d.sogou.com/music.so";
	}
	else
	{
		theform.action="http://www.163888.net/search/umusic.asp";
	}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 var frmact = new Array();
 frmact[1]="http://www.baidu.com/s";
 frmact[5]="http://news.baidu.com/ns"
 frmact[3]="http://post.baidu.com/f";
 frmact[4]="http://mp3.baidu.com/m";
 frmact[6]="http://image.baidu.com/i";
 var frmtn = new Array();
 frmtn[1]="sitehao123";
 frmtn[5]="sitehao123";
 frmtn[3]="sitehao123";
 frmtn[4]="sitehao123";
 frmtn[6]="sitehao123";
 var frmct = new Array();
 frmct[1] = "134217728";
 frmct[5] = "134217728";
 frmct[3] = "134217728";
 frmct[4] = "134217728";
 frmct[6] = "201326592";
 var frmlm = new Array();
 frmlm[1] = "";
 frmlm[5] = "";
 frmlm[3] = "";
 frmlm[4] = "";
 frmlm[6] = "-1";
 var frmz = new Array();
 frmz[1] = "";
 frmz[5] = "";
 frmz[3] = "";
 frmz[4] = "";
 frmz[6] = "";
 var frmrn = new Array();
 frmrn[1] = "10";
 frmrn[5] = "";
 frmrn[3] = "";
 frmrn[4] = "";
 frmrn[6] = "";

 var bd_idx="1";

function bd_chg_idx(idx)
{
 bd_idx=idx;
}

function gowhere(formname)
{
 var url;
 var idx = bd_idx;
 if (frmact[idx] == null || frmact[idx] == ""){
 	idx = "1";}
 url = frmact[idx];
 if (frmtn[idx] != ""){
 	formname.tn.value = frmtn[idx];}
 if (frmct[idx] != ""){
 	formname.ct.value = frmct[idx];}
 if (frmlm[idx] != ""){
 	formname.lm.value = frmlm[idx];}
 if (frmz[idx] != ""){
 	formname.z.value = frmz[idx];}
 if (frmrn[idx] != ""){
 	formname.rn.value = frmrn[idx];}
 formname.kw.value = formname.sword.value;
 formname.word.value = formname.sword.value;
 formname.target = "_blank";
 formname.method = "get";
 formname.action = url;
 return true;
}




