/*
 * Titan Website JS
 * Copyright(c) 2009, Titan Internet Ltd.
 */


function popup(url,width,height){var newwindow=window.open(url,'defaultwin',['height=',height!=null?height:550,',width=',width!=null?width:550,',resizable=yes',',scrollbars=yes',].join(''));if(!newwindow){alert("Could not open window! You may have a popup blocker running."+"/n"+"  Please disable it to view this content.")}
else{if(window.focus){newwindow.focus()}}
return false;}
function confirmDialog(message){return confirm(message);}
function confirmDelete(){return confirm("Are you sure you wish to delete?");}
function refresh(){window.location.reload(false);}
function refreshParent(){opener.window.location.reload(false);}
function printPage(){window.print();return false;}
function getDom(el){if(!el||!document){return null;}
return typeof el=='string'?document.getElementById(el):el;}
function focusById(id){var el=getDom(id);if(el==null)
return;if(el.focus)
el.focus();}
function focusByClass(cls){var d=document;for(i=0;i<d.getElementsByTagName("*").length;i++){if(d.getElementsByTagName("*").item(i).className.indexOf(cls)!=-1){var el=d.getElementsByTagName("*").item(i);if(el.focus)
el.focus();}}}
function changeUrl(url){document.location=url;}
function createFormWin(form){var target=form.target;var args="width=550,height=610,location=0,scrollbars=0,menubar=0,resizable=0,toolbar=0,status=1,directories=0";var win=window.open('',form.target,args);if(typeof(focus)=="function")
win.focus();return true;}
function setVisible(el,flag){if(el==null)
return;el=getDom(el);if(el!=null)
if(el.style)
el.style.display=flag==true?'':'none';}
function getElementsByClassName(clsName){var retVal=new Array();var elements=document.getElementsByTagName("*");for(var i=0;i<elements.length;i++){if(elements[i].className.indexOf(" ")>=0){var classes=elements[i].className.split(" ");for(var j=0;j<classes.length;j++){if(classes[j]==clsName)
retVal.push(elements[i]);}}
else if(elements[i].className==clsName)
retVal.push(elements[i]);}
return retVal;}
function removeClass(el,clsName){var newVal=new Array();var el=getDom(el);if(el==null)
return;if(el.className.indexOf(" ")>=0){var classes=el.className.split(" ");for(var j=0;j<classes.length;j++){if(classes[j]!=clsName)
newVal.push(classes[j]);}
el.className=newVal.join('');}}
Function.prototype.createDelegate=function(obj,args,appendArgs){var method=this;return function(){var callArgs=args||arguments;if(appendArgs===true){callArgs=Array.prototype.slice.call(arguments,0);callArgs=callArgs.concat(args);}else if(typeof appendArgs=="number"){callArgs=Array.prototype.slice.call(arguments,0);var applyArgs=[appendArgs,0].concat(args);Array.prototype.splice.apply(callArgs,applyArgs);}
return method.apply(obj||window,callArgs);}};Function.prototype.defer=function(millis,obj,args,appendArgs){var fn=this.createDelegate(obj,args,appendArgs);if(millis){return setTimeout(fn,millis);}
fn();return 0;};if(!Array.indexOf){Array.prototype.indexOf=function(obj){for(var i=0;i<this.length;i++){if(this[i]==obj){return i;}}
return-1;}}
(function(){var ie=!!(window.attachEvent&&!window.opera);var wk=/webkit\/(\d+)/i.test(navigator.userAgent)&&(RegExp.$1<525);var fn=[];var run=function(){for(var i=0;i<fn.length;i++)
fn[i]();};var d=document;d.ready=function(f){if(!ie&&!wk&&d.addEventListener)
return d.addEventListener('DOMContentLoaded',f,false);if(fn.push(f)>1)
return;if(ie)
(function(){try{d.documentElement.doScroll('left');run();}
catch(err){setTimeout(arguments.callee,0);}})();else if(wk)
var t=setInterval(function(){if(/^(loaded|complete)$/.test(d.readyState))
clearInterval(t),run();},0);};})();Ti={};Ti.form={};

