function LoadFlash(url,wmode,width,Height,param)
{ 
document.write(
  '<embed src="' + url + '" FlashVars="'+param+'" wmode=' + wmode +
  ' quality="high" pluginspage=http://www.macromedia.com/go/getflashplayer type="application/x-shockwave-flash" width="' + width + 
  '" height="' + Height + '"></embed>');   
}


function resizepic(o)
{ 
var maxwidth=670;   //定义最大宽度
var maxheight=800;  //定义最大高度
var a=new Image();
a.src=o.src
if(a.width > maxwidth)
{
  o.style.width=maxwidth;
}
if (a.height> maxheight)
{
  o.style.height=maxheight;
 }
}
//无级缩放图片大小
function bbimg(o)
{;}

var flag=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;
}
}
else{
if(image.height>iheight){ 
ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
}

function tabit(btn, n){
	var idname = new String(btn.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_") + 1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 2));
	for (i=0; i<n; i++){
		document.getElementById(tabName + "_div_" + i).style.display = "none"; 
		document.getElementById(tabName + "_btn_" + i).className = '';
	}
	document.getElementById(tabName+"_div_"+id).style.display = "block"; 
	btn.className = "curr";
}
function xmlhttp()
{
	var A=null;
	try
	{
		A=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			A=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			if (typeof XMLHttpRequest != "undefined" );
			{
				A=new XMLHttpRequest();
			}
		}
	}			
	return A;
}


function getAjax(obj,url)
		{
						   var oXmlHttp = xmlhttp();
							//obj.innerHTML = "<div align='center'>加载中...</div>";
							try
							{
								oXmlHttp.open("GET", url, true);
								oXmlHttp.onreadystatechange = function(){
									if(oXmlHttp.readyState==4)
									if(oXmlHttp.status==200)
								obj.innerHTML=oXmlHttp.responseText;
								}
								oXmlHttp.send(null);
							} catch (e) {
							}
		}

function correctPNG()
{
  for(var i=0; i<document.images.length; i++)
  {
   var img = document.images[i]
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
   {
   var imgID = (img.id) ? "id='" + img.id + "' " : ""
   var imgClass = (img.className) ? "class='" + img.className + "' " : ""
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
   var imgStyle = "display:inline-block;" + img.style.cssText
   if (img.align == "left") imgStyle = "float:left;" + imgStyle
   if (img.align == "right") imgStyle = "float:right;" + imgStyle
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
   img.outerHTML = strNewHTML
   i = i-1
   };
  };
};
if(navigator.userAgent.indexOf("MSIE")>-1)
{
window.attachEvent("onload", correctPNG);
};
