function AutoResizeImage(obj, width, height){ var img = new Image(); img.src = obj.src; var scale = Math.max(width / img.width, height / img.height); var newWidth = img.width * scale; var newHeight = img.height * scale; var div = obj.parentNode; obj.width = newWidth; obj.height = newHeight; div.style.width = width + "px"; div.style.height = height + "px"; div.style.overflow = "hidden"; //obj.style.marginLeft = (width - newWidth) / 2 + "px"; obj.style.marginTop = (height - newHeight) / 2 + "px"; } function Wa_SetImgAutoSize(obj, width, height){ var img=obj; var MaxWidth=width;//璁剧疆鍥剧墖瀹藉害鐣岄檺 var MaxHeight=height;//璁剧疆鍥剧墖楂樺害鐣岄檺 // 鑾峰緱鍥剧墖鐪熷疄澶у皬锛屾敞鎰忕敤瀹屽悗缃负绌 var image_temp=new Image(); image_temp.src= img.src; width_temp=image_temp.width; height_temp=image_temp.height; image_temp=null; var HeightWidth=height_temp/width_temp;//璁剧疆楂樺姣 var WidthHeight=width_temp/height_temp;//璁剧疆瀹介珮姣 if(width_temp>height_temp){ $(obj).css("width",MaxWidth+"px"); $(obj).css("height",Math.floor(MaxWidth*HeightWidth)+"px"); }else{ $(obj).css("width",Math.floor(MaxHeight*WidthHeight)+"px"); $(obj).css("height",MaxHeight+"px"); } } function setXaosTab(name, curr, n) { for (i = 1; i <= n; i++) { var menuli = document.getElementById(name + i); var contli = document.getElementById("con_" + name + "_" + i); menuli.className = i == curr ? "current" : ""; if (i == curr) { contli.style.display = "block"; } else { contli.style.display = "none"; } } } //鏂伴椈鍒楄〃 $("#news a").hover(function(){ $(this).find(".t").css("color","#fff"); $(this).find(".t strong").css("color","#fff"); $(this).find(".t_animate").stop().animate({'width':'70px'},500,"easeOutExpo"); } ,function(){ $(this).find(".t").css("color","#999"); $(this).find(".t strong").css("color","#ff8810"); $(this).find(".t_animate").stop().animate({'width':'0px'},500,"easeOutExpo"); }); //鎷涜仒鍒楄〃 $("#jobs a").hover(function(){ $(this).find(".view").css("background-color","#ff8810"); $(this).find(".view").stop().animate({'width':'60px'},500,"easeOutExpo"); } ,function(){ $(this).find(".view").css("background-color","#ccc"); $(this).find(".view").stop().animate({'width':'35px'},500,"easeOutExpo"); }); //璁句负棣栭〉 function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try{ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }catch(e){ alert("鎶辨瓑锛屾鎿嶄綔琚祻瑙堝櫒鎷掔粷锛乗n\n璇峰湪娴忚鍣ㄥ湴鍧€鏍忚緭鍏モ€渁bout:config鈥濆苟鍥炶溅鐒跺悗灏哰signed.applets.codebase_principal_support]璁剧疆涓?true'"); } }else{ alert("鎶辨瓑锛屾偍鎵€浣跨敤鐨勬祻瑙堝櫒鏃犳硶瀹屾垚姝ゆ搷浣溿€俓n\n鎮ㄩ渶瑕佹墜鍔ㄥ皢銆?+url+"銆戣缃负棣栭〉銆?); } } } //鏀惰棌鏈珯 function AddFavorite(title, url) { try { window.external.addFavorite(url, title); } catch (e) { try { window.sidebar.addPanel(title, url, ""); } catch (e) { alert("鎶辨瓑锛屾偍鎵€浣跨敤鐨勬祻瑙堝櫒鏃犳硶瀹屾垚姝ゆ搷浣溿€俓n\n鍔犲叆鏀惰棌澶辫触锛岃浣跨敤Ctrl+D杩涜娣诲姞"); } } }