function JSAddFavorite()
{
        if ( window.sidebar && "object" == typeof( window.sidebar ) && "function" == typeof( window.sidebar.addPanel ) )
        {
                //  firefox
                window.sidebar.addPanel( '纱迦视觉摄影机构', 'http://www.sagaphoto.cn/', '' );
        }
        else if ( document.all && "object" == typeof( window.external ) )
        {
                //  ie
                window.external.addFavorite( 'http://www.sagaphoto.cn/', '纱迦视觉摄影机构' );
        }
}
function MenuTab2(total,num,name)
{
	for(i=1;i<=total;i++)
	{
		id = document.getElementById(name + i);
		
		if(i == num)
		{
			id.src = "/Templates/default/images/0"+i+"a.jpg";
		}
		else
		{
			id.src = "/Templates/default/images/0"+i+".jpg";
		}
	}
}

function MenuTab(total,num,name,name2)
{
	for(i=0;i<total;i++)
	{
		id = document.getElementById(name + i);
		id2 = document.getElementById(name2 + i);
		
		if(i == num)
		{
			id.style.display = "block";
			id2.src = "/Templates/default/images/cca1.jpg";
		}
		else
		{
id.style.display = "none";
id2.src = "/Templates/default/images/cca2.jpg";
}
}
}
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
          }
       }
    }
function getFlashObject(flashSrc, objWidth, objHeight, etcParam) {
	var tag = "";
	var baseFlashDir="";
	flashSrc = baseFlashDir + flashSrc;
	if ( etcParam != "" || etcParam != null ) {
		if ( etcParam.substr(0, 1) == "?" )
			flashSrc += etcParam;
		else
			flashSrc += "?" + etcParam;
	}
	tag += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
	tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
	tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
	tag += "<param name=\"movie\" value=\"" + flashSrc + "\" />";
	tag += "<param name=\"quality\" value=\"high\" />";
	tag += "<param name=\"wmode\" value=\"transparent\" />";
	tag += "<embed src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
	tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
	tag += "wmode=\"transparent\"></embed>";
	tag += "</object>";
	document.write(tag);
}
