﻿function isobj(id){if(typeof(id)=="object"){return true;}else{return false;}}
function getid(id){if(isobj(id)){return id;}else{return document.getElementById(id);}}$=getid;  
function menuitemclass(o,type)
{
    var classname=type==1?"item1":"item";
    o=getid(o);
    o.className=classname;
}
function tourl(url)
{
    location.href=url;
}
function setimagesize(ImgD,width,height)
{ 
var image=new Image();
image.src=getid(ImgD).src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= width/height){
if(image.width>width){  
ImgD.width=width;
ImgD.height=(image.height*width)/image.width;
}else{
ImgD.width=image.width;  
ImgD.height=image.height;
}
}else{
if(image.height>height){  
ImgD.height=height;
ImgD.width=(image.width*height)/image.height;     
}else{
ImgD.width=image.width;  
ImgD.height=image.height;
}
}
}
}





