// JavaScript Document
function $(id){return document.getElementById(id);}
//初始化脚本
//插入可加链接Flash函数
function insertFlash(elm, url, w, h, id) {
 if (!document.getElementById(elm)) return;
 var str = '';
 str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" id='+id+'></embed>';
 document.getElementById(elm).innerHTML = str;
}
function insertImgFlash(elm,fls, url, w, h, id) {
	document.write("<div style='position:relative; visibility:visible; width:"+ w +"px;height:"+ h +"px;'> ");
	document.write("<div style='position:absolute; z-index:2; width:"+ w +"px; height:"+ h +"px; top:0px; left:0px; visibility: visible;'> ");
	document.write("<a href='"+ url +"' target='_blank'><img src='http://mat1.gtimg.com/cq/qx/dj/sys/blank.gif' width='"+ w +"' height='"+ h +"' border='0'></a>"); 
	document.write("</div>");
	document.write("<div id='"+ elm +"'></div>");
	document.write("</div>");
	insertFlash(elm,fls,w,h)
}
//设置图片自适应大小
function SetImgAutoSize(objId,MaxWidth,MaxHeight) 
{ 
	var img=$(objId);//获取图片
	var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比
	var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高比
	//if(img.readyState!="complete")return false;//确保图片完全加载 
	if(img.offsetWidth>MaxWidth){
		img.width=MaxWidth;
		img.height=MaxWidth*HeightWidth;
	}
	if(img.offsetHeight>MaxHeight){
		img.height=MaxHeight;
		img.width=MaxHeight*WidthHeight;
	}
} /*  |xGv00|9c435c9d8f17ef0c6fed4803377dd93e */
