﻿//	------------------------------
//	输出描述：专用于判断浏览器
//	------------------------------
if(window.ActiveXObject)window.ie = window[window.XMLHttpRequest?'ie7':'ie6'] = true;
//	------------------------------
//	输出描述：IE6的PNG透明效果
//	------------------------------
var theClear="../include/clear.gif" //path to clear.gif
fPngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=theClear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight-el.currentStyle.paddingTop.replace("px","")-el.currentStyle.paddingBottom.replace("px","")+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
if(window.ie6){window.attachEvent('onload',fPngfix);};
//	------------------------------
//	自定义firefox的event事件的处理
//	------------------------------
function __firefox(){HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);window.constructor.prototype.__defineGetter__("event", __window_event);Event.prototype.__defineGetter__("srcElement", __event_srcElement);}
function __element_style(){return this.style;}
function __window_event(){return __window_event_constructor();}
function __event_srcElement(){return this.target;}
function __window_event_constructor(){if(document.all){return window.event;}var _caller = __window_event_constructor.caller;while(_caller!=null){var _argument = _caller.arguments[0];if(_argument){var _temp = _argument.constructor;if(_temp.toString().indexOf("Event")!=-1){return _argument;}}_caller = _caller.caller;}return null;}
if(window.addEventListener){__firefox();}
//	------------------------------
//	自定义firefox下与IE处理结果相同event.offsetX和event.offsetY的方法
//	------------------------------
function ff_offsetX(){var _o=event.target;var _x=0;while(_o.offsetParent){_x+=_o.offsetLeft;_o=_o.offsetParent;}return event.pageX-_x;}
function ff_offsetY(){var _o=event.target;var _y=0;while(_o.offsetParent){_y+=_o.offsetTop;_o=_o.offsetParent;}return event.pageY-_y;}
//	------------------------------
//	输出描述：表单效果设置
//	------------------------------
fFormSytle= function(){
var theInput = document.getElementsByTagName("input");
for(var i=0; i<theInput.length; i++){if(theInput[i].type == "text" || theInput[i].type == "password" || theInput[i].type == "file"){theInput[i].className = "inputBlur";theInput[i].onfocus = function(){this.className = "inputFocus";};theInput[i].onblur = function(){this.className = "inputBlur";}}}
var theTextarea = document.getElementsByTagName("textarea");
for(var i=0; i<theTextarea.length; i++){theTextarea[i].className = "textareaBlur";theTextarea[i].onfocus = function(){this.className = "textareaFocus";};theTextarea[i].onblur = function(){this.className = "textareaBlur";}}
var theButton = document.getElementsByTagName("button");
for(var i=0; i<theButton.length; i++){theButton[i].className = "buttonOut";theButton[i].onmouseover = function(){this.className = "buttonOver";};theButton[i].onmouseout = function(){this.className = "buttonOut";}}}
if(window.ie){window.attachEvent('onload',fFormSytle);}else{window.addEventListener('load',fFormSytle,true);};
//	------------------------------
//	输出描述：建立脚本空间层
//	------------------------------
document.write('<div id="jsBlock" style="display:none; width:0px; height:0px;">&nbsp;</div>');
//	------------------------------
//	输出描述：日期选择插件
//	------------------------------
var nInputObj,nDateHtmlBak;
function fJsCalendar(nInputName,nDefaultDate,nSearchDate){
	if(nInputObj==""){
		nInputObj = nInputName;
	}else{
		if(nInputName!=nInputObj){
			fDateIn("",false);
			nInputObj = nInputName;
		}
	}
	//建立空间层
	nObj = document.getElementById(nInputObj);
	if(!document.getElementById("jsCalendar")){
		nDateHtml = '<div id="jsCalendar" style="position:absolute; margin-top:' + nObj.offsetHeight + 'px;"></div>';
		if(window.ie){
			nDateHtmlBak = nObj.parentElement.innerHTML;
			nObj.parentElement.innerHTML = nDateHtml + nObj.parentElement.innerHTML;
		}else{
			nDateHtmlBak = nObj.parentNode.innerHTML;
			nObj.parentNode.innerHTML = nDateHtml + nObj.parentNode.innerHTML;
		}
	}
	//建立日期表格
	nDateHtml = '<table id="jsCalendarSearch">';
	for(i=0; i<7; i++){nDateHtml += '<td></td>';}
	nDateHtml += '</table><table id="jsCalendarList">';
	for(i=0; i<7; i++){nDateHtml += '<tr>';for(j=0; j<7; j++){if(i<1){nDateHtml += '<th></th>';}else{nDateHtml += '<td></td>';};}nDateHtml += '</tr>';}
	nDateHtml += '</table>';
	document.getElementById("jsCalendar").innerHTML = nDateHtml;
	//输入日期
	var theCalendarList = document.getElementById("jsCalendarList");
	theToday = new Date();
	var nToday = theToday;
	if(nDefaultDate!=null){nToday = nDefaultDate.replace("-","/");nToday = nToday.replace("-","/");}
	if(nObj.value!=""){nToday = nObj.value.replace("-","/");nToday = nToday.replace("-","/");}
	if(nSearchDate!=null){nToday = nSearchDate.replace("-","/");nToday = nToday.replace("-","/");}
	nToday = new Date(nToday);
	theDay = nToday.getDay();
	theYear = nToday.getFullYear();
	theMonth = nToday.getMonth();
	thdDate = nToday.getDate();
	var nMonthAry = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
	theTableRow = document.getElementById("jsCalendarSearch").rows[0];
	theTableRow.cells[0].innerHTML = '<a onclick="fJsCalendar(\''+nInputObj+'\',\'\',\''+(theYear-1)+'\/'+(theMonth+1)+'\/'+thdDate+'\');" class="next"></a>';
	theTableRow.cells[1].innerHTML = theYear + "年";
	theTableRow.cells[2].innerHTML = '<a onclick="fJsCalendar(\''+nInputObj+'\',\'\',\''+(theYear+1)+'\/'+(theMonth+1)+'\/'+thdDate+'\');" class="prev"></a>';
	theTableRow.cells[3].innerHTML = '<a onclick="fJsCalendar(\''+nInputObj+'\',\'\',\''+theYear+'\/'+theMonth+'\/'+thdDate+'\');" class="next"></a>';
	theTableRow.cells[4].innerHTML = nMonthAry[theMonth];
	theTableRow.cells[5].innerHTML = '<a onclick="fJsCalendar(\''+nInputObj+'\',\'\',\''+theYear+'\/'+(theMonth+2)+'\/'+thdDate+'\');" class="prev"></a>';
	theTableRow.cells[6].innerHTML = '<a onclick="fDateIn(\''+nObj.value+'\',true);" class="close"></a>';
	var nWeekAry = new Array("日","一","二","三","四","五","六");
	for(i=0; i<7; i++){theCalendarList.rows[0].cells[i].innerHTML = nWeekAry[i];}
	var theDateI = (new Date(theYear,theMonth,1).getDay() * -1) + 1;//设置日期列表的开始相对数字
	for(i=1; i<7; i++){
		for(j=0; j<7; j++){
			theTableCell = theCalendarList.rows[i].cells[j];
			nDate = new Date(theYear,theMonth,theDateI);
			theTableCell.innerHTML = nDate.getDate();
			theTableCell.title = nDate.getFullYear()+"-"+(nDate.getMonth()+1)+"-"+nDate.getDate();//插入标题值
			if(theMonth!=nDate.getMonth()){theTableCell.className = "last";}//过期日期样式
			if((j==0 || j==6) && theMonth==nDate.getMonth()){theTableCell.className = "weekend";}//周末样式
			if(theToday.getFullYear()==nDate.getFullYear() && theToday.getMonth()==nDate.getMonth() && theToday.getDate()==nDate.getDate()){theTableCell.className = "today";}//今天样式
			if(nObj.value==theTableCell.title){theTableCell.className = "setdate";}//选中样式
			theTableCell.onclick = function (){fDateIn(this.title);};//添加事件
			if(window.ie6){
				theTableCell.onmouseover = function (){this.nTmpClass=this.className;this.className+=" hover";};//在IE6下添加对象的hover伪类
				theTableCell.onmouseout = function (){this.className=this.nTmpClass;};//在IE6下添加对象的hover伪类
			}
			theDateI++;
		}
	}
	fFormSytle();//重新调用表单事件效果
}
//写入日期并关闭控件
function fDateIn(nInputDate,nValue){
	if(document.getElementById("jsCalendar")){
		nObj = document.getElementById(nInputObj);
		if(window.ie){
			nObj.parentElement.innerHTML = nDateHtmlBak;
		}else{
			nObj.parentNode.innerHTML = nDateHtmlBak;
		}
		if(nValue!=false){
			document.getElementById(nInputObj).value = nInputDate;
		}
		nInputObj="";
	}
	fFormSytle();//重新调用表单事件效果
}
//	------------------------------
//	输出描述：文件上传界面调出
//	------------------------------
function fJsFile(nUpType,nInputName,nSavePath,nFileType,nMaxSize,nFileName){
	if(!nInputName){nInputName="";};if(!nSavePath){nSavePath="";};if(!nFileType){nFileType="";};if(!nMaxSize){nMaxSize="";};if(!nFileName){nFileName="";};
	if(nUpType=="User"){theUpLoad = "include/";}else if(nUpType!=""){theUpLoad = "../include/";}
	//输出控制界面
	nDateHtml = '<div id="jsFile" style="position:absolute;">';
	nDateHtml += '<iframe src="about:blank" name="jsFileIframe" frameborder="0" width="0" height="0" style="display:none;"></iframe>';
	nDateHtml += '<form action="'+theUpLoad+'fileUp.asp?nUpType='+nUpType+'&nInputName='+nInputName+'&nSavePath='+nSavePath+'&nFileType='+nFileType+'&nFileName='+nFileName+'&nMaxSize='+nMaxSize+'" target="jsFileIframe" enctype="multipart/form-data" method="post">';
	nDateHtml += '<table id="jsFileTable" border="0" cellpadding="0" cellspacing="0">';
	nDateHtml += '<tr><th>上传文件：</th><td><input name="upFileRoom" id="upFileRoom" type="file" /></td></tr>';
	nDateHtml += '<tr><th>常规操作：</th><td><button type="submit">提交上传</button><button type="button" onclick="fJsFileIn();">取消上传</button></td></tr>';
	nDateHtml += '<tr><th>上传限制：</th><td>文件格式：'+nFileType+'；文件大小：'+nMaxSize+'KB；固定名称：'+nFileName+'</td></tr>';
	nDateHtml += '</table>';
	nDateHtml += '</form>';
	nDateHtml += '</div>';
	document.getElementById("jsBlock").innerHTML = nDateHtml;
	document.getElementById("jsBlock").style.display = "";
	nJsObj = document.getElementById("jsFile");
	//控制层位置
	nInputObj = document.getElementById(nInputName);
	if(window.ie){
		nJsObj.style.left = event.clientX - event.offsetX + document.documentElement.scrollLeft - nInputObj.offsetWidth + "px";
		nJsObj.style.top = (event.clientY - event.offsetY) + (document.documentElement.scrollTop + document.body.scrollTop) + nInputObj.scrollHeight + (nInputObj.clientHeight - nInputObj.scrollHeight) + (nInputObj.offsetTop - nInputObj.offsetLeft) + "px";
	}else{
		nJsObj.style.left = event.clientX - ff_offsetX() + document.documentElement.scrollLeft - nInputObj.offsetWidth + "px";
		nJsObj.style.top = (event.clientY - ff_offsetY()) + (document.documentElement.scrollTop + document.body.scrollTop) + nInputObj.scrollHeight - 1 + "px";
	}
	fFormSytle();//重新调用表单事件效果
}
//写入文件名并关闭控件
function fJsFileIn(nUpType,nInputName,nFileName,nMaxSize){
	document.getElementById("jsBlock").style.display = "none";
	//document.getElementById("jsBlock").innerHTML = "";//开启此项会因为关闭太快，导致fileup页面无法关闭而一直在读取。
	if(document.getElementById(nInputName)){
		document.getElementById(nInputName).value = nFileName;
	}
}
//	------------------------------
//	输出描述：各种滚动设置
//	------------------------------
function fJsMarquee(){
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID){
		alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8];
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}
fJsMarquee.prototype.Start = function(){
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if(msobj.Direction <= 1){
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
	}else{
		if(msobj.ScrollStep == 0 && msobj.DelayTime == 0){
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		}else{
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
		}
	}
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function(){
		if(msobj.MouseOver == 1){
			setTimeout(msobj.Continue,delaytime);
		}else{	clearInterval(msobj.TimerID);
			msobj.CTL = msobj.Stop = 0;
			msobj.TimerID = setInterval(msobj.StartID,timer);
		}
	}
	msobj.Pause = function(){
		msobj.Stop = 1;
		clearInterval(msobj.TimerID);
		setTimeout(msobj.Continue,delaytime);
	}
	msobj.Begin = function(){
		msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2;
		if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step)){
			msobj.ID.innerHTML = msobj.tempHTML;
			delete(msobj.tempHTML);
			return;
		}
		delete(msobj.tempHTML);
		msobj.TimerID = setInterval(msobj.StartID,timer);
		if(msobj.ScrollStep < 0)return;
		msobj.ID.onmousemove = function(event){
			if(msobj.ScrollStep == 0 && msobj.Direction > 1){
				var event = event || window.event;
				if(window.event){
					if(msobj.IsNotOpera){
						msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
					}else{
						msobj.ScrollStep = null;
						return;
					}
				}else{
					msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
				}
				msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
				msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
				msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
			}
		}
		msobj.ID.onmouseover = function(){
			if(msobj.ScrollStep == 0)return;
			msobj.MouseOver = 1;
			clearInterval(msobj.TimerID);
		}
		msobj.ID.onmouseout = function(){
			if(msobj.ScrollStep == 0){
				if(msobj.Step == 0)msobj.Step = 1;
				return;
			}
			msobj.MouseOver = 0;
			if(msobj.Stop == 0){
				clearInterval(msobj.TimerID);
				msobj.TimerID = setInterval(msobj.StartID,timer);
			}
		}
	}
	setTimeout(msobj.Begin,waittime);
}
fJsMarquee.prototype.Scroll = function(){
	switch(this.Direction){
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}else{
				if(this.ID.scrollTop >= this.ClientScroll){
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}else{
				if(this.ID.scrollTop <= 0){
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}else{
				if(this.ID.scrollLeft >= this.ClientScroll){
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}else{
				if(this.ID.scrollLeft <= 0){
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}
//	------------------------------
//	输出描述：收展JS效果设置
//	------------------------------
function fJsHidden(nFiled,nId,nTab,nClass){
	for (i=1;i<=99;i++){
		if (document.getElementById(nFiled+i) && i!=nId){
			document.getElementById(nFiled+i).style.display="none";
			if (nTab){document.getElementById(nTab+i).className="";}
		}
	}
	if(document.getElementById(nFiled+nId)){
		if (document.getElementById(nFiled+nId).style.display=="none"){
			document.getElementById(nFiled+nId).style.display="";
			if (nTab){document.getElementById(nTab+nId).className=nClass;}
		}else{
			document.getElementById(nFiled+nId).style.display="none";
			if (nTab){document.getElementById(nTab+nId).className="";}
		}
	}
}
//	------------------------------
//	输出描述：Flash输出
//	------------------------------
function fJsFlash( arg ){
	var parm = []
	var _default_version = "8,0,24,0";
	var _default_quality = "high";
	var _default_align = "middle";
	var _default_menu = "false";
	
	for(i = 0; i < arguments.length; i ++){
		parm[i] = arguments[i].split(' ').join('').split('=')
		for (var j = parm[i].length-1; j > 1; j --){
			parm[i][j-1]+="="+parm[i].pop();
		}
		switch (parm[i][0]){
			case '_version' : var _version = parm[i][1] ; break ; 
			case '_swf' : var _swf = parm[i][1] ; break ; 
			case '_base' : var _base = parm[i][1] ; break ; 
			case '_quality' : var _quality = parm[i][1] ; break ; 
			case '_loop' : var _loop = parm[i][1] ; break ; 
			case '_bgcolor' : var _bgcolor = parm[i][1] ; break ; 
			case '_wmode' : var _wmode = parm[i][1] ; break ; 
			case '_play' : var _play = parm[i][1] ; break ; 
			case '_menu' : var _menu = parm[i][1] ; break ; 
			case '_scale' : var _scale = parm[i][1] ; break ; 
			case '_salign' : var _salign = parm[i][1] ; break ; 
			case '_height' : var _height = parm[i][1] ; break ; 
			case '_width' : var _width = parm[i][1] ; break ; 
			case '_hspace' : var _hspace = parm[i][1] ; break ; 
			case '_vspace' : var _vspace = parm[i][1] ; break ; 
			case '_align' : var _align = parm[i][1] ; break ; 
			case '_class' : var _class = parm[i][1] ; break ; 
			case '_id' : var _id = parm[i][1] ; break ; 
			case '_name' : var _name = parm[i][1] ; break ; 
			case '_style' : var _style = parm[i][1] ; break ; 
			case '_declare' : var _declare = parm[i][1] ; break ; 
			case '_flashvars' : var _flashvars = parm[i][1] ; break ; 
			default :;
		}
	}
	var thtml = ""
	thtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + ((_version)?_version:_default_version) + "'"
	if(_width) thtml += " width='" + _width + "'"
	if(_height) thtml += " height='" + _height + "'"
	if(_hspace) thtml += " hspace='" + _hspace + "'"
	if(_vspace) thtml += " vspace='" + _vspace + "'"
	if(_align) thtml += " align='" + _align + "'"
	else thtml += " align='" + _default_align + "'"
	if(_class) thtml += " class='" + _class + "'"
	if(_id) thtml += " id='" + _id + "'"
	if(_name) thtml += " name='" + _name + "'"
	if(_style) thtml += " style='" + _style + "'"
	if(_declare) thtml += " " + _declare
	thtml += ">"
	if(_swf) thtml += "<param name='movie' value='" + _swf + "'>"
	if(_quality) thtml += "<param name='quality' value='" + _quality + "'>" 
	else thtml += "<param name='quality' value ='" + _default_quality + "'>"
	if(_loop) thtml += "<param name='loop' value='" + _loop + "'>"
	if(_bgcolor) thtml += "<param name='bgcolor' value='" + _bgcolor + "'>"
	if(_play) thtml += "<param name='play' value='" + _play + "'>"
	if(_menu) thtml += "<param name='menu' value='" + _menu + "'>"
	else thtml += "<param name='menu' value='" + _default_menu + "'>"
	if(_scale) thtml += "<param name='scale' value='" + _scale + "'>"
	if(_salign) thtml += "<param name='salign' value='" + _salign + "'>"
	if(_wmode) thtml += "<param name='wmode' value='" + _wmode + "'>"
	if(_base) thtml += "<param name='base' value='" + _base + "'>"
	if(_flashvars) thtml += "<param name='flashvars' value='" + _flashvars + "'>"
	thtml += "<embed pluginspage='http://www.macromedia.com/go/getflashplayer'"
	if(_width) thtml += " width='" + _width + "'"
	if(_height) thtml += " height='" + _height + "'"
	if(_hspace) thtml += " hspace='" + _hspace + "'"
	if(_vspace) thtml += " vspace='" + _vspace + "'"
	if(_align) thtml += " align='" + _align + "'"
	else thtml += " align='" + _default_align + "'"
	if(_class) thtml += " class='" + _class + "'"
	if(_id) thtml += " id='" + _id + "'"
	if(_name) thtml += " name='" + _name + "'"
	if(_style) thtml += " style='" + _style + "'"
	thtml += " type='application/x-shockwave-flash'"
	if(_declare) thtml += " " + _declare 
	if(_swf) thtml += " src='" + _swf + "'"
	if(_quality) thtml += " quality='" + _quality + "'"
	else thtml += " quality='" + _default_quality + "'"
	if(_loop) thtml += " loop='" + _loop + "'"
	if(_bgcolor) thtml += " bgcolor='" + _bgcolor + "'"
	if(_play) thtml += " play='" + _play + "'"
	if(_menu) thtml += " menu='" + _menu + "'"
	else thtml += " menu='" + _default_menu + "'"
	if(_scale) thtml += " scale='" + _scale + "'"
	if(_salign) thtml += " salign='" + _salign + "'"
	if(_wmode) thtml += " wmode='" + _wmode + "'"
	if(_base) thtml += " base='" + _base + "'"
	if(_flashvars) thtml += " flashvars='" + _flashvars + "'"
	thtml += "></embed>"
	thtml += "</object>"
	document.write(thtml)
}