/*按比例生成缩略图*/
function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){  
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){  
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;     
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
  }
} 

function show(target){
	var obj=new Array("Menu0","Menu1","Menu2","Menu3","Menu4","Menu5","Menu6","Menu7");
	for(i=0;i<8;i++){
		if(i!=target)
			document.getElementById(obj[i]).style.display="none";
		else
			document.getElementById(obj[i]).style.display="";
	}
	
}

function chkLeague(){
	if(from_League.Name.value==""){
		alert("申请人姓名不能为空");
		return false;
	}
	if(from_League.Tel.value==""){
		alert("电话不能为空");
		return false;
	}
	if(from_League.Mobile.value==""){
		alert("手机不能为空");
		return false;
	}	
	if(from_League.Area.value==""){
		alert("拟投规模不能为空");
		return false;
	}	
	if(from_League.Fund.value==""){
		alert("拟投资金不能为空");
		return false;
	}
	if(from_League.Environment.value==""){
		alert("周围商业环境不能为空");
		return false;
	}
	if(from_League.PlanTime.value==""){
		alert("计划何时加盟不能为空");
		return false;
	}
	if(from_League.Sales.value==""){
		alert("经营性质不能为空");
		return false;
	}
	if(from_League.Mobile.value.length!=11){
		alert("手机长度有误,请查明后正确填写!");
		return false;
	}
	return true;
}

