// JavaScript Document - LAST MODIFICATION: 26-11-2008 v2.2
// MADE BY: RottenEye @ dbwt | www.dbwt.co.uk (Please don't remove this line)
// If you have any doubt referring to this document please don't be afraid, contact me at rotten_eye@iol.pt

var dbwt=new Object();dbwt.browserVer=null;dbwt.getBrowserVer=function(){if(document.all&&navigator.language)
return'opera';else if(!document.all)
return'gecko';else if(document.all&&!navigator.language){if(-1==navigator.appVersion.indexOf('MSIE 7')){return"ie6";}else if(-1!=navigator.appVersion.indexOf('MSIE 7'))
return"ie7";}}
dbwt.getBrowser=function(browser){browser=browser.toLowerCase();if(this.browserVer===browser)
return true;else if(browser=='ie'&&this.browserVer.substr(0,2)==browser)
return true;return false;}
dbwt.addonLoadEvent=function(functionName,browser,replaceEvt){browser=browser.toLowerCase();if(!replaceEvt)var replaceEvt=false;if(browser!="all"&&this.browserVer!=browser){if(this.browserVer.substr(0,2)!=browser)
return false;}
if(functionName.substr(functionName.length-1,1)!=')'&&functionName.substr(functionName.length-1,1)!=';')
functionName+='();';else if(functionName.substr(functionName.length-1,1)!=';')
functionName+=';';return this.setEvent(window,'onload',functionName,replaceEvt);}
dbwt.addonUnloadEvent=function(functionName,browser,replaceEvt){browser=browser.toLowerCase();if(!replaceEvt)var replaceEvt=false;if(browser!='all'&&this.browserVer!=browser){if(this.browserVer.substr(0,2)!=browser)
return false;}
if(functionName.substr(functionName.length-1,1)!=')'&&functionName.substr(functionName.length-1,1)!=';')
functionName+='();';else if(functionName.substr(functionName.length-1,1)!=';')
functionName+=';';return this.setEvent(window,'onunload',functionName,replaceEvt);}
dbwt.addEventToElements=function(element,_event,executeExp,property,propValue,replaceEvent){var elmts;if(!_event)var _event='onclick';if(!replaceEvent)var replaceEvent=false;if(executeExp.substr(executeExp.length-1,1)!=';')executeExp+=';';if(typeof element=='object')
return this.setEvent(element,_event,executeExp,replaceEvent);else
elmts=document.getElementsByTagName(element);switch(property){case'class':if(this.getBrowser('ie'))
property='className';break;case'className':if(!this.getBrowser('ie'))
property='class';break;}
for(var k=0,len=elmts.length;k<len;k++){if(this.validateElement(elmts[k],property,propValue))
this.setEvent(elmts[k],_event,executeExp,replaceEvent);}}
dbwt.removeEventFromElements=function(element,_event,expToRem,property,propValue){var elmts;if(!_event)var _event='onclick';if(typeof element=='object')
return this.removeEvent(element,_event,expToRem);else
elmts=document.getElementsByTagName(element);switch(property){case'class':if(this.getBrowser('ie'))
property='className';break;case'className':if(!this.getBrowser('ie'))
property='class';break;}
for(var k=0,len=elmts.length;k<len;k++){if(this.validateElement(elmts[k],property,propValue))
this.removeEvent(elmts[k],_event,expToRem);}}
dbwt.getElements=function(root,elemToFind,property,propValue,maxNumElems){var elmsFound,k,rslt,a_pos,rslt1;if(!root){root=document;}else if(typeof root=='string'){root=document.getElementsByTagName(root);root=root[0];}
if(!elemToFind)var elemToFind='body';if(!maxNumElems)var maxNumElems=null;else maxNumElems=parseInt(maxNumElems);elmsFound=root.getElementsByTagName(elemToFind);switch(property){case'class':if(this.getBrowser('ie'))
property='className';break;case'className':if(!this.getBrowser('ie'))
property='class';break;}
rslt=new Array();a_pos=0;for(k=elmsFound.length;0<k--;){if(this.validateElement(elmsFound[k],property,propValue)){rslt[a_pos]=elmsFound[k];a_pos++;}}
if(maxNumElems===null)return rslt
if(maxNumElems<0){if(maxNumElems==-1)return rslt[0];maxNumElems=maxNumElems*-1;rslt1=new Array();a_pos=0;for(k=0;k<maxNumElems;k++){rslt1[a_pos]=rslt[k];a_pos++;}
return rslt1;}else{if(maxNumElems==1)return rslt[rslt.length-1];maxNumElems=(rslt.length-maxNumElems)-1;rslt1=new Array();a_pos=0;for(k=rslt.length;maxNumElems<k--;){rslt1[a_pos]=rslt[k];a_pos++;}
return rslt1;}}
dbwt.setScroll=function(obj,x,y){if(typeof obj=='string')
obj=eval(obj);obj.scrollTo(x,y);}
dbwt.urlencode=function(url){return escape(url).replace(/\+/g,'%2B').replace(/\"/g,'%22').replace(/\'/g,'%27').replace(/\//g,'%2F');}
dbwt.navigate=function(url,target,history){if(!target)target='_self';if(!history)history=true;if(target=='_blank'){return false;}else if(target=='_self'){if(history==true)window.location.href=url;else window.location.replace(url);}else if(target=='_top'){if(history==true)top.location.href=url;else top.location.replace(url);}else{if(history==true)document.frames[target].location.href=url;else document.frames[target].location.replace(url);}}
dbwt.OpenWindow=function(url,pName,_width,_height,userFeatures){var wFeatures;if(!(_width==null||_height==null)){if(screen){var leftpos=(screen.width/2)-(_width/2);var toppos=((screen.height/2)-(_height/2))-20;}
if(userFeatures){wFeatures='';if(userFeatures.indexOf('width=')==-1)
wFeatures+='width='+_width+',';if(userFeatures.indexOf('height=')==-1)
wFeatures+='height='+_height+',';if(userFeatures.indexOf('top=')==-1)
wFeatures+='top='+toppos+',';if(userFeatures.indexOf('left=')==-1)
wFeatures+='left='+leftpos+',';wFeatures+=userFeatures;if(wFeatures.substr(wFeatures.length-1,1)==',')
wFeatures=wFeatures.substr(0,wFeatures.length-1);}else{wFeatures='width='+_width+',height='+_height+',top='+toppos+',left='+leftpos;}
return window.open(url,pName,wFeatures);}else
return window.open(url,pName);}
dbwt.display_text_banner=function(box,text,num_spaces,speed,_1){var fText;if(typeof box=='string')box=document.getElementById(box);if(!text)var text=box.value;if(!_1){for(var k=0;k<=num_spaces;k++)
text+=" ";}else
text=text.substr(1)+text.substr(0,1);box.value=text;return setTimeout("dbwt.display_text_banner('"+box.id+"', null, "+num_spaces+', '+speed+', true)',speed);}
dbwt.htmlentities=function(_string,quoteStyle){if(!quoteStyle)quoteStyle='ENT_QUOTES';_string=_string.replace(/[&]/gi,'&amp;');_string=_string.replace(/[<]/gi,'&lt;');_string=_string.replace(/[>]/gi,'&gt;');if(quoteStyle=='ENT_COMPAT'){_string=_string.replace(/["]/gi,'&quot;');}else if(quoteStyle=='ENT_QUOTES'){_string=_string.replace(/["]/gi,'&quot;');_string=_string.replace(/[']/gi,'&#39;');}
return _string;}
dbwt.correctPNG=function(){var img,imgName,imgID,imgClass,imgTitle,imgStyle,strNewHTML;for(var i=0,len=document.images.length;i<len;i++){img=document.images[i];if(typeof img!=='object')continue;imgName=img.src.toLowerCase();if(imgName.substr(imgName.length-3)=='png'){imgID=(img.id)?('id="'+img.id+'" '):('');imgClass=(img.className)?('class="'+img.className+'" '):('');imgTitle=(img.title)?('title="'+img.title+'" '):('title="'+img.alt+'" ');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;strNewHTML='<span '+imgID+imgClass+imgTitle
+' style="'+'width:'+img.width+'px; height:'+img.height+'px;'+imgStyle
+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'
+'(src=\''+imgName+'\', sizingMethod=\'image\');"></span>';img.outerHTML=strNewHTML;i=i-1;}}}
dbwt.getPageRealSize=function(){if(document.documentElement)
var _document=document.documentElement;else
var _document=document.body;if(window.innerHeight&&window.scrollMaxY){yWithScroll=window.innerHeight+window.scrollMaxY;xWithScroll=window.innerWidth+window.scrollMaxX;}else if(_document.scrollHeight>_document.offsetHeight){yWithScroll=_document.scrollHeight;xWithScroll=_document.scrollWidth;}else{yWithScroll=_document.offsetHeight+_document.offsetTop;xWithScroll=_document.offsetWidth+_document.offsetLeft;}
arrayPageSizeWithScroll=new Array(xWithScroll,yWithScroll);return arrayPageSizeWithScroll;}
dbwt.setFlashMeasures=function(objID,minWidth,minHeight,maxWidth,maxHeight){if(!minWidth)minWidth=0;if(!minHeight)minHeight=0;if(!maxWidth)maxWidth=0;if(!maxHeight)maxHeight=0;this.setEvent(window,'onload',"dbwt.flash_targetFlashObject = document.getElementById('"+objID+"');",false);this.setEvent(window,'onload','dbwt.onResizeRepairFlashMeasures('+minWidth+', '+minHeight+', '+maxWidth+', '+maxHeight+');',false);this.setEvent(window,'onresize','dbwt.onResizeRepairFlashMeasures('+minWidth+', '+minHeight+', '+maxWidth+', '+maxHeight+');',false);}
dbwt.parseUrl=function(url){var sArgs;var result=url.match(/(https?:\/\/)([a-zA-Z0-9_\-\.]+):?([0-9]+)?\/?([^?#]*)?\??([^#]*)?#?(.*)?/);if(!result[3])result[3]=null;if(!result[4])result[4]=null;if(!result[5])result[5]=null;else{sArgs=result[5].split('&');result[5]=new Array();for(var i in sArgs){if(sArgs[i]=='')continue;result[5][sArgs[i].slice(0,sArgs[i].indexOf('='))]=unescape(sArgs[i].slice(sArgs[i].indexOf('=')+1));}}
if(!result[6])result[6]=null;return{protocol:result[1].replace('//',''),host:result[2],port:result[3],pathname:result[4],search:result[5],hash:result[6]};}
dbwt.detectPlugin=function(pluginName){var k,ieOnWin;ieOnWin=(this.getBrowser('ie')&&navigator.userAgent.indexOf('Win')!=-1)?(true):(false);switch(pluginName){case'pdf':case'PDF':case'acrobat':case'Acrobat':case'Acrobat Reader':case'acrobat reader':case'Adobe Acrobat':case'adobe acrobat':case'Adobe Acrobat Reader':case'adobe acrobat reader':if(ieOnWin){pluginName=['AcroPDF.PDF.1','PDF.PdfCtrl.1'];for(var k=2;k<10;k++)
pluginName.push('PDF.PdfCtrl.'+k);}else
pluginName='Acrobat';break;case'excel':case'Excel':pluginName=(ieOnWin)?('Excel.Application'):('Excel');break;case'Flash':case'flash':case'flash player':case'Flash Player':pluginName=(ieOnWin)?(['ShockwaveFlash.ShockwaveFlash','ShockwaveFlash.ShockwaveFlash.1']):('Shockwave Flash');break;case'Shockwave':case'shockwave':case'Shockwave Player':case'shockwave player':pluginName=(ieOnWin)?('SWCtl.SWCtl'):('Shockwave for Director');break;case'QuickTime':case'quicktime':pluginName=(ieOnWin)?(['QuickTime.QuickTime','QuickTime.QuickTime.4','QuickTimeCheckObject.QuickTimeCheck']):('QuickTime');break;case'RealPlayer':case'realplayer':if(ieOnWin)
pluginName=['RealPlayer','RealVideo.RealVideo(tm) ActiveX Control (32-bit)','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)','rmocx.RealPlayer G2 Control.1','rmocx.RealPlayer G2 Control'];else
pluginName='RealPlayer';break;case'windows media player':case'Windows Media Player':case'Media Player':case'media player':pluginName=(ieOnWin)?(['MediaPlayer.MediaPlayer.1','WMPlayer.OCX']):('Windows Media');break;case'java':case'Java':pluginName=(ieOnWin)?(['JavaPlugin','JavaWebStart.isInstalled','JavaWebStart.isInstalled.1.6.0.0','JavaPlugin.150_07']):('Java');break;case'silverlight':pluginName=(ieOnWin)?('AgControl.AgControl'):('Silverlight');break;default:return-1;}
if(ieOnWin){if('String'==typeof pluginName){try{new ActiveXObject(pluginName);return true;}
catch(e){return false;}}else{for(k in pluginName){try{new ActiveXObject(pluginName[k]);return true;}
catch(e){}}}}else{if(navigator.plugins&&navigator.plugins.length>0){var pluginsArrayLength=navigator.plugins.length;for(k=0;k<pluginsArrayLength;k++){if(navigator.plugins[k].name.indexOf(pluginName)>=0||navigator.plugins[k].description.indexOf(pluginName)>=0)
return true;}}}
return false;}
dbwt.numberFormat=function(number,decimals,dec_point,thousands_sep){var n=number,c=isNaN(decimals=Math.abs(decimals))?2:decimals;var d=dec_point==undefined?".":dec_point;var t=thousands_sep==undefined?",":thousands_sep,s=n<0?"-":"";var i=parseInt(n=Math.abs(+n||0).toFixed(c))+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"");}
dbwt.phpSerialize=function(val){switch(typeof(val)){case'number':if(val==NaN||val==Infinity)return'i:0;';return(Math.floor(val)==val?'i':'d')+':'+val+';';case'boolean':return'b:'+(val?'1':'0')+';';case'string':return's:'+val.length+':"'+val+'";';case'object':if(val==null)
return'N;';else{var indexes=0;var t='';for(var key in val){if(key==parseInt(key))key=parseInt(key);t+=this.phpSerialize(key,true)+this.phpSerialize(val[key]);indexes++;}
return'a:'+indexes+':{'+t+'}';}
case'function':return false;case'undefined':return'N;';}
return false;}
dbwt.setEvent=function(elem,_event,_exp,replaceEvt){if(!elem||!_exp)return false;if(!_event)var _event='onclick';if(!replaceEvt)var replaceEvt=false;var curEvt,curEvt_str,newFunction;_event=_event.toLowerCase();curEvt=eval('elem.'+_event);curEvt_str=(typeof curEvt=='function')?(' '+curEvt):('');curEvt_str=curEvt_str.replace(/return[\s]/ig,'');curEvt_str=curEvt_str.replace(/(.|\r\n|\n)*[\{]/,'');curEvt_str=curEvt_str.replace(/[\}][\s]?$/,'');if(replaceEvt===true)
newFunction=new Function(_exp);else
newFunction=new Function(curEvt_str+_exp);eval('elem.'+_event+' = '+newFunction);return true;}
dbwt.validateElement=function(e,p,pv){var t;if(p){if(!(t=e.getAttribute(p)))return false;if(pv&&(p=='class'||p=='className'))
return(t==pv||t.indexOf(' '+pv+' ')>=0||t.substr(0,pv.length+1)==pv+' '||t.substr(t.length-(pv.length+1))==' '+pv)?(true):(false);else if(pv)
return(t==pv)?(true):(false);else
return(t)?(true):(false);}
return true;}
dbwt.removeEvent=function(elem,_event,expToRem){var re,curEvt,curEvt_str,newFunction;curEvt=eval('elem.'+_event);if(typeof curEvt!='function')return false;else curEvt_str=''+curEvt;if(expToRem.substr(expToRem.length-1)==';')
expToRem=expToRem.substr(0,expToRem.length-1);curEvt_str=curEvt_str.replace(/(.|\r\n|\n)*[\{][\n\r]*/,'');curEvt_str=curEvt_str.replace(/[\}][\s\n\r\n]?$/,'');re=eval("/(return[\\s]+)?"+expToRem+"(.)*[;\\n\\r$]+/gi");curEvt_str=curEvt_str.replace(re,"");newFunction=new Function(curEvt_str);eval('elem.'+_event+' = '+newFunction);return true;}
dbwt.onResizeRepairFlashMeasures=function(minWidth,minHeight,maxWidth,maxHeight){var fl_obj=this.flash_targetFlashObject;if(!fl_obj)return false;var sWidth=document.body.clientWidth;var sHeight=document.body.clientHeight;if(sWidth!=null&&sWidth>maxWidth)
fl_obj.style.width=maxHeight+'px';else if(sWidth!=null&&sWidth<=minWidth)
fl_obj.style.width=minWidth+'px';else
fl_obj.style.width='100%';if(sHeight!=null&&sHeight>maxHeight)
fl_obj.style.height=maxHeight+'px';if(sHeight!=null&&sHeight<=minHeight)
fl_obj.style.height=minHeight+'px';else
fl_obj.style.height='100%';}
dbwt.init=function(){if(this.getBrowser('IE6'))
this.correctPNG();for(var k in this){if(typeof this[k]!='object')continue;if(typeof this[k].init=='function')this[k].init();}}
dbwt.browserVer=dbwt.getBrowserVer();dbwt.setEvent(window,'onload','dbwt.init();',false);