function getPageScroll(){var yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;}
arrayPageScroll=new Array('',yScroll)
return arrayPageScroll;}
function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}
function pause(numberMillis){var now=new Date();var exitTime=now.getTime()+numberMillis;while(true){now=new Date();if(now.getTime()>exitTime)
return;}}
function showMask()
{var objOverlay=document.getElementById('overlay');var objLightbox=document.getElementById('lightbox');var objLightboxDetails=document.getElementById('lightboxDetails');var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();objOverlay.style.width=(arrayPageSize[0]+'px');objOverlay.style.height=(arrayPageSize[1]+'px');objOverlay.style.display='block';var lightboxTop=arrayPageScroll[1]+((arrayPageSize[3]-35-parseInt(objLightbox.style.height))/2);var lightboxLeft=((arrayPageSize[0]-20-parseInt(objLightbox.style.width))/2);objLightbox.style.top=(lightboxTop<0)?"0px":lightboxTop+"px";objLightbox.style.left=(lightboxLeft<0)?"0px":lightboxLeft+"px";if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250);}
selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}
objLightbox.style.display='block';arrayPageSize=getPageSize();objOverlay.style.height=(arrayPageSize[1]+'px');return false;}
function hideMask()
{objOverlay=document.getElementById('overlay');objLightbox=document.getElementById('lightbox');objOverlay.style.display='none';objLightbox.style.display='none';selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible";}
document.onkeypress='';}

var tooltip=function(){var id='tt';var top=3;var left=3;var maxw=300;var speed=50;var timer=75;var endalpha=95;var alpha=0;var tt,t,c,b,h,hd,bd,cls;var ie=document.all?true:false;return{show:function(config){w=config.width,cls=config.cls;if(tt==null){tt=document.createElement('div');tt.className="x-tip";if(cls&&cls.length>0){tt.className=tt.className+" "+cls;}
tl=document.createElement('div');tl.className="x-tip-tl";tr=document.createElement('div');tr.className="x-tip-tr";tc=document.createElement('div');tc.className="x-tip-tc";tr.appendChild(tc);tl.appendChild(tr);ml=document.createElement('div');ml.className="x-tip-ml";mr=document.createElement('div');mr.className="x-tip-mr";mc=document.createElement('div');mc.className="x-tip-mc";hd=document.createElement('div');hd.className="x-tip-header";ht=document.createElement('div');ht.className="x-tip-header-text";bd=document.createElement('div');bd.className="x-tip-body";hd.appendChild(ht);mc.appendChild(hd);mc.appendChild(bd);mr.appendChild(mc);ml.appendChild(mr);bl=document.createElement('div');bl.className="x-tip-bl";br=document.createElement('div');br.className="x-tip-br";bc=document.createElement('div');bc.className="x-tip-bc";br.appendChild(bc);bl.appendChild(br);tt.appendChild(tl);tt.appendChild(ml);tt.appendChild(bl);document.body.appendChild(tt);tt.style.opacity=0;tt.style.filter='alpha(opacity=0)';document.onmousemove=this.pos;}
tt.style.display='block';bd.innerHTML=config.text;if(config.title)ht.innerHTML=config.title;tt.style.width=w?w+'px':'auto';if(!w&&ie){tl.style.display='none';bl.style.display='none';tt.style.width=tt.offsetWidth;tl.style.display='block';bl.style.display='block';}
if(tt.offsetWidth>maxw){tt.style.width=maxw+'px'}
h=parseInt(tt.offsetHeight)+top;clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(1)},timer);},pos:function(e){var u=ie?event.clientY+document.documentElement.scrollTop:e.pageY;var l=ie?event.clientX+document.documentElement.scrollLeft:e.pageX;tt.style.top=(u-h)+'px';tt.style.left=(l+left)+'px';},fade:function(d){var a=alpha;if((a!=endalpha&&d==1)||(a!=0&&d==-1)){var i=speed;if(endalpha-a<speed&&d==1){i=endalpha-a;}else if(alpha<speed&&d==-1){i=a;}
alpha=a+(i*d);tt.style.opacity=alpha*.01;tt.style.filter='alpha(opacity='+alpha+')';}else{clearInterval(tt.timer);if(d==-1){tt.style.display='none'}}},hide:function(){clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(-1)},timer);}};}();
