function ChangeMenuColor(sid,mid)
{var color;
color="";
if(mid==1){
switch(sid){   
  case 1:color="#FF0000";break;   
  case 2:color="#06B5EA";break;   
  case 3:color="#DA58A0";break;
  case 4:color="#FFA30A";break;
  case 5:color="#A4B400";break;
  case 6:color="#6FB63C";break;
  case 7:color="#F26A40";break;
  case 8:color="#BFC024";break;
  case 9:color="#834EB8";break;  
  default:color="#8A8B8F";   
  }
}
document.getElementById("menu"+sid).style.backgroundColor=color;
}
function newPlay(mid,bid,jid)
{playname =  window.open('Job.asp?Menu='+mid+'&Class='+bid+'&JobID='+jid,'play','top=100,left=100,width=650,height=500,resizable=1,scrollbars=yes,status=no,toolbar=no,location=no,menu=no');
	if(playname && playname.open && !playname.closed)
		playname.focus();
}
function DrawImage(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width>=518){ 
			ImgD.width=518; 
			ImgD.height=(image.height*518)/image.width; 
		}else{ 
			ImgD.width=image.width; 
			ImgD.height=image.height; 
		}  
	} 
}

function DrawImage150(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width>=150){ 
		if(((image.height*150)/image.width)>=120){ 
			ImgD.height=120; 
			ImgD.width=(image.width*120)/image.height; 
		}else{ImgD.width=150; 
			ImgD.height=(image.height*150)/image.width;}		
		}else{
		if(image.height>=120){
		ImgD.height=120; 
			ImgD.width=(image.width*120)/image.height; 
		}else{
			ImgD.width=image.width; 
			ImgD.height=image.height;} 
		}
		
	} 
}

function DrawImage160(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width>=160){ 
		if(((image.height*160)/image.width)>=130){ 
			ImgD.height=130; 
			ImgD.width=(image.width*130)/image.height; 
		}else{ImgD.width=160; 
			ImgD.height=(image.height*160)/image.width;}		
		}else{
		if(image.height>=130){
		ImgD.height=130; 
			ImgD.width=(image.width*130)/image.height; 
		}else{
			ImgD.width=image.width; 
			ImgD.height=image.height;} 
		}
		
	} 
}

function DrawImage220(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width>=220){ 
		if(((image.height*220)/image.width)>=180){ 
			ImgD.height=180; 
			ImgD.width=(image.width*180)/image.height; 
		}else{ImgD.width=220; 
			ImgD.height=(image.height*220)/image.width;}		
		}else{
		if(image.height>=180){
		ImgD.height=180; 
			ImgD.width=(image.width*180)/image.height; 
		}else{
			ImgD.width=image.width; 
			ImgD.height=image.height;} 
		}
		
	} 
}

function DrawImage200(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width>=200){ 
		if(((image.height*200)/image.width)>=150){ 
			ImgD.height=150; 
			ImgD.width=(image.width*150)/image.height; 
		}else{ImgD.width=200; 
			ImgD.height=(image.height*200)/image.width;}		
		}else{
		if(image.height>=150){
		ImgD.height=150; 
			ImgD.width=(image.width*150)/image.height; 
		}else{
			ImgD.width=image.width; 
			ImgD.height=image.height;} 
		}
		
	} 
}

function DrawImage228(ImgD){ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		//flag=true; 
		if(image.width>=228){ 
		if(((image.height*228)/image.width)>=185){ 
			ImgD.height=185; 
			ImgD.width=(image.width*185)/image.height; 
		}else{ImgD.width=228; 
			ImgD.height=(image.height*228)/image.width;}
		}else{
		if(image.height>=185){
		ImgD.height=185; 
			ImgD.width=(image.width*185)/image.height; 
		}else{
			ImgD.width=image.width; 
			ImgD.height=image.height;} 
		}
		
	} 
}

function chgNews(id){
var i;
for(i=1;i<4;i++){
document.getElementById("news"+i).className="bottom_black_line";
document.getElementById("submenu"+i).style.display="none";
}
document.getElementById("news"+id).className="bottom_red_line";
document.getElementById("submenu"+id).style.display="block";
}
