/*
*	Flash播放类 V1.0.0
*	2007-7-16
*	laoqiming@gmail.com
*/
function Flash(id,url,width,height){
	this.id=!id?"FreeSiteFlash_" + Number(Math.random()*100).toFixed(0):id;
	this.url=!url?"":url;
	this.width=!width?200:width;
	this.height=!height?50:height;
	this.attributes=[];
	this.attributes["quality"]="high";
	this.attributes["wmode"]="transparent";
	this.attributes["swliveconnect"]=true;
	this.toString=function(){
		var html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + this.width + '" height="' + this.height + '">\
            <param name="movie" value="' + this.url + '" id="' + this.id + '">';
		for(var i in this.attributes){
			html += '<param name="' + i.toString() + '" value="' + this.attributes[i] + '">';
		}
        html += '<embed name="' + this.id + '" id="' + this.id + '" src="' + this.url + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + this.width + '" height="' + this.height + '"';
		for(var i in this.attributes){
			html += ' ' + i.toString() + '="' + this.attributes[i] + '"';
		}
		html += '></embed>\
          </object>';
		return html;
	}
	this.addAttribute=function(name,value){
		this.attributes[name]=value;
	}
	this.getAttribute=function(name){
		return this.attributes[name];
	}
	this.render=function(target){
		if(!target){
			document.write(this.toString());
		}else if(typeof target == "string"){
			if(document.getElementById(target)){
				document.getElementById(target).innerHTML=this.toString();
			}
		}else if(typeof target == "object"){
			if(target.innerHTML){
				target.innerHTML=this.toString();
			}
		}
	}
}


/*PNG图片透明类
 *Correctly handle PNG transparency in Win IE 5.5 or higher.
 *http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
 */
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
         }
      }
   }
window.attachEvent("onload", correctPNG);


/*滑动门效果
 *V1.0.1
 */
function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "active"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
   tabList[i].className = "normal"; 
   document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}

/*滑动门效果
 *V1.0.1
 */
function pTabs(thisObj,Num){
if(thisObj.className == "pactive")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "pactive"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
   tabList[i].className = "pnormal"; 
   document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}

