var $=g=function(obj){return (typeof(obj)=='string')?document.getElementById(obj):obj;}
var show=function(obj){ $(obj).style.display='block';};
var hide=function(obj){ $(obj).style.display='none';};
var jh=function(obj){ $(obj).style.display=($(obj).style.display=='block')?'none':'block';};
var $cc=function(n,v){if(v){$(n).className=v;}else{return $(n).className;};};

/*按比例生成缩略图*/
var flag=false; 
function DrawImage(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= 380/380){ 
   if(image.width>380){
    ImgD.width=380; 
    ImgD.height=(image.height*380)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
  else{ 
   if(image.height>380){
    ImgD.height=380; 
    ImgD.width=(image.width*380)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}
function setCookie(name,value){var Days = 30;var exp  = new Date();exp.setTime(exp.getTime() + Days*24*60*60*1000);if(getCookie(name)!=null){document.cookie = name + "="+getCookie(name)+"|" +escape(value) +";expires="+ exp.toGMTString();}else{document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString();};}
function getCookie(name){var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));if(arr != null)return unescape(arr[2]);return null;}
function delCookie(name){var exp = new Date();exp.setTime(exp.getTime() - 1);var cval=getCookie(name);if(cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();}

function g(v)
{
	return document.getElementById(v);
}

function swf(url,w,h,id,isAlpha)
{
	if(isAlpha==1)
	{
		alphaParam = '<param name="wmode" value="transparent">';
		embedParam = ' wmode="transparent" ';
		scaleS = '';
		scaleO = '';
	}
	else if(isAlpha==0)
	{
		alphaParam = '<param name="wmode" value="transparent">';
		embedParam = ' wmode="transparent" ';
		scaleS = '<param name="scale" value="ExactFit">';
		//scaleS = '<param name="scale" value="NoBorder">';
		scaleO = ' scale="ExactFit" ';
		//scaleO = ' scale="NoBorder" ';
	}
	else
	{
		alphaParam = '';
		embedParam = '';
		scaleS = '';
		scaleO = ' ';
	}
	document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="' + id + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="' + w + '" height="' + h + '">' +
		'				<param name="movie" value="' + url + '">' +
		'				<param name="quality" value="High">' +
		'				<param name="menu" value="false">' + scaleS +
		alphaParam +
		'				<embed src="' + url + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="' + id + '" width="' + w + '" height="' + h + '" quality="High" menu="false" '+embedParam + scaleO + '></object>' +
	'');
}
var g=function(v){return (typeof(v)=='string')?document.getElementById(v):v;}
function showMenu(n)
{
	g('secMenu'+n).style.display=(g('secMenu'+n).style.display=='none')?'visible':'none';
}
var n=1;
function rndBanner()
{

	if(getCookie("curnum")!=null && typeof(isProduct)!='undefined')n=getCookie("curnum");
	if(getCookie("curnav")!=null)g('nav'+getCookie("curnav")).className='cur';
	
	delCookie("curnav");delCookie("curnum");
}
window.onload=rndBanner;
function killErr()
{
	return true;
}
window.onerror=killErr;

function chgbg(vv)
{
	setCookie("curnum",vv);
}
function setNav($b,$u)
{
	delCookie("curnav");setCookie("curnav",$b);location.href=$u;
}
