// JavaScript Document
function ShowNav(obj){
	//k(obj).style.lineheight="28px";
	//document.getElementById("Nav_"+obj).style.display="block";
	document.getElementById("Nav_"+obj).style.backgroundImage="url(img/nav_right.jpg)";
	document.getElementById("Nav_"+obj).style.backgroundPosition="right";
	document.getElementById("Nav_"+obj).style.backgroundRepeat="no-repeat";
	
	document.getElementById("Nav2_"+obj).style.backgroundImage="url(img/nav_left.jpg)";
	document.getElementById("Nav2_"+obj).style.backgroundPosition="left";
	document.getElementById("Nav2_"+obj).style.backgroundRepeat="no-repeat";
	document.getElementById("Nav2_"+obj).style.color="#EC5F00";
}

function showHidden(strIndex){
	var obj=document.getElementById(strIndex);
	if (obj.style.display =='none'){
		obj.style.display="block";
	}else{
		obj.style.display="none";
	}
}	

function Manage()
{
	var Obj=document.myform
	if(Obj.Subject.value == "" ) 
		{
			alert("Please fill in your message theme!");
			Obj.Subject.focus();
			return false;
		}
	if(Obj.Content.value == "" ) 
		{
			alert("Please fill in your message content!");
			Obj.Content.focus();
			return false;
		}
	if(Obj.Name.value == "" ) 
		{
			alert("Please fill in your name!");
			Obj.Name.focus();
			return false;
		}
	if(Obj.Email.value=="") 
		{
			alert("Please fill in your Email!");
			Obj.Email.focus();
			return false;
		}

}

function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    }
} 
