function siweiopenwindows(theURL,winName,features) { //v2.0
        window.open(theURL,winName,features);
        return false;
}
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_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function NEW_goToURL(target,url) { //v3.0
        url = encodeURI(url);
        if (target=='_top'){
            parent.location=url;
        }else if (target=='_blank'){
            var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=550,height=430');
            newwin.location=url;
            newwin.focus();
        }else if (target=='_blank1'){
            var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=650,height=430');
            newwin.location=url;
            newwin.focus();
        }else if (target=='_blank2'){
            var newwin = window.open('','_blank','toolbar=1,location=1,status=1,menubar=1,scrollbars=1,resizable=1,left=0,top=0');
            newwin.location=url;
            newwin.focus();
        }else if (target=='_blank3'){
            var newwin = window.open('','_blank','scrollbars=no,resizable=no,left=0,top=0,width=790,height=550');
            newwin.location=url;
            newwin.focus();
        }else if (target=='chatroom'){
            var newwin = window.open('','searchWin','scrollbars=no,resizable=no,left=0,top=0,width=790,height=550');
            newwin.location=url;
            newwin.focus();
        }else if (target=='auction'){
            var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=800,height=600');
            newwin.location=url;
            newwin.focus();
        }else if (target=='small'){
            var newwin = window.open('','_blank','scrollbars=no,resizable=no,left=300,top=300,width=400,height=200');
            newwin.location=url;
            newwin.focus();
        }else{
            if (parent.frmaes != null){
                parent.frames(target).location=url;
            }else{
                this.location=url;
            }
        }
        return;

}
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;
}
 function siweiopenwindows(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
		return false;
}
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 checkAll(form) {
	var f = form;
	if(f == null) {
		f = document.getElementById("form1");
	}
	for(var i = 0 ; i < f.elements.length ; i++) {
		if (f.elements[i].type=="checkbox" && !f.elements[i].disabled) {
			f.elements[i].checked = true;			
		}
	}
}
function cancelAll(form) {
	var f = form;
	if(f == null) {
		f = document.getElementById("form1");
	}
	for(var i = 0 ; i < f.elements.length ; i++) {
		if (f.elements[i].type=="checkbox" && !f.elements[i].disabled) {
			f.elements[i].checked = false;			
		}
	}
}
 function selectAll(c,form) {
 		var f = form;
 		if(f == null) {
			f = document.getElementById("form1");
 		}
		for(var i = 0 ; i < f.elements.length ; i++) {
			if (f.elements[i].type=="checkbox" && !f.elements[i].disabled) {
				c.checked ? f.elements[i].checked = true : f.elements[i].checked = false;				
			}
		}
 }
 function checkChoose(form) {
  	  var f = form;
 	  if(f == null) {
		  f = document.getElementById("form1");
 	  } 	  
 	  for(var i = 0 ; i < f.elements.length ; i ++) {
			if (f.elements[i].type == "checkbox" && f.elements[i].value != "checkbox" && f.elements[i].name != "checkbox2") {				
				if(f.elements[i].checked == true) {
					return true;
				} 
			}
		}		
		return false;
}
function DrawImage(ImgD){
  		 var image=new Image();
  		 image.src=ImgD.src;
 		  if(image.width>0 && image.height>0){
     	  if(image.width/image.height>= 1){
      	  if(image.width>200){  
          ImgD.width=200;
          ImgD.height=(image.height*200)/image.width;
         }else{
          ImgD.width=image.width;  
          ImgD.height=image.height;
          }
           ImgD.alt=image.width+"?"+image.height;
        }
        else{
           if(image.height>200){  
              ImgD.height=200;
              ImgD.width=(image.width*200)/image.height;     
            }else{
              ImgD.width=image.width;  
              ImgD.height=image.height;
            }
              ImgD.alt=image.width+"?"+image.height;
          }
         }
}
//??????????????????????false????????????
function CheckRadio(theRadio){
    var theRadioLen = theRadio.length;
    var theRadioValue = false;
    if (theRadioLen == undefined){
        if (theRadio.checked){
            theRadioValue = theRadio.value;
        }
    }else{
        for (theRadioI=0;theRadioI<theRadioLen;theRadioI++){
            if (theRadio[theRadioI].checked){
                theRadioValue = theRadio[theRadioI].value;
                break;
            }
        }
    }
    return theRadioValue;
}

