
OneWeb.UI={};
OneWeb.UI.TabControl=function(headerId,containerId){
this.headerId=headerId;
this.containerId=containerId;
this.tabIds=[];
this.tabs=[];
this.sections=[];
this.tablist=null;
this.container=null;}
OneWeb.UI.TabControl.controls={};
OneWeb.UI.TabControl.tabHeaderClassRx=new RegExp("(^|\\s)ow_tab_container(\\s|$)");
OneWeb.UI.TabControl.tabListClassRx=new RegExp("(^|\\s)ow_tab_nav(\\s|$)");
OneWeb.UI.TabControl.tabSectionClassRx=new RegExp("(^|\\s)ow_tab_section(\\s|$)");
OneWeb.UI.TabControl.prototype={
"type":OneWeb.UI.TabControl,
"toggleTab":function(tabId){
if(this.tablist!=null){
for(var i=0;i<this.tabs.length;i++){
if(this.tabs[i].getAttribute("tabid")==tabId){
this.tabs[i].className="active";
this.sections[i].style.display="block";}else{
this.tabs[i].className="";
this.sections[i].style.display="none";}}}
this.currentTab=tabId;
return false;},
"clickTab":function(e){
if(!e)var e=window.event;
if(e.target)elm=e.target;
else elm=e.srcElement;
while(elm.tagName.toLowerCase()!="li")elm=elm.parentNode;
var tabid;
if(elm!=null){
tabid=elm.getAttribute("tabid");
while(elm.tagName.toLowerCase()!="div"||typeof(OneWeb.UI.TabControl.controls[elm.id])=="undefined")elm=elm.parentNode;
if(elm!=null)
OneWeb.UI.TabControl.controls[elm.id].toggleTab(tabid);}
if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}
return false;},
"initialize":function(currentTabId){
try{
var lists=document.getElementById(this.headerId).getElementsByTagName("ul");
for(var i=0;i<lists.length;i++){
if(this.type.tabListClassRx.test(lists[i].className)){
this.tablist=lists[i];
break;}}
if(this.tablist!=null){
this.tabs=this.tablist.getElementsByTagName("li");}}catch(e){
return;}
this.container=document.getElementById(this.containerId);
if(this.container!=null){
var divs=this.container.getElementsByTagName("div");
var i=-1;
for(div in divs){
div=divs[div];
if(this.type.tabSectionClassRx.test(div.className)){
i++;
if(div.getAttribute("id")=="")
div.setAttribute("id",this.containerId+"_"+i);
this.tabIds.push(div.id);
this.sections.push(div);
if(this.tabs.length>i&&this.tabs[i]!=null){
var li=this.tabs[i];
var a=null;
li.setAttribute("tabid",div.id);
a=li.getElementsByTagName("a").item(0);
if(a!=null){
a.href="javascript:void(0);";
OneWeb.Util.addEvent(a,"click",this.clickTab);}}}}}else{
return;}
this.type.controls[this.headerId]=this;
if(this.sections.length>0){
if(currentTabId!=null)
this.toggleTab(currentTabId);
else
this.toggleTab(this.tabIds[0]);}}};
OneWeb.UI.PairedDropDownController=function(parentId,childId,attributeName){
this.parent=document.getElementById(parentId);
this.child=document.getElementById(childId);
this.attributeName=attributeName;
this.options=null;}
OneWeb.UI.PairedDropDownController.controllers={};
OneWeb.UI.PairedDropDownController.prototype={
"type":OneWeb.UI.PairedDropDownController,
"updateChild":function(){
if(this.parent&&this.child){
this.child.options.length=0;
var opts=this.options[this.parent.options[this.parent.selectedIndex].value];
if(this.parent.selectedIndex!=0)
this.child.options.add(this.options[""][""]);
if(opts){
for(var i in opts)
this.child.options.add(opts[i]);
if(this.parent.selectedIndex!=0&&this.child.options.length!=0){
this.child.focus();}}}
return false;},
"changeItem":function(e){
if(!e)var e=window.event;
if(e.target)elm=e.target;
else elm=e.srcElement;
var parentId;
if(elm!=null){
parentId=elm.id;
OneWeb.UI.PairedDropDownController.controllers[elm.id].updateChild();}
if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}
return false;},
"initialize":function(){
if(this.parent!=null&&this.child!=null){
this.options=new Object();
var parentVal,childOpt;
for(var i=0;i<this.parent.options.length;i++){
parentVal=this.parent.options[i].value;
if(this.options[parentVal]==null)
this.options[parentVal]=new Object();}
for(var i=0;i<this.child.options.length;i++){
childOpt=this.child.options[i];
parentVal=childOpt.getAttribute(this.attributeName);
if(parentVal==null&&i==0)
parentVal="";
if(parentVal!=null&&this.options[parentVal]!=null&&this.options[parentVal][childOpt.value]==null)
this.options[parentVal][childOpt.value]=childOpt;}
this.type.controllers[this.parent.id]=this;
OneWeb.Util.addEvent(this.parent,"change",this.changeItem,false);
this.updateChild();}}};
OneWeb.UI.ProgressBar=function(divId,options){
if(typeof(divId.innerHTML)!=="undefined")
this.element=divId;
else
this.element=document.getElementById(divId);
if(!this.element)
return;
this.element.className=this.type.progressContainerClass;
this.bar=document.createElement("div");
this.bar.className=this.type.progressBarClass;
this.element.appendChild(this.bar);
this.options=options;
var lower=0;
this.type.prototype.getLowerBound=function(){return lower;};
this.type.prototype.setLowerBound=function(value){if(value<=upper)lower=value;};
var upper=100;
this.type.prototype.getUpperBound=function(){return upper;};
this.type.prototype.setUpperBound=function(value){if(value>=lower)upper=value;};
this.type.prototype.setBounds=function(lbound,ubound){if(lbound>=ubound){lower=lbound;upper=ubound;}};
var current=0;
this.type.prototype.getCurrent=function(){return current;}
this.type.prototype.setCurrent=function(value){if(value===null||(value>=lower&&value<=upper))current=value;}
var currentSpin=0;
this.type.prototype.getCurrentSpin=function(){return currentSpin;}
this.type.prototype.setCurrentSpin=function(value){if(!isNaN(value))currentSpin=value%100;}
this.text=null;
this.orientation="horizontal";
this.spin=false;
if(options!==null){
if(typeof(options.orientation)!=="undefined"){
if(options.orientation==="vertical")
this.orientation="vertical";
else
this.orientation="horizontal";}
if(typeof(options.spin)=="boolean")
this.spin=options.spin;
if(typeof(options.overlay)!=="undefined"){
this.overlay=document.createElement("img");
this.overlay.setAttribute("src",options.overlay);
this.bar.appendChild(this.overlay);}
if(typeof(options.text)!=="undefined"){
this.text=document.createElement("span");
this.text.className=this.type.progressTextClass;
if(options.text==="inside"){
this.bar.appendChild(this.text);}else{
this.element.appendChild(this.text);}}}
this.update();}
OneWeb.UI.ProgressBar.progressBarClass="ow_progressBar";
OneWeb.UI.ProgressBar.progressTextClass="ow_progressText";
OneWeb.UI.ProgressBar.progressContainerClass="ow_progressBarContainer";
OneWeb.UI.ProgressBar.prototype={
"type":OneWeb.UI.ProgressBar,
"set":function(value){
this.setCurrent(value);
this.update();},
"getText":function(value){
return(this.text===null)?null:this.text.innerHTML;},
"setText":function(value){
if(this.text!==null){
this.text.innerHTML=value;}},
"update":function(){
if(this.spin)
this.setCurrentSpin((this.getCurrentSpin()+10));
var pos,spin,text;
if(this.getCurrent()===null){
pos=0;
switch(this.getText()){
case "/":text="-";pos=0;break;
case "-":text="\\";pos=0;break;
case "\\":text="|";pos=0;break;
case "|":text="/";pos=0;break;
default:text="-";break;}}else if(this.getUpperBound()!==this.getLowerBound()){
var percent=((this.getCurrent()-this.getLowerBound())*100)/(this.getUpperBound()-this.getLowerBound());
pos=(100-percent);
text=(Math.round(percent)+"%");}
spin=this.getCurrentSpin();
if(this.orientation=="horizontal")
this.bar.style.backgroundPosition=pos+"% "+spin+"%";
else
this.bar.style.backgroundPosition=spin+"% "+pos+"%";
this.setText(text);},
"initialize":function(){}}
OneWeb.UI.TextResizer=function(config){
this.smaller=document.getElementById(config.smaller_id);
this.larger=document.getElementById(config.larger_id);
this.resetter=config.reset_id?document.getElementById(config.reset_id):null;
this.link=document.getElementById(config.stylesheet_id);
this.indexSheets(config.sizes);
this.path=config.path;
this._default=(isNaN(parseInt(config["default"])))?this.indexFromName(config["default"]):parseInt(config["default"]);
if(this._default==-1&&this.link!==null){
if(this.link.tagName.toUpperCase()=="LINK")
this._default=this.indexFromSheet(this.link.href);
else if(this.link.tagName.toUpperCase()=="STYLE")
this._default=this.indexFromSheet(this.link.innerHTML);}
this._current=this._default;
this._disabledClass=config.disable_class;
this._cookieName=config.cookie;
this._expiry=config.expiry;
this._engine=OneWeb.Util.engine;
var me=this;
this._reduce=function(e){me.reduce(e);};
this._enlarge=function(e){me.enlarge(e);};
this._reset=function(e){me.reset(e);};
if(this.smaller)OneWeb.Util.addEvent(this.smaller,"click",this._reduce,false);
if(this.larger)OneWeb.Util.addEvent(this.larger,"click",this._enlarge,false);
if(this.resetter)OneWeb.Util.addEvent(this.resetter,"click",this._reset,false);
if(this.readCookie()&&!this.sheetIsCurrent()){
this.setSheet();}else if(this.validIndex(this._current)&&this.link==null){
this.setSheet();}
if(this.smaller&&!this.validIndex(this._current-1))this.disableLink(this.smaller);
if(this.larger&&!this.validIndex(this._current+1))this.disableLink(this.larger);
if(this.resetter&&this._current==this._default)this.disableLink(this.resetter);
if(config.resizer_id&&config.resizer_style){
var resizer=document.getElementById(config.resizer_id);
if(resizer){
var style=config.resizer_style.split("=");
resizer.style[style[0]]=style[1];}}};
OneWeb.UI.TextResizer.prototype={
"_current":0,
"reduce":function(e){
if(this.validIndex(this._current-1)){
this._current--;
this.setSheet();
this.setCookie();
if(!this.validIndex(this._current-1))
this.disableLink(this.smaller);
if(OneWeb.Util.hasClass(this.larger,this._disabledClass))
this.enableLink(this.larger);
if(this.resetter){
if(this._current!=this._default)
this.enableLink(this.resetter);
else if(this._current==this._default)
this.disableLink(this.resetter);}}
this.smaller.blur();
OneWeb.Util.preventDefault(e);
return false;},
"enlarge":function(e){
if(this.validIndex(this._current+1)){
this._current++;
this.setSheet();
this.setCookie();
if(!this.validIndex(this._current+1))
this.disableLink(this.larger);
if(OneWeb.Util.hasClass(this.smaller,this._disabledClass))
this.enableLink(this.smaller);
if(this.resetter){
if(this._current!=this._default)
this.enableLink(this.resetter);
else if(this._current==this._default)
this.disableLink(this.resetter);}}
this.larger.blur();
OneWeb.Util.preventDefault(e);
return false;},
"reset":function(e){
if(this.validIndex(this._default)){
this._current=this._default;
this.setSheet();
this.setCookie();
if(!this.validIndex(this._current-1))
this.disableLink(this.smaller);
else if(OneWeb.Util.hasClass(this.smaller,this._disabledClass))
this.enableLink(this.smaller);
if(!this.validIndex(this._current+1))
this.disableLink(this.larger);
else if(OneWeb.Util.hasClass(this.larger,this._disabledClass))
this.enableLink(this.larger);
this.disableLink(this.resetter);}
this.resetter.blur();
OneWeb.Util.preventDefault(e);
return false;},
"enableLink":function(link){
if(this._disabledClass)
OneWeb.Util.removeClass(link,this._disabledClass);
if(link.tagName.toUpperCase()==="A"&&link.getAttribute("_href")!==null){
link.href=link.getAttribute("_href");
link.removeAttribute("_href");
link.disabled=false;}},
"disableLink":function(link){
if(this._disabledClass)
OneWeb.Util.addClass(link,this._disabledClass);
if(link.tagName.toUpperCase()==="A"&&link.href.length>0){
link.setAttribute("_href",link.href);
link.href="";
link.disabled=true;}},
"setSheet":function(){
var isSheet=this.isSheet(this._current);
var sheet=(isSheet?this.path:"")+this.sheetFromIndex(this._current);
if(this.link!=null){
var me=this
if(this._engine.name=="Presto"){
setTimeout(function(){
if(isSheet&&me.link.tagName.toUpperCase()=="LINK"){
me.link.href=sheet;}else if(!isSheet&&me.link.tagName.toUpperCase()=="STYLE"){
me.link.innerHTML=sheet;}else if(isSheet&&me.link.tagName.toUpperCase()=="STYLE"){
me.link.parentNode.removeChild(me.link);
me.link=document.createElement("LINK");
if(me.link!==null){
me.link.rel="stylesheet";
me.link.type="text/css";
me.link.href=sheet;
document.getElementsByTagName("HEAD")[0].appendChild(me.link);}}else if(!isSheet&&me.link.tagName.toUpperCase()=="LINK"){
me.link.parentNode.removeChild(me.link);
me.link=document.createElement("STYLE");
if(me.link!==null){
me.link.innerHTML=sheet;
document.getElementsByTagName("HEAD")[0].appendChild(me.link);}}},10);}
else if(this._engine.name=="Trident"&&this._engine.version<=5&&isSheet){
var request=(window.XMLHttpRequest)?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");
var tmp=null;
if(me.link.tagName.toUpperCase()!=="LINK"){
tmp=me.link;
me.link=document.createElement("LINK");
if(me.link!==null){
me.link.rel="stylesheet";
me.link.type="text/css";
me.link.href=""
document.getElementsByTagName("HEAD")[0].appendChild(me.link);}}
request.onreadystatechange=function(){
if(request.readyState==4&&/(200|304)/.test(request.status.toString())){
me.link.href="";
me.link.href=sheet;
if(tmp!==null)
tmp.parentNode.removeChild(tmp);}};
request.open("GET",sheet,true);
request.send(null);}
else{
if(isSheet){
if(me.link.tagName.toUpperCase()!=="LINK"){
var tmp=me.link;
me.link=document.createElement("LINK");
if(me.link!==null){
me.link.rel="stylesheet";
me.link.type="text/css";
me.link.href=sheet;
me.link.onload=function(){tmp.parentNode.removeChild(tmp);this.onload=null;};
document.getElementsByTagName("HEAD")[0].appendChild(me.link);}}else
me.link.href=sheet;}else{
var tmp=me.link;
me.link=document.createElement("STYLE");
if(me.link!==null){
document.getElementsByTagName("HEAD")[0].appendChild(me.link);
if(me.link.styleSheet&&me.link.styleSheet.cssText!=null)
me.link.styleSheet.cssText=sheet;
else
me.link.appendChild(document.createTextNode(sheet));}
tmp.parentNode.removeChild(tmp);}}}else if(document.createElement){
if(isSheet){
var link=this.link=document.createElement("LINK");
if(link!==null){
link.rel="stylesheet";
link.type="text/css";
link.href=sheet;
document.getElementsByTagName("HEAD")[0].appendChild(link);}}else{
var link=this.link=document.createElement("STYLE");
if(link!==null){
document.getElementsByTagName("HEAD")[0].appendChild(link);
if(link.styleSheet&&link.styleSheet.cssText!=null)
link.styleSheet.cssText=sheet;
else
link.appendChild(document.createTextNode(sheet));}}}
if(OneWeb.Admin&&OneWeb.Admin.Overlays)
OneWeb.Admin.Overlays.initOverlays();},
"setCookie":function(){
var thedate=new Date();
thedate.setTime(thedate.getTime()+(this._expiry*24*60*60*1000));
var info=(this._current!==this._default)?"css_switch="+this.nameFromIndex(this._current):"";
if(info=="")
thedate.setTime(0);
document.cookie=this._cookieName+"="+info+";expires="+thedate.toGMTString()+";path=/";},
"readCookie":function(){
var cookie=null,css=null;
if(document.cookie&&document.cookie.indexOf(this._cookieName+"=")!=-1){
cookie=document.cookie.split(this._cookieName+"=")[1].split(";")[0].split("&");
for(var i=cookie.length-1;i>=0;i--){
cookie[i]=cookie[i].split("=");
if(cookie[i].length>1){
switch(cookie[i][0]){
case "css_switch":
css=cookie[i][1];
cookie[i]=cookie[i].join("=");
break;
default:cookie.splice(i,1);}}else{
css=cookie[i][0];
if(css.length>0)
cookie[i]="css_switch="+css;
else
cookie.splice(i,1);}}
cookie=cookie.join("&");
if(css==null)
return false;
if(isNaN(parseInt(css))){
css=this.indexFromName(css);}else
css=parseInt(css);
if(this.validIndex(css))
this._current=css;
else
css=null;}
return(css!==null);},
"indexSheets":function(sheets){
this._sheets=[];
for(name in sheets){
this._sheets[name]=this._sheets.length;
this._sheets[this._sheets.length]=[name,sheets[name],/^[^\s{}]*$/.test(sheets[name])];}},
"nameFromIndex":function(index){
if(this.validIndex(index)){
return this._sheets[index][0];}
return "";},
"sheetFromIndex":function(index){
if(this.validIndex(index)){
return this._sheets[index][1];}
return "";},
"indexFromName":function(name){
if(name in this._sheets){
return this._sheets[name];}
return -1;},
"isSheet":function(index){
if(this.validIndex(index)){
return this._sheets[index][2];}
return false;},
"indexFromSheet":function(sheet){
for(var i=0,l=this._sheets.length;i<l;i++)
if(this.isSheet(i)&&new RegExp(this.sheetFromIndex(i),"i").test(sheet))
return i;
else if(this.sheetFromIndex(i).replace(/\s|;/g,"").toUpperCase()==sheet.replace(/\s|;/g,"").toUpperCase())
return i;
return -1;},
"sheetIsCurrent":function(){
if(this.link==null)return false;
if(this.isSheet(this._current)){
return(this.link.tagName.toUpperCase()=="LINK")&&(new RegExp(this.sheetFromIndex(this._current),"i").test(this.link.href));}else{
return(this.link.tagName.toUpperCase()=="STYLE")&&(this.link.innerHTML.replace(/\s|;/g,"").toUpperCase()==this.sheetFromIndex(this._current).replace(/\s|;/g,"").toUpperCase());}},
"sheetFromName":function(name){
if(name in this._sheets){
return this._sheets[this._sheets[name]][1];}
return "";},
"validIndex":function(index){
return(index>=0&&index<this._sheets.length);}}
if(typeof($AA)!=='undefined'){
OneWeb.UI.Animations.RemoveAction=function(target,duration,fps){
if(typeof(duration)!=="undefined")delete duration;
OneWeb.UI.Animations.RemoveAction.initializeBase(this,[target,duration,fps]);}
OneWeb.UI.Animations.RemoveAction.prototype={
doAction:function(){
try{
OneWeb.Util.removeElement(this.get_target());}catch(ex){}}}
OneWeb.UI.Animations.RemoveAction.registerClass("OneWeb.UI.Animations.RemoveAction",$AA.Action);$AA.registerAnimation('removeAction',OneWeb.UI.Animations.RemoveAction);}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();

