
// Shrink Img

function Img(im)
{
	ImgCls.Obj = ( im && typeof im == 'object' ) ? im : document.getElementById(im) ;
	return ImgCls ;
	}
	var ImgCls =
	{
	Obj : null ,

	Resize : function ( nWidth , nHeight )
	{
		var w , h , p1 , p2 ;
		p1 = nWidth / nHeight ;
		p2 = ImgCls.Obj.width / ImgCls.Obj.height ;

		w = 0 ; h = 0 ;
		if( p1 < p2 )
		{
			w = nWidth ;
			h = nWidth * ( 1 / p2 ) ;
		}
		else
		{
			h = nHeight ;
			w = nHeight * p2 ;
		}
		ImgCls.Obj.width  = w ;
		ImgCls.Obj.height = h ;
	}
	//<img  src="url" onload="Img(this).Resize(width,height);" />
}

// callFlash

function CallSWF(strURL,nWidth,nHeight,strBkColor,strID,strAlignMode,strQuality,strFlashVars)
{
	var embedTxt;
	embedTxt = "<embed";
	if (strURL==null)
	{
	return;
	}
	embedTxt += ' src="'+strURL+'"';
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
	if (nHeight)
	{
	document.write(' height="'+nHeight+'"');
	embedTxt += ' height="'+nHeight+'"';
	}
	if (nWidth)
	{
	document.write(' width="'+nWidth+'"');
	embedTxt += ' width="'+nWidth+'"';
	}
	if (strID)
	{ 
	document.write(' id="'+strID+'"');
	embedTxt += ' name="'+strID+'"';
	}
	if (strAlignMode)
	{
	document.write(' align="'+strAlignMode+'"');
	embedTxt += ' align="'+strAlignMode+'"';
	} 
	document.write('>');
	document.writeln('<param name="menu" value="false">');
	document.writeln('<param name="WMode" value="Transparent">');
	document.writeln('<param name="WMode" value="opaque">'); 
	embedTxt += ' menu="false"';
	document.writeln('<param name="allowScriptAccess" value="always" />');
	embedTxt += ' allowScriptAccess="always"';
	if (strFlashVars)
	{
	document.writeln('<PARAM NAME=FlashVars VALUE="'+strFlashVars+'">');
	embedTxt += ' FlashVars="'+strFlashVars+'"';
	} 
	document.writeln('<param name="movie" value="'+strURL+'" />');
	if (strQuality)
	{
	document.writeln('<param name="quality" value="'+strQuality+'" />');
	embedTxt += ' quality="'+strQuality+'"';
	}
	else
	{
	document.writeln('<param name="quality" value="High" />');
	embedTxt += ' quality="High"';
	}
	if (strBkColor)
	{
	document.writeln('<param name="bgcolor" value="'+strBkColor+'" />');
	embedTxt += ' bgcolor="'+strBkColor+'"';
	}
	embedTxt += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" swLiveConnect="true" ></embed>';
	document.writeln(embedTxt);
	document.writeln('</object>');
	//<SCRIPT language=javascript type=text/javascript>flash('url','width','height');</SCRIPT>
	}

// callObject

function obj(id)
{
	return document.getElementById(id);
	}

//show&hide Area

function sAe(id)
{
	obj(id).className="Show";
	}
function hAe(id)
{
	obj(id).className="Hide";
	}

// slideTag

function sTag(n)
{
	for(var i=1;i<=2;i++)
	{
		obj('tag'+i).className="overTag";
		obj('tagAe'+i).className='Hide';
		}
		obj('tag'+n).className="outTag";
		obj('tagAe'+n).className='Show';
		}

// PNG FOR IE6.0

// Feedback 

function VerifyFeedback()
{
if (document.feedback.data_Title.value == "")
	{
	alert("留言主题是必须输入的");
	document.feedback.data_Title.focus();
	return false;
	}
if (document.feedback.data_Author.value == "")
	{
	alert("请输入您的姓名");
	document.feedback.data_Author.focus();
	return false;
	}
if (document.feedback.data_Tel.value == "")
	{
	alert("请输入您的电话");
	document.feedback.data_Tel.focus();
	return false;
	}
if (document.feedback.data_Email.value == "")
	{
	alert("请输入您的邮箱地址");
	document.feedback.data_Email.focus();
	return false;
	}
if (document.feedback.data_Content.value == "")
	{
	alert("请输入您的留言内容");
	document.feedback.data_Content.focus();
	return false;
	}
}

// Order
 
 function VerifyOrder()
{
if (document.order.data_User.value == "")
	{
	alert("请输入您的名字");
	document.order.data_User.focus();
	return false;
	}
if (document.order.data_Address.value == "")
	{
	alert("请输入您的地址");
	document.order.data_Address.focus();
	return false;
	}
if (document.order.data_Company.value == "")
	{
	alert("请输入您的公司名称");
	document.order.data_Company.focus();
	return false;
	}
if (document.order.data_E-mail.value == "")
	{
	alert("请输入您的电子邮件");
	document.order.data_E-mail.focus();
	return false;
	}
if (document.order.data_Product.value == "")
	{
	alert("请输入您订购的货品");
	document.order.data_Product.focus();
	return false;
	}
}

function DrawImage(ImgD,FitWidth,FitHeight){     
	var image=new Image();     
	image.src=ImgD.src;     
	if(image.width>0 && image.height>0){         
		if(image.width/image.height>= FitWidth/FitHeight){             
			if(image.width>FitWidth){                 
				ImgD.width=FitWidth;                 
				ImgD.height=(image.height*FitWidth)/image.width;             
				}else{                 
					ImgD.width=image.width;                 
					ImgD.height=image.height;             
				}         
			} else{             
				if(image.height>FitHeight){                 
					ImgD.height=FitHeight;                 
					ImgD.width=(image.width*FitHeight)/image.height;             
				}else{                 
					ImgD.width=image.width;                 
					ImgD.height=image.height;             
				}         
			}     
		} 
	} 
