if(Array.prototype.push == null){ Array.prototype.push = function(){ for(var i = 0; i < arguments.length; i++){ this[this.length] = arguments[i];}; return this.length;};}; var EventCache = function(){ var listEvents = []; return { listEvents : listEvents, add : function(node, sEventName, fHandler, bCapture){ listEvents.push(arguments);}, flush : function(){ var i, item; for(i = listEvents.length - 1; i >= 0; i = i - 1){ item = listEvents[i]; if(item[0].removeEventListener){ item[0].removeEventListener(item[1], item[2], item[3]);}; if(item[1].substring(0, 2) != "on"){ item[1] = "on" + item[1];}; if(item[0].detachEvent){ item[0].detachEvent(item[1], item[2]);}; item[0][item[1]] = null;};}
};}(); var addEvent; if (document.addEventListener) { addEvent = function(obj, evType, fn, useCapture){ if (typeof(useCapture) == "undefined") useCapture = false; obj.addEventListener(evType, fn, useCapture); EventCache.add(obj, evType, fn, useCapture); return true;};} else if (document.attachEvent) { addEvent = function(obj, evType, fn, useCapture){ if (typeof(useCapture) == "undefined") useCapture = false; var result = obj.attachEvent("on"+evType, fn); EventCache.add(obj, evType, fn, useCapture); return result;};} else { addEvent = new Function;}; var removeEvent; if (document.removeEventListener) { removeEvent = function(obj, evType, fn, useCapture){ if (typeof(useCapture) == "undefined") useCapture = false; obj.removeEventListener(evType, fn, useCapture); EventCache.add(obj, evType, fn, useCapture); return true;};} else if (document.detachEvent) { removeEvent = function(obj, evType, fn, useCapture){ if (typeof(useCapture) == "undefined") useCapture = false; var result = obj.detachEvent("on"+evType, fn); EventCache.add(obj, evType, fn, useCapture); return result;};} else { removeEvent = function(obj, evType, fn, useCapture) { obj["on"+evType] = null;};}; addEvent(window, "unload", EventCache.flush); var ie = (navigator.userAgent.indexOf('MSIE') != -1); var moz = !ie && document.getElementById != null && document.layers == null; var browserIE = ie; var browserMozilla = moz; var browserSafari = (navigator.userAgent.indexOf('Safari') != -1); var browserOpera = (navigator.userAgent.indexOf('Opera') != -1); var windowLoaded = false; var sid = getCookie("sid"); var filtering = false; var BreadCrumbs = null; addEvent(window,"load",function(e){globalOnload();}); addEvent(window,"resize",function(e){globalResize();}); var XMParentWindow = (parent.global)?parent:top; function $(id) { return document.getElementById(id);}
function globalResize() { reFillBoxes(); if (typeof RecordsArr != "undefined") { for (var x in RecordsArr) { sizeTable(x,"full");}
}
}
function globalOnload() { windowLoaded = true; if ($("loadingFrame") && $("loadingDiv")) { $("loadingFrame").style.display="none"; $("loadingDiv").style.display="none";}
addEvent(document,"mouseup",function(){if (document.fireEvent && top != self) top.document.fireEvent("onmouseup"); else if (document.createEvent && top != self) top.document.dispatchEvent("mouseup");}); var dockArr = document.getElementsByClassName("dock"); for (var d=0;d<dockArr.length;d++) { var id = dockArr[d].getAttribute("id"); docItems[docItems.length] = new Array(id); fillBox(id);}
Nifty("div.RoundBox","smooth small"); if (document.all) { setTimeout("setupSelectBoxes();",500);}
setTimeout("focusCursor();removeStatusBarIndicator();",500);}; function placeWebCall(numberTo) { var com="com.webauthor.dashboard.mod.vonage"; var mth="Call"; var arg = {session_id:XMParentWindow.global.session_id,number_to:numberTo}; WebServiceCall(com,mth,arg); showNotifyBox("","Placing Call...");}; function Call_Result(obj) { showNotifyBox("",obj.result,2000);}; function logStatus(str) { var now = new Date(); top.Status.displayStatusMessage(str);}; function showStatus(str,varTo) { top.Status.displayStatusMessage(str);}; function hideStatus() { top.Status.displayStatusMessage("");var stObj = $("statusWindow"); if (stObj != null) stObj.style.display = "none"; if (stObj != null) sendToBack(stObj); stObj = null;}; function updateWindowTitle(title,icon) { var path = title; if (icon != "") path = "<img align='absmiddle' src='/lib/img/"+icon+"'>&nbsp;" + path; var winTitle = top.document.getElementById("BreadCrumbs"); if (winTitle) winTitle.innerHTML = path; else if (top && top.Top && top.Top.document.getElementById("BreadCrumbs")) top.Top.document.getElementById("BreadCrumbs").innerHTML = path; BreadCrumbs = path; if (parent.parent) parent.BreadCrumbs = path; removeStatusBarIndicator();}; var focusOn = null; function focusCursor() { var frms = document.forms; if (typeof(focusCursorFlag) != "undefined" && focusCursorFlag == false) return; if (focusOn != null) { if (focusOn.focus) focusOn.focus(); return;}; for (var i = 0; i < frms.length; ++i) { var f = frms[i]; for (var j = 0; j < f.elements.length; ++j) { if (f.elements[j].type == 'text' || f.elements[j].type == 'textarea') { try{ if (f.elements[j].focus) f.elements[j].focus();}catch(e){;}
return;}
}
}
var tblSel; if (typeof RecordsArr != "undefined") { try { for (var t in RecordsArr) { tblSel = RecordsArr[t]["Select"]; if (RecordsArr[t]["allowSelect"] == "true" || RecordsArr[t]["allowSelect"] == "multiple") { if (tblSel && tblSel.getItems().length > 0) { if (window.focus) window.focus(); tblSel.setItemSelected(tblSel.getItem(0),true,true,true); return;} else { showPreview(0); return;}
}
}
} catch(e) {;}
}
}; var docItems = new Array(); function fillBox(el,mode) { if (el == null) return; var elObj = $(el); var offset = 0; parObj = elObj.parentNode; if (mode == "BODY") parObj = document.body; var elPos = getObjectPosition(elObj); var newHeight = Math.max((parObj.offsetHeight-(parseInt(elObj.offsetTop)+0)),1); var newWidth = Math.max((parObj.offsetWidth-(parseInt(elObj.offsetLeft)+0)),1); elObj.style.height = newHeight+"px"; elObj.style.width = newWidth+"px";}; function setupFiller(obj,mode) { docItems[docItems.length] = new Array(obj,mode); addEvent(window,"load",function(e) {turnOffPageScroll();fillBox(obj,mode);});}; function reFillBoxes() { for (var d=0;d<docItems.length;d++) { fillBox(docItems[d][0],docItems[d][1]);}
}; function openPopUp(title,pth,ht,wdt,scrl,res) { var scrollbars = (typeof(scrl) != "undefined")?scrl:"no"; var resizable = (typeof(res) != "undefined")?res:"no"; var opnWin = window.open(pth,title.replace(/[^a-z0-9]/gi,""),'height='+ht+',width='+wdt+',scrollbars='+scrollbars+',scrolling='+scrollbars+',status=yes,resizable='+resizable); if (opnWin && opnWin.focus) opnWin.focus();}; function closeWin() { if (top.closeILayer) top.closeILayer(top.getILayer(window)); else self.close();}
function setWindowTitle(title,loc) { if (top.getILayer) { var winObj = top.getILayer(loc); if (winObj) { top.$(winObj+"Title").innerHTML = title;}
} else document.title = title;}
function turnOffPageScroll() { document.body.style.overflow = "hidden";}; function getObjectProperties(elObj) { var o = elObj; var elPos = getObjectPosition(o); var objArr = new Array(); objArr["x"] = elPos["x"]; objArr["y"] = elPos["y"]; objArr["h"] = o.offsetHeight; objArr["w"] = o.offsetWidth; return objArr;}; function getObjectPosition(elObj) { var objRealPos = Position.get(elObj); var posArr = new Array(); posArr["x"] = objRealPos["left"]; posArr["y"] = objRealPos["top"]; return posArr;}; var frameLayoutForced = false; function resizeFrame(tog,varForced) { var forced = (arguments.length > 1)?arguments[1]:false; if (parent.document.getElementById("DashboardFrame")) { var frameDimensions = (tog)?'50%,50%':'*,0'; if (!frameLayoutForced && tog && parent.previewOn) return; if (parent.rowCol == "cols")
parent.document.getElementById("DashboardFrame").cols = frameDimensions; else if (parent.rowCol != "")
parent.document.getElementById("DashboardFrame").rows = frameDimensions; parent.previewOn = (parent.rowCol != "")?tog:false;}
frameLayoutForced = forced; if (!forced) { var com = "com.webauthor.dashboard.user"; var mth = "SavePreviewMode"; var arg = {session_id:sid,preview:parent.previewOn}; WebServiceCall(com,mth,arg);}
}; function ReadingPane(mode) { var com = "com.webauthor.dashboard.user"; var mth = "SavePreferenceReadingPane"; var frameWindow = (XMParentWindow.global.tabMode)?parent:XMParentWindow; if (mode == "rows") { var arg = {session_id:XMParentWindow.global.session_id,reading_pane:"Bottom"}; WebServiceCall(com,mth,arg); frameWindow.rowCol = "rows"; frameWindow.document.getElementById("DashboardFrame").cols = ""; frameWindow.document.getElementById("DashboardFrame").rows = "50%,50%"; resizeFrame(true);} else if (mode == "cols") { var arg = {session_id:XMParentWindow.global.session_id,reading_pane:"Right"}; WebServiceCall(com,mth,arg); frameWindow.rowCol = "cols"; frameWindow.document.getElementById("DashboardFrame").rows = ""; frameWindow.document.getElementById("DashboardFrame").cols = "50%,50%"; resizeFrame(true);} else if (mode == "none") { resizeFrame(false,true);}
}; var selectKeys = ""; function setupAutoSearch(s) { var selBoxes = document.getElementsByTagName("SELECT"); var selBox = selBoxes[s]; if (selBox.attachEvent) { selBox.attachEvent("onkeypress",function(){selectKeyPress();}); selBox.attachEvent("onkeydown",function(){selectKeyDown();}); selBox.attachEvent("onblur",function(){clr();}); selBox.attachEvent("onfocus",function(){clr();});}
selBox = null;}; function selectKeyDown() { if(window.event.keyCode == 46 || window.event.keyCode == 8)
clr();}
function selectKeyPress() { var sndr = window.event.srcElement; var pre = selectKeys; var key = window.event.keyCode; var chr = String.fromCharCode(key); var re = new RegExp("^" + pre + chr, "i"); for(var i=0; i<sndr.options.length; i++) { if(re.test(sndr.options[i].text)) { sndr.options[i].selected=true; selectKeys += chr; if (typeof document.fireEvent != "undefined") { sndr.fireEvent("onchange");} else if (typeof document.createEvent != 'undefined') { try { sndr.dispatchEvent("change");} catch(e) {;}
}
window.event.returnValue = false; break;};};}; function clr() { selectKeys = "";}
function setupSelectBoxes() { var selBoxes = document.getElementsByTagName("SELECT"); for (var s=0;s<selBoxes.length;s++) { if (document.all && window.attachEvent) { selBoxes[s].attachEvent("onfocusin",function(){SelectOnFocusIn();}); selBoxes[s].attachEvent("onfocus",function(){SelectOnFocus();});}; setupAutoSearch(s);}; selBoxes = null;}; function SelectOnFocusIn() { try { var eSrc = window.event.srcElement; if (eSrc) eSrc.tmpIndex = eSrc.selectedIndex;} catch (e) {;};}; function SelectOnFocus() { try { var eSrc = window.event.srcElement; if (eSrc) eSrc.selectedIndex = eSrc.tmpIndex;} catch (e) {;};}; function setSelectedValue(selObj,val) { for(var i=0; i<selObj.options.length; i++) { selObj.options[i].selected=(selObj.options[i].value == val); if(selObj.options[i].value == val) return i;};}; function clearForm(frm) { if (frm) { var flds = frm.elements; for (var f=0;f<flds.length;f++) { if (frm.elements[f].type != "hidden" && frm.elements[f].type != "submit" && frm.elements[f].type != "button")
frm.elements[f].value = "";};};}; var sndPlaying = ""; function ToggleSound(snd,img) { var sp = document.getElementById("SoundPlayer"); var justCreated = false; if (!sp) { sp = document.createElement("EMBED"); sp.id = "SoundPlayer"; sp.setAttribute("autostart",true); sp.style.width = 0; sp.style.height = 0; document.body.appendChild(sp); justCreated = true; if (img) img.setAttribute("alt","Pause");}
sp.src = snd; if (!justCreated && sndPlaying == snd) { sp.stop(); sndPlaying = ""; if (img) { img.src=img.src.replace("pause.gif","play.gif"); img.setAttribute("alt","Play");}
} else if (!justCreated) { sp.play(); if (img) img.src=img.src.replace("play.gif","pause.gif"); sndPlaying = snd;} else { if (img) img.src=img.src.replace("play.gif","pause.gif"); sndPlaying = snd;}
}; function showUpdate(key) { var path = (arguments.length > 1) ? arguments[1] : ""; var newKey = key+""; var winName = "Win"+newKey.replace(/[^a-z0-9]/gi,''); var opnWin = window.open(path+"save.cfm?preview=0&key="+key,winName,"width=640,height=480,toolbar=0,location=0,directories=0,status=1,resizable=1,menubar=0,scrollbars=0,toolbar=0,marginwidth=0,marginheight=0,left=150,top=150"); opnWin.focus();}; function showDetail(key) { if (key.length == 0 && key != 0) return; var path = (arguments.length > 1) ? arguments[1] : ""; var newKey = key+""; var winName = "Win"+newKey.replace(/[^a-z0-9]/gi,''); if (viewingMode == "Simple") { window.location.href = path+"detail.cfm?preview=0&id="+key;} else { var opnWin = window.open(path+"detail.cfm?preview=0&id="+key,winName,"width=640,height=480,toolbar=0,location=0,directories=0,status=1,resizable=1,menubar=0,scrollbars=0,toolbar=0,marginwidth=0,marginheight=0,left=150,top=150,scrollbars=yes,resizable=yes"); opnWin.focus();};}; var currPreviewKey; function showPreview(key) { if (typeof showPreviewItem == "function") { showPreviewItem(key);} else if (parent && parent.Detail && currPreviewKey != key && parent.previewOn) { currPreviewKey = key; var baseURL = (typeof(previewBaseURL) != "undefined")?previewBaseURL:basePath+modCode+"/detail.cfm?preview=1&id="; var url = (key == 0)?'/htm/shared/blank.cfm?bgcolor=808080':baseURL+escape(key); parent.Detail.location.href=url;} else if (!parent.Detail) { return; currPreviewKey = key; var url = (key == 0)?'/htm/shared/blank.cfm?bgcolor=808080':'../detail.cfm?preview=1&id='+escape(key);}; removeStatusBarIndicator();}; function openDialogWindow(title,pth,ht,wdt) { var height = (typeof(ht) != "undefined")?ht:300; var width = (typeof(wdt) != "undefined")?wdt:400; if (window.openDialog)
return window.open(pth,title,"height="+height+",width="+width+",scroll=n,help=no,modal=yes"); else if (window.showModalDialog)
return window.showModalDialog(pth, window,"dialogHeight:"+height+"px;dialogWidth:"+width+"px;scroll:no;help:no");}; function removeStatusBarIndicator() { window.status = "Done"; setTimeout("window.status = 'Done';",500);}; function sendToBack(obj) { if (!obj) return; var ifrm = $("XMFrameOverlay"); if (ifrm) ifrm.style.display = "none";}; function bringToFront(obj,ht,wdt,lft,top) { if (!browserIE) return; var objPos = getObjectPosition(obj); var ifrm = $("XMFrameOverlay"); if (!ifrm) { ifrm = document.createElement("IFRAME"); ifrm.id="XMFrameOverlay"; ifrm.setAttribute("scrolling","no"); ifrm.setAttribute("frameborder","no"); ifrm.src = "/blank.cfm"
document.body.appendChild(ifrm);}
ifrm.style.height = ((ht)?ht:obj.offsetHeight)+"px"; ifrm.style.top = ((top)?top:objPos["y"])+"px"; ifrm.style.left = ((lft)?lft:objPos["x"])+"px"; ifrm.style.width = ((wdt)?wdt:obj.offsetWidth)+"px"; ifrm.style.display = "block"; ifrm.style.zIndex = 10; obj.style.zIndex = 20; ifrm = null;}; function GetCurrentDateTime() { var time = new Date(); return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();}; function GetUTCDate() { var now = new Date(); var time = DateAdd("n",tzOffsetMinutes,now); return time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate()+" "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();}; function showNotifyBox(title,str,to){ showStatus(str,to);}; function hideNotifyBox() { if (top.hideNotifyBox && top != self) top.hideNotifyBox(); else if (typeof(hideNotify) != "undefined") hideNotify(); removeStatusBarIndicator();}; function showHint(str,obj,width,e, varColor){ if (!windowLoaded) return; var color = (typeof(varColor) != "undefined")?varColor:"#F7E5A8"; var hintBox = document.getElementById("XMHint"); if (!hintBox) { hintBox = document.createElement("DIV"); hintBox.className = "hintBox"; hintBox.id = "XMHint"; document.body.appendChild(hintBox);}; hintBox.innerHTML = str; hintBox.style.width = width+"px"; var x = e.clientX+10; var y = e.clientY+10; hintBox.style.top = Math.min(document.body.offsetHeight-hintBox.offsetHeight,y)+"px"; hintBox.style.left = Math.min(document.body.offsetWidth-hintBox.offsetWidth,x)+"px"; var objPos = getObjectPosition(obj); if ((objPos["x"]+obj.offsetWidth+width) > document.body.offsetWidth)
hintBox.style.left = Math.max(1,objPos["x"]-width)+"px"; else
hintBox.style.left = Math.max(1,objPos["x"]+obj.offsetWidth)+"px"; hintBox.style.display = "block"; hintBox = null;}; function hideHint() { var hintBox = document.getElementById("XMHint"); if (hintBox) hintBox.style.display = "none"; hintBox = null;}; var overObj = new Object(); function highlightDiv(obj,tog) { var color = ""; if (!tog) { color = (obj.getAttribute("_bgcolor"))?obj.getAttribute("_bgcolor"):""; obj.style.backgroundColor = color; obj.style.cursor = "pointer";} else { obj.setAttribute("_bgcolor",obj.style.backgroundColor); obj.style.backgroundColor = "#FFCC00"; obj.style.cursor = "pointer";}
}
function showObj(e,el,pos,clickToClose) { var obj = $(el); var clickToClose = (typeof(clickToClose) != "undefined")?clickToClose:true; var docWidth = document.body.offsetWidth; if (obj) { if (typeof overObj[el] == "undefined") overObj[el] = false; var pos = (typeof(pos) != "undefined")?pos:"bottom"; var eProp = getObjectProperties(e); obj.onmouseover = function(){overObj[el]=true;}; obj.onmouseout = function(){overObj[el]=false;}; obj.style.display = "block"; obj.style.left = Math.min(eProp["x"],(docWidth-obj.offsetWidth))+"px"; obj.style.top = eProp["y"]+eProp["h"]+"px"; if (pos == "top") obj.style.top = eProp["y"]-obj.offsetHeight+"px"; else if (pos == "right") { obj.style.left = Math.min(eProp["x"]+eProp["w"],(docWidth-obj.offsetWidth))+"px"; obj.style.top = eProp["y"]+"px";}
if (obj.offsetHeight > (document.body.offsetHeight-(eProp["y"]+eProp["h"]))) { obj.style.height = Math.min(200,document.body.offsetHeight-(eProp["y"]+eProp["h"]))+"px"; obj.style.overflow = "auto";}
bringToFront(obj); if (clickToClose) { document.onmouseup = function(e) { for (var m in overObj) { if (!overObj[m]) { this.onmouseup = null; hideObj(m);}
}
}
}
}
}
function hideObj(el) { var obj = $(el); if (obj) obj.style.display = "none"; sendToBack(obj);}
function dumpObject(obj) { for (var x in obj) { alert(obj[x]+" = "+x);}
}
function addKeyHandler(element) { element._keyObject = new Array(); element._keyObject["keydown"] = new Array(); element._keyObject["keyup"] = new Array(); element._keyObject["keypress"] = new Array(); element.addKeyDown = function (keyCode, action) { element._keyObject["keydown"][keyCode] = action;}
element.removeKeyDown = function (keyCode) { element._keyObject["keydown"][keyCode] = null;}
element.addKeyUp = function (keyCode, action) { element._keyObject["keyup"][keyCode] = action;}
element.removeKeyUp = function (keyCode) { element._keyObject["keyup"][keyCode] = null;}
element.addKeyPress = function (keyCode, action) { element._keyObject["keypress"][keyCode] = action;}
element.removeKeyPress = function (keyCode) { element._keyObject["keypress"][keyCode] = null;}
function handleEvent(e) { var type = window.event.type; var code = window.event.keyCode; if (element._keyObject[type][code] != null)
element._keyObject[type][code]();}
addEvent(element,"keypress",handleEvent); addEvent(element,"keydown",handleEvent); addEvent(element,"keyup",handleEvent);}
function createRequestObject() { var ro; var browser = navigator.appName; if (browser == "Microsoft Internet Explorer") { ro = new ActiveXObject("Microsoft.XMLHTTP");} else { ro = new XMLHttpRequest();}
return ro;}
var remoteXMRequestCounter = 0; var webServices = new Array(); function WebServiceCall(com,mth,arg,requestid,ss,varFx) { var rid = (typeof requestid != "undefined" && requestid != null)?requestid:remoteXMRequestCounter++; var styl = (typeof ss != "undefined" && ss != null)?ss:""; var xmlStr = '<component '+ ' name="' + com + '"'; xmlStr = xmlStr + ' stylesheet="' + styl + '"'; xmlStr = xmlStr + ' requestid="' + rid + '"'; xmlStr = xmlStr + '>'; xmlStr = xmlStr + '<method name="' + mth + '">'; for (a in arg) { xmlStr = xmlStr + '<param name="'+a+'"><![CDATA['+arg[a]+']]></param>';}
xmlStr = xmlStr + '</method>'; xmlStr = xmlStr + '</component>'; var fx = (typeof(varFx) != "undefined")?varFx:this[mth+"_Result"]; new ajax("/htm/shared/remote.cfm",{method:"post",postBody:"xmlInput="+escape(xmlStr),onComplete: fx});}; var Class = { create: function() { return function() { this.initialize.apply(this, arguments);}
}
}; Object.extend = function(destination, source) { for (property in source) { destination[property] = source[property];}
return destination;}; Function.prototype.bind = function(object) { var __method = this; return function() { return __method.apply(object, arguments);}
}; document.getElementsByClassName = function(className) { var children = document.getElementsByTagName('*') || document.all; var elements = new Array(); for (var i = 0; i < children.length; i++) { var child = children[i]; var classNames = child.className.split(' '); for (var j = 0; j < classNames.length; j++) { if (classNames[j] == className) { elements.push(child); break;}
}
}
return elements;}; if (!window.Element) { var Element = new Object();}
Object.extend(Element, { remove: function(element) { element = $(element); element.parentNode.removeChild(element);}, hasClassName: function(element, className) { element = $(element); if (!element)
return; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { if (a[i] == className)
return true;}
return false;}, addClassName: function(element, className) { element = $(element); Element.removeClassName(element, className); element.className += ' ' + className;}, removeClassName: function(element, className) { element = $(element); if (!element)
return; var newClassName = ''; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { if (a[i] != className) { if (i > 0)
newClassName += ' '; newClassName += a[i];}
}
element.className = newClassName;}, cleanWhitespace: function(element) { element = $(element); for (var i = 0; i < element.childNodes.length; i++) { var node = element.childNodes[i]; if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
Element.remove(node);}
}
}); ajax = Class.create(); ajax.prototype = { initialize: function(url, options){ this.transport = this.getTransport(); this.postBody = options.postBody || ''; this.method = options.method || 'post'; this.onComplete = options.onComplete || null; this.update = $(options.update) || null; this.request(url);}, request: function(url){ this.transport.open(this.method, url, true); this.transport.onreadystatechange = this.onStateChange.bind(this); if (this.method == 'post') { this.transport.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); if (this.transport.overrideMimeType) this.transport.setRequestHeader('Connection', 'close');}
this.transport.send(this.postBody);}, onStateChange: function(){ if (this.transport.readyState == 4 && this.transport.status == 200) { if (this.onComplete)
setTimeout(function(){this.onComplete(eval('('+this.transport.responseText+')'));}.bind(this), 10); if (this.update)
setTimeout(function(){this.update.innerHTML = this.transport.responseText;}.bind(this), 10); this.transport.onreadystatechange = function(){};}
}, getTransport: function() { if (window.ActiveXObject) return new ActiveXObject('Microsoft.XMLHTTP'); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else return false;}
}; var CGI = new Array(); CGI.script_name = location.href; CGI.http_host = location.host; CGI.query_string = document.location.search; var URL = new Array(); var queryString = document.location.search; if (queryString.length > 1) { var nmValPairs = queryString.substring(1,queryString.length); for (var q=1;q <= ListLen(nmValPairs,"&");q++) { var nmVal = ListGetAt(nmValPairs,q,"&"); URL[ListFirst(nmVal,"=")] = ListLast(nmVal,"=");}
}
function getURL(str) { return (typeof(URL[str]) != "undefined")?URL[str]:"";}
function getCookie(name) { if (document.cookie) { var cookies=document.cookie.split(";"); for (var i=0; i<cookies.length; i++) { var varName=(cookies[i].split("=")[0]); var varValue=(cookies[i].split("=")[1]); while (varName.charAt(0)==" ")
varName=varName.substr(1,varName.length); if (varName.toLowerCase()==name.toLowerCase())
return varValue;}
}
return "";}
function TRIM(strValue) { var objRegExp = /^(\s*)$/; if(objRegExp.test(strValue)) { strValue = strValue.replace(objRegExp, ''); if( strValue.length == 0) return strValue;}
objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/; if(objRegExp.test(strValue)) { strValue = strValue.replace(objRegExp, '$2');}
return strValue;}
function XMLFormat(xmlStr) { var regEx = new RegExp("\r\n","ig"); xmlStr = TRIM(xmlStr); var xml = "<![CDATA["+xmlStr.replace(regEx, "<br>")+"]]>"; return xml;}
function ListFind(lst,val,del) { var lstArr = lst.split(del); var fnd = 0; for (var a=0;a<lstArr.length;a++) { if (lstArr[a] == val) { fnd = a+1; break;}
}
return fnd;}
function ListFindNoCase(lst,val,del) { var lstArr = lst.split(del); var fnd = 0; for (var a=0;a<lstArr.length;a++) { if (lstArr[a].toLowerCase() == val.toLowerCase()) { fnd = a+1; break;}
}
return fnd;}
function getLeadingZero(nbr) {var nr = nbr;var nrStr = ""+nbr;if (nr < 10 && nrStr.length == 1) nr = "0"+nr;return nr;}
function ListToArray(lst,del) { return lst.split(del);}
function ArrayToList(arr,del) { return arr.join(del);}
function Val(nbr) { return (isNaN(nbr) || nbr == "")?0:nbr;}
function ListAppend(lst,val,del) { var del=del?del:",";if (lst == "") return val; var lstArr = ListToArray(lst,del); lstArr[lstArr.length] = val; var newlst = ArrayToList(lstArr,del); return newlst;}
function ListLen(lst,del) { var del=del?del:",";var lstArr = lst.split(del); return lstArr.length;}
function ListDeleteAt(lst,pos,del) { var del=del?del:",";var lstArr = lst.split(del); remArr = lstArr.splice(pos-1,1); var newlst = ArrayToList(lstArr,del); return newlst;}
function ListGetAt(lst,pos,del) { var del=del?del:",";var lstArr = lst.split(del); return lstArr[pos-1];}
function ListLast(lst,del) { var del=del?del:",";return ListGetAt(lst,ListLen(lst,del),del);}
function ListFirst(lst,del) {var del=del?del:","; return ListGetAt(lst,1,del);}
function NumberFormat(num) { return FormatNumber(num,0);}
function DecimalFormat(num) { return FormatNumber(num,2);}
function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas) { if (isNaN(parseInt(num))) return "NaN"; var tmpNum = num; var iSign = num < 0 ? -1 : 1; tmpNum *= Math.pow(10,decimalNum); tmpNum = Math.round(Math.abs(tmpNum))
tmpNum /= Math.pow(10,decimalNum); tmpNum *= iSign; var tmpNumStr = new String(tmpNum); if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
if (num > 0)
tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length); else
tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length); if (bolCommas && (num >= 1000 || num <= -1000)) { var iStart = tmpNumStr.indexOf("."); if (iStart < 0)
iStart = tmpNumStr.length; iStart -= 3; while (iStart >= 1) { tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
iStart -= 3;}
}
if (bolParens && num < 0) tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")"; return tmpNumStr;}
function isDate(p_Expression){ return !isNaN(new Date(p_Expression));}
function dateAdd(p_Interval, p_Number, p_Date){ if(!isDate(p_Date)){return "invalid date: '" + p_Date + "'";}
if(isNaN(p_Number)){return "invalid number: '" + p_Number + "'";}
p_Number = new Number(p_Number); var dt = new Date(p_Date); switch(p_Interval.toLowerCase()){ case "yyyy": { dt.setFullYear(dt.getFullYear() + p_Number); break;}
case "q": { dt.setMonth(dt.getMonth() + (p_Number*3)); break;}
case "m": { dt.setMonth(dt.getMonth() + p_Number); break;}
case "y":
case "d":
case "w": { dt.setDate(dt.getDate() + p_Number); break;}
case "ww": { dt.setDate(dt.getDate() + (p_Number*7)); break;}
case "h": { dt.setHours(dt.getHours() + p_Number); break;}
case "n": { dt.setMinutes(dt.getMinutes() + p_Number); break;}
case "s": { dt.setSeconds(dt.getSeconds() + p_Number); break;}
case "ms": { dt.setMilliseconds(dt.getMilliseconds() + p_Number); break;}
default: { return "invalid interval: '" + p_Interval + "'";}
}
return dt;}
function dateDiff(p_Interval, p_Date1, p_Date2, p_firstdayofweek, p_firstweekofyear){ if(!isDate(p_Date1)){return "invalid date: '" + p_Date1 + "'";}
if(!isDate(p_Date2)){return "invalid date: '" + p_Date2 + "'";}
var dt1 = new Date(p_Date1); var dt2 = new Date(p_Date2); var iDiffMS = dt2.valueOf() - dt1.valueOf(); var dtDiff = new Date(iDiffMS); var nYears = dtDiff.getUTCFullYear()-1970; var nMonths = dtDiff.getUTCMonth() + (nYears!=0 ? nYears*12 : 0); var nQuarters = parseInt(nMonths/3); var nWeeks = parseInt(iDiffMS/1000/60/60/24/7); var nDays = parseInt(iDiffMS/1000/60/60/24); var nHours = parseInt(iDiffMS/1000/60/60); var nMinutes = parseInt(iDiffMS/1000/60); var nSeconds= parseInt(iDiffMS/1000); var nMilliseconds = iDiffMS; var iDiff = 0; switch(p_Interval.toLowerCase()){ case "yyyy": return nYears; case "q": return nQuarters; case "m": return nMonths; case "y":
case "d": return nDays; case "w": return nDays; case "ww":return nWeeks; case "h": return nHours; case "n": return nMinutes; case "s": return nSeconds; case "ms":return nMilliseconds; default: return "invalid interval: '" + p_Interval + "'";}
}
function datePart(p_Interval, p_Date, p_firstdayofweek, p_firstweekofyear){ if(!isDate(p_Date)){return "invalid date: '" + p_Date + "'";}
var dtPart = new Date(p_Date); switch(p_Interval.toLowerCase()){ case "yyyy": return dtPart.getFullYear(); case "q": return parseInt(dtPart.getMonth()/3)+1; case "m": return dtPart.getMonth()+1; case "y": return dateDiff("y", "1/1/" + dtPart.getFullYear(), dtPart); case "d": return dtPart.getDate(); case "w": return dtPart.getDay(); case "ww":return dateDiff("ww", "1/1/" + dtPart.getFullYear(), dtPart); case "h": return dtPart.getHours(); case "n": return dtPart.getMinutes(); case "s": return dtPart.getSeconds(); case "ms":return dtPart.getMilliseconds(); default: return "invalid interval: '" + p_Interval + "'";}
}
function weekdayName(p_Date, p_abbreviate){ if(!isDate(p_Date)){return "invalid date: '" + p_Date + "'";}
var dt = new Date(p_Date); var retVal = dt.toString().split(' ')[0]; var retVal = Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')[dt.getDay()]; if(p_abbreviate==true){retVal = retVal.substring(0, 3)}
return retVal;}
function monthName(p_Date, p_abbreviate){ if(!isDate(p_Date)){return "invalid date: '" + p_Date + "'";}
var dt = new Date(p_Date); var retVal = Array('January','February','March','April','May','June','July','August','September','October','November','December')[dt.getMonth()]; if(p_abbreviate==true){retVal = retVal.substring(0, 3)}
return retVal;}
function IsDate(p_Expression){ return isDate(p_Expression);}
function DateAdd(p_Interval, p_Number, p_Date){ return dateAdd(p_Interval, p_Number, p_Date);}
function DateDiff(p_interval, p_date1, p_date2, p_firstdayofweek, p_firstweekofyear){ return dateDiff(p_interval, p_date1, p_date2, p_firstdayofweek, p_firstweekofyear);}
function DatePart(p_Interval, p_Date, p_firstdayofweek, p_firstweekofyear){ return datePart(p_Interval, p_Date, p_firstdayofweek, p_firstweekofyear);}
function WeekdayName(p_Date){ return weekdayName(p_Date);}
function MonthName(p_Date){ return monthName(p_Date);}
function DateTimeFormat(dt) {return getLeadingZero(DatePart("m",dt))+"/"+getLeadingZero(DatePart("d",dt))+"/"+DatePart("yyyy",dt)+" "+getLeadingZero(DatePart("h",dt))+":"+getLeadingZero(DatePart("n",dt));}
function addKeyHandler(element) { element._keyObject = new Array(); element._keyObject["keydown"] = new Array(); element._keyObject["keyup"] = new Array(); element._keyObject["keypress"] = new Array(); element.addKeyDown = function (keyCode, action) { element._keyObject["keydown"][keyCode] = action;}
element.removeKeyDown = function (keyCode) { element._keyObject["keydown"][keyCode] = null;}
element.addKeyUp = function (keyCode, action) { element._keyObject["keyup"][keyCode] = action;}
element.removeKeyUp = function (keyCode) { element._keyObject["keyup"][keyCode] = null;}
element.addKeyPress = function (keyCode, action) { element._keyObject["keypress"][keyCode] = action;}
element.removeKeyPress = function (keyCode) { element._keyObject["keypress"][keyCode] = null;}
function handleEvent() { var type = window.event.type; var code = window.event.keyCode; if (element._keyObject[type][code] != null)
element._keyObject[type][code]();}
addEvent(element,"keypress",handleEvent); addEvent(element,"keydown",handleEvent); addEvent(element,"keyup",handleEvent);}
var niftyOk=(document.getElementById && document.createElement && Array.prototype.push); String.prototype.find=function(what){ return(this.indexOf(what)>=0 ? true : false);}
function Nifty(selector,options){ if(niftyOk==false) return; var i,v=selector.split(","),h=0; if(options==null) options=""; if(options.find("fixed-height"))
h=getElementsBySelector(v[0])[0].offsetHeight; for(i=0;i<v.length;i++)
Rounded(v[i],options); if(options.find("height")) SameHeight(selector,h);}
function Rounded(selector,options){ var i,top="",bottom="",v=new Array(); if(options!=""){ options=options.replace("left","tl bl"); options=options.replace("right","tr br"); options=options.replace("top","tr tl"); options=options.replace("bottom","br bl"); options=options.replace("transparent","alias"); if(options.find("tl")){ top="both"; if(!options.find("tr")) top="left";}
else if(options.find("tr")) top="right"; if(options.find("bl")){ bottom="both"; if(!options.find("br")) bottom="left";}
else if(options.find("br")) bottom="right";}
if(top=="" && bottom=="" && !options.find("none")){top="both";bottom="both";}
v=getElementsBySelector(selector); for(i=0;i<v.length;i++){ FixIE(v[i]); if(top!="") AddTop(v[i],top,options); if(bottom!="") AddBottom(v[i],bottom,options);}
}
function AddTop(el,side,options){ var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color; d.style.marginLeft="-"+getPadding(el,"Left")+"px"; d.style.marginRight="-"+getPadding(el,"Right")+"px"; if(options.find("alias") || (color=getBk(el))=="transparent"){ color="transparent";bk="transparent"; border=getParentBk(el);btype="t";}
else{ bk=getParentBk(el); border=Mix(color,bk);}
d.style.background=bk; d.className="niftycorners"; p=getPadding(el,"Top"); if(options.find("small")){ d.style.marginBottom=(p-2)+"px"; btype+="s"; lim=2;}
else if(options.find("big")){ d.style.marginBottom=(p-10)+"px"; btype+="b"; lim=8;}
else d.style.marginBottom=(p-5)+"px"; for(i=1;i<=lim;i++)
d.appendChild(CreateStrip(i,side,color,border,btype)); el.style.paddingTop="0"; el.insertBefore(d,el.firstChild);}
function AddBottom(el,side,options){ var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color; d.style.marginLeft="-"+getPadding(el,"Left")+"px"; d.style.marginRight="-"+getPadding(el,"Right")+"px"; if(options.find("alias") || (color=getBk(el))=="transparent"){ color="transparent";bk="transparent"; border=getParentBk(el);btype="t";}
else{ bk=getParentBk(el); border=Mix(color,bk);}
d.style.background=bk; d.className="niftycorners"; p=getPadding(el,"Bottom"); if(options.find("small")){ d.style.marginTop=(p-2)+"px"; btype+="s"; lim=2;}
else if(options.find("big")){ d.style.marginTop=(p-10)+"px"; btype+="b"; lim=8;}
else d.style.marginTop=(p-5)+"px"; for(i=lim;i>0;i--)
d.appendChild(CreateStrip(i,side,color,border,btype)); el.style.paddingBottom=0; el.appendChild(d);}
function CreateStrip(index,side,color,border,btype){ var x=CreateEl("b"); x.className=btype+index; x.style.backgroundColor=color; x.style.borderColor=border; if(side=="left"){ x.style.borderRightWidth="0"; x.style.marginRight="0";}
else if(side=="right"){ x.style.borderLeftWidth="0"; x.style.marginLeft="0";}
return(x);}
function CreateEl(x){ return(document.createElement(x));}
function FixIE(el){ if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false)
el.style.display="inline-block";}
function SameHeight(selector,maxh){ var i,v=selector.split(","),t,j,els=[],gap; for(i=0;i<v.length;i++){ t=getElementsBySelector(v[i]); els=els.concat(t);}
for(i=0;i<els.length;i++){ if(els[i].offsetHeight>maxh) maxh=els[i].offsetHeight; els[i].style.height="auto";}
for(i=0;i<els.length;i++){ gap=maxh-els[i].offsetHeight; if(gap>0){ t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px"; nc=els[i].lastChild; if(nc.className=="niftycorners")
els[i].insertBefore(t,nc); else els[i].appendChild(t);}
}
}
function getElementsBySelector(selector){ var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c; if(selector.find("#")){ if(selector.find(" ")){ s=selector.split(" "); var fs=s[0].split("#"); if(fs.length==1) return(objlist); f=document.getElementById(fs[1]); if(f){ v=f.getElementsByTagName(s[1]); for(i=0;i<v.length;i++) objlist.push(v[i]);}
return(objlist);}
else{ s=selector.split("#"); tag=s[0]; selid=s[1]; if(selid!=""){ f=document.getElementById(selid); if(f) objlist.push(f); return(objlist);}
}
}
if(selector.find(".")){ s=selector.split("."); tag=s[0]; selclass=s[1]; if(selclass.find(" ")){ s=selclass.split(" "); selclass=s[0]; tag2=s[1];}
}
var v=document.getElementsByTagName(tag); if(selclass==""){ for(i=0;i<v.length;i++) objlist.push(v[i]); return(objlist);}
for(i=0;i<v.length;i++){ c=v[i].className.split(" "); for(j=0;j<c.length;j++){ if(c[j]==selclass){ if(tag2=="") objlist.push(v[i]); else{ v2=v[i].getElementsByTagName(tag2); for(k=0;k<v2.length;k++) objlist.push(v2[k]);}
}
}
}
return(objlist);}
function getParentBk(x){ var el=x.parentNode,c; while(el.tagName.toUpperCase()!="HTML" && (c=getBk(el))=="transparent")
el=el.parentNode; if(c=="transparent") c="#FFFFFF"; return(c);}
function getBk(x){ var c=getStyleProp(x,"backgroundColor"); if(c==null || c=="transparent" || c.find("rgba(0, 0, 0, 0)"))
return("transparent"); if(c.find("rgb")) c=rgb2hex(c); return(c);}
function getPadding(x,side){ var p=getStyleProp(x,"padding"+side); if(p==null || !p.find("px")) return(0); return(parseInt(p));}
function getStyleProp(x,prop){ if(x.currentStyle)
return(x.currentStyle[prop]); if(document.defaultView.getComputedStyle)
return(document.defaultView.getComputedStyle(x,'')[prop]); return(null);}
function rgb2hex(value){ var hex="",v,h,i; var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/; var h=regexp.exec(value); for(i=1;i<4;i++){ v=parseInt(h[i]).toString(16); if(v.length==1) hex+="0"+v; else hex+=v;}
return("#"+hex);}
function Mix(c1,c2){ var i,step1,step2,x,y,r=new Array(3); if(c1.length==4)step1=1; else step1=2; if(c2.length==4) step2=1; else step2=2; for(i=0;i<3;i++){ x=parseInt(c1.substr(1+step1*i,step1),16); if(step1==1) x=16*x+x; y=parseInt(c2.substr(1+step2*i,step2),16); if(step2==1) y=16*y+y; r[i]=Math.floor((x*50+y*50)/100); r[i]=r[i].toString(16); if(r[i].length==1) r[i]="0"+r[i];}
return("#"+r[0]+r[1]+r[2]);}
var Position =(function(){function resolveObject(s){if(document.getElementById && document.getElementById(s)!=null){return document.getElementById(s);}else if(document.all && document.all[s]!=null){return document.all[s];}else if(document.anchors && document.anchors.length && document.anchors.length>0 && document.anchors[0].x){for(var i=0;i<document.anchors.length;i++){if(document.anchors[i].name==s){return document.anchors[i]}}}}var pos ={}; pos.set = function(o,left,top){if(typeof(o)=="string"){o = resolveObject(o);}if(o==null || !o.style){return false;}o.style.position = "absolute";if(typeof(left)=="object"){var pos = left;left = pos.left;top = pos.top;}o.style.left = left + "px";o.style.top = top + "px";return true;}; pos.get = function(o){var fixBrowserQuirks = true;if(typeof(o)=="string"){o = resolveObject(o);}if(o==null){return null;}var left = 0;var top = 0;var width = 0;var height = 0;var parentNode = null;var offsetParent = null;offsetParent = o.offsetParent;var originalObject = o;var el = o;while(el.parentNode!=null){el = el.parentNode;if(el.offsetParent==null){}else{var considerScroll = true;if(fixBrowserQuirks && window.opera){if(el==originalObject.parentNode || el.nodeName=="TR"){considerScroll = false;}}if(considerScroll){if(el.scrollTop && el.scrollTop>0){top -= el.scrollTop;}if(el.scrollLeft && el.scrollLeft>0){left -= el.scrollLeft;}}}if(el == offsetParent){left += o.offsetLeft;if(el.clientLeft && el.nodeName!="TABLE"){left += el.clientLeft;}top += o.offsetTop;if(el.clientTop && el.nodeName!="TABLE"){top += el.clientTop;}o = el;if(o.offsetParent==null){if(o.offsetLeft){left += o.offsetLeft;}if(o.offsetTop){top += o.offsetTop;}}offsetParent = o.offsetParent;}}if(originalObject.offsetWidth){width = originalObject.offsetWidth;}if(originalObject.offsetHeight){height = originalObject.offsetHeight;}return{'left':left, 'top':top, 'width':width, 'height':height};}; pos.getCenter = function(o){var c = this.get(o);if(c==null){return null;}c.left = c.left +(c.width/2);c.top = c.top +(c.height/2);return c;};return pos;})(); var enabletip=false
var tipobj=null; var pointerobj=null; function ietruebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(objId,thetext, thewidth, thecolor){ var obj = document.getElementById(objId); if (thetext == "") return; if (tipobj == null) { tipobj = document.createElement("DIV"); tipobj.id = "dhtmltooltip"; document.body.appendChild(tipobj);}
if (pointerobj == null) { pointerobj = document.createElement("DIV"); pointerobj.id = "dhtmlpointer"; pointerobj.innerHTML = "<img src=\"/lib/img/arrow_tip_up.gif\">"; document.body.appendChild(pointerobj);}
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"; if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor; tipobj.innerHTML=thetext; enabletip=true; positiontip(objId); return false;}
function positiontip(objId){ if (enabletip){ document.onclick=hideddrivetip; var offsetfromcursorX=12
var offsetfromcursorY=10
var offsetdivfrompointerX=10
var offsetdivfrompointerY=14
var obj = document.getElementById(objId); var offsetX = 0; var offsetY = 0; if (obj.offsetParent) { obj.offsetParent.onscroll=hideddrivetip;}
var nondefaultpos=false; var objPos = getObjectPosition(obj); var curX=objPos["x"]-offsetX; var curY=objPos["y"]-offsetY; if ((curX+tipobj.offsetWidth) > document.body.scrollWidth) { curX = objPos["x"]-offsetX-tipobj.offsetWidth+40; offsetfromcursorX = tipobj.offsetWidth-30;} else if (curY+tipobj.offsetHeight > document.body.offsetHeight) { }
var tooltipX = curX; var tooltipY = curY+offsetfromcursorY+offsetdivfrompointerY; var pointerX = curX+offsetfromcursorX; var pointerY = curY+offsetfromcursorY; tipobj.style.left = tooltipX+"px"; tipobj.style.top=tooltipY+"px"; pointerobj.style.left = pointerX+"px"; pointerobj.style.top=pointerY+"px"; tipobj.style.visibility="visible"; pointerobj.style.visibility=(!nondefaultpos)?"visible":"hidden";}
}
function hideddrivetip(){ enabletip=false; tipobj.style.visibility="hidden"; pointerobj.style.visibility="hidden"; tipobj.style.left="-1000px"; tipobj.style.backgroundColor=''; tipobj.style.width='';}
function createRequestObject() { var ro; var browser = navigator.appName; if (browser == "Microsoft Internet Explorer") { ro = new ActiveXObject("Microsoft.XMLHTTP");} else { ro = new XMLHttpRequest();}
return ro;}
function writeObject(str) {document.write(str);}; function writeTag(tagName,tagParams,obj) { var str = '<'+tagName+' '; for (var p in tagParams) { str += p+'="'+tagParams[p]+'" ';}
str += '</'+tagName+'>'; if (obj) obj.innerHTML = str; else return str;}
function FlashTag(src, width, height, version)
{ if (arguments.length < 4)
{ throw new Exception('RequiredParameterException', 'You must pass in a src, width, height, and version when creating a FlashTag.');}
this.src = src; this.width = width; this.height = height; this.version = version; this.id = null; this.flashVars = null; this.flashVarsStr = null; this.genericParam = new Object(); this.ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;}
FlashTag.prototype.setSource = function(src)
{ this.src = src;}
FlashTag.prototype.setWidth = function(w)
{ this.width = width;}
FlashTag.prototype.setHeight = function(h)
{ this.h = height;}
FlashTag.prototype.setVersion = function(v)
{ this.version = v;}
FlashTag.prototype.setId = function(id)
{ this.id = id;}
FlashTag.prototype.setBgcolor = function(bgc)
{ if (bgc.charAt(0) != '#')
{ bgc = '#' + bgc;}
this.genericParam['bgcolor'] = bgc;}
FlashTag.prototype.addFlashVars = function(fvs)
{ this.flashVarsStr = fvs;}
FlashTag.prototype.addFlashVar = function(n, v)
{ if (this.flashVars == null)
{ this.flashVars = new Object();}
this.flashVars[n] = v;}
FlashTag.prototype.removeFlashVar = function(n)
{ if (this.flashVars != null)
{ this.flashVars[n] = null;}
}
FlashTag.prototype.setSwliveconnect = function(swlc)
{ this.genericParam['swliveconnect'] = swlc;}
FlashTag.prototype.setPlay = function(p)
{ this.genericParam['play'] = p;}
FlashTag.prototype.setLoop = function(l)
{ this.genericParam['loop'] = l;}
FlashTag.prototype.setMenu = function(m)
{ this.genericParam['menu'] = m;}
FlashTag.prototype.setQuality = function(q)
{ if (q != 'low' && q != 'high' && q != 'autolow' && q != 'autohigh' && q != 'best')
{ throw new Exception('UnsupportedValueException', 'Supported values are "low", "high", "autolow", "autohigh", and "best".');}
this.genericParam['quality'] = q;}
FlashTag.prototype.setScale = function(sc)
{ if (sc != 'showall' && sc != 'noborder' && sc != 'exactfit')
{ throw new Exception('UnsupportedValueException', 'Supported values are "showall", "noborder", and "exactfit".');}
this.genericParam['scale'] = sc;}
FlashTag.prototype.setAlign= function(a)
{ if (a != 'l' && a != 't' && a != 'r' && a != 'b')
{ throw new Exception('UnsupportedValueException', 'Supported values are "l", "t", "r" and "b".');}
this.genericParam['align'] = a;}
FlashTag.prototype.setSalign= function(sa)
{ if (sa != 'l' && sa != 't' && sa != 'r' && sa != 'b' && sa != 'tl' && sa != 'tr' && sa != 'bl' && sa != 'br')
{ throw new Exception('UnsupportedValueException', 'Supported values are "l", "t", "r", "b", "tl", "tr", "bl" and "br".');}
this.genericParam['salign'] = sa;}
FlashTag.prototype.setWmode = function(wm)
{ if (wm != 'window' && wm != 'opaque' && wm != 'transparent')
{ throw new Exception('UnsupportedValueException', 'Supported values are "window", "opaque", and "transparent".');}
this.genericParam['wmode'] = wm;}
FlashTag.prototype.setBase = function(base)
{ this.genericParam['base'] = base;}
FlashTag.prototype.setAllowScriptAccess = function(sa)
{ if (sa != 'never' && sa != 'always')
{ throw new Exception('UnsupportedValueException', 'Supported values are "never" and "always".');}
this.genericParam['allowScriptAccess'] = sa;}
FlashTag.prototype.toString = function()
{ var flashTag = new String(); if (this.ie)
{ flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '; if (this.id != null)
{ flashTag += 'id="'+this.id+'" ';}
flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" '; flashTag += 'width="'+this.width+'" '; flashTag += 'height="'+this.height+'">'; flashTag += '<param name="movie" value="'+this.src+'"/>'; for (var n in this.genericParam)
{ if (this.genericParam[n] != null)
{ flashTag += '<param name="'+n+'" value="'+this.genericParam[n]+'"/>';}
}
if (this.flashVars != null)
{ var fv = this.getFlashVarsAsString(); if (fv.length > 0)
{ flashTag += '<param name="flashvars" value="'+fv+'"/>';}
}
flashTag += '</object>';}
else
{ flashTag += '<embed src="'+this.src+'"'; flashTag += ' width="'+this.width+'"'; flashTag += ' height="'+this.height+'"'; flashTag += ' type="application/x-shockwave-flash"'; if (this.id != null)
{ flashTag += ' name="'+this.id+'"';}
for (var n in this.genericParam)
{ if (this.genericParam[n] != null)
{ flashTag += (' '+n+'="'+this.genericParam[n]+'"');}
}
if (this.flashVars != null)
{ var fv = this.getFlashVarsAsString(); if (fv.length > 0)
{ flashTag += ' flashvars="'+fv+'"';}
}
flashTag += ' pluginspage="http://www.macromedia.com/go/getflashplayer">'; flashTag += '</embed>';}
return flashTag;}
FlashTag.prototype.write = function(doc)
{ doc.write(this.toString());}
FlashTag.prototype.getFlashVarsAsString = function()
{ var qs = new String(); for (var n in this.flashVars)
{ if (this.flashVars[n] != null)
{ qs += (escape(n)+'='+escape(this.flashVars[n])+'&');}
}
if (this.flashVarsStr != null)
{ return qs + this.flashVarsStr;}
return qs.substring(0, qs.length-1);}

