/*
 * Tämän tiedoston omistaa Tamnet Avoin Yhtiö.  Lähdekoodin kopioiminen,
 * jälleenmyynti tai muokkaus ilman omistajan kirjallista lupaa on
 * kielletty!
 *
 * Copyright 2009 Tamnet Avoin Yhtiö
 * http://www.tamnet.fi
 */
var CMSAPI=3;var TRANSLATIONS={"FI":new Array()};var ROOT;if(!ROOT)ROOT="";var LANG;if(!LANG)LANG="fi";var COUNTRY;if(!COUNTRY)COUNTRY="FI";var PROVIDED=new Array();var CHARSET="ISO-8859-1";function api_version(require){var eps=1.0e-6;if(require&&(Math.floor(CMSAPI+eps)!=Math.floor(require+eps)||CMSAPI+eps<require)){throw new Error("Invalid API version");}return CMSAPI;}function defined(v){return typeof(window[v])!="undefined";}function requires(mod){if(!PROVIDED[mod]){throw new Error("Missing module "+mod);}}function provides(mod){if(!PROVIDED[mod]){PROVIDED[mod]=1;}else{throw new Error("Duplicate module "+mod);}}function translate(phrase){phrase=phrase.replace(/^\s+|\s+$/g,'');phrase=phrase.replace(/\s+/g,' ');var t;var from=phrase.toLowerCase();if(TRANSLATIONS[from]!=null){t=TRANSLATIONS[from];}else{t=phrase;}var out="";var n=t.length;var i=0;while(i<n){var start=t.indexOf("%",i);if(start>=0){out+=t.substr(i,start-i);i=start;}else{out+=t.substr(i);i=n;}if(i<n){i++;len=0;while(i+len<n){var c=t.substr(i+len,1);if("0"<=c&&c<="9"){len++;}else{break;}}if(len>0){var varno=parseInt(t.substr(i,len));i+=len;if(1<=varno&&varno<arguments.length){out+=arguments[varno].toString();}else{out+="%"+varno;}}else{out+="%";i++;}}}return out;}function trim(str){return str.replace(/^\s+|\s+$/g,'');}function count(arr){var length=0;for(var key in arr){length++;}return length;}function $(id){if(id.constructor==String){return document.getElementById(id);}else{return id;}}function $$(name,root){if(!root){root=document;}else{root=$(root);}if(root){return root.getElementsByTagName(name);}else{throw new Error("Invalid element");}}function reparent(id,parenid,repl){var f=$(id);var p=$(parenid);if(f&&p){if(repl){while(p.childNodes.length>=1)p.removeChild(p.firstChild);}p.insertBefore(f,p.firstChild);f.style.display="block";}}function is_identifier(id){return id.match(/^[_a-z][_a-z0-9]*$/i)&&id.length<64;}provides("html");function h1(title){var f=document.createElement("h1");if(title){var data=translate.apply(this,arguments);f.appendChild(document.createTextNode(data));}return f;}function h2(title){var f=document.createElement("h2");if(title){var data=translate.apply(this,arguments);f.appendChild(document.createTextNode(data));}return f;}function para(str){var f=document.createElement("p");if(str){var data=translate.apply(this,arguments);f.appendChild(document.createTextNode(data));}return f;}function div(attrs){var f=document.createElement("div");set_attribute(f,attrs);return f;}function anchor(href,title){var textnode;if(title){var args=Array.prototype.slice.call(arguments);textnode=text.apply(this,args.slice(1));}else{textnode=text(href);}var f=document.createElement("a");set_attribute(f,{href:href});f.appendChild(textnode);return f;}function text(str){var data=translate.apply(this,arguments);return document.createTextNode(data);}function generate_identifier(name){var id;if(!name||name.constructor!=String){name="id";}if(isNaN(HTML_COUNTER[name])){HTML_COUNTER[name]=1;}return name+(HTML_COUNTER[name]++);}var HTML_COUNTER=new Array();function set_attribute(f,attrs){for(var key in attrs){var value=attrs[key];switch(key){case "alt":case "height":case "href":case "id":case "src":case "target":case "title":case "width":f.setAttribute(key,value);break;case "className":f[key]=value;break;default:throw new Error("Invalid attribute "+key);}}}function set_style(f,styles){for(var key in styles){f.style[key]=styles[key];}}function set_opacity(f,x){if(0<=x&&x<=100){set_style(f,{opacity:(x/100).toString(),filter:"alpha(opacity="+x+")"});}}function set_title(f,str){var args=Array.prototype.slice.call(arguments);title=translate.apply(this,args.slice(1));set_attribute(f,{title:title});}function set_class(f,classname){set_attribute(f,{className:trim(classname)});}function add_class(f,classname){if(!in_class(f,classname)){set_class(f,f.className+" "+classname);}}function remove_class(f,classname){var arr=f.className.split(" ");var classes="";for(var i=0;i<arr.length;++i){if(arr[i]!=classname){classes+=" "+arr[i];}}set_class(f,classes);}function in_class(f,classname){var classes=f.className.split(" ");for(var i=0;i<classes.length;++i){if(classes[i]==classname){return true;}}return false;}api_version(3);provides("mailto");requires("html");function mailto_links(){var arr=$$("a");for(var i=0;i<arr.length;i++){mailto_replace(arr[i]);}var arr=$$("span");for(var i=0;i<arr.length;i++){mailto_replace(arr[i]);}}function mailto_replace(f){var addr=f.innerHTML;addr=addr.replace(/\((at|miuku|a)\)/,"@");addr=addr.replace(/\b(atsign|at|miuku)\b/,"@");addr=addr.replace(/\b(dot|piste|point)\b/g,".");addr=addr.replace(/\b(nospam|remove)\b/g,"");addr=addr.replace(/[\x2f\x20\t\r\n]/g,"");addr=addr.replace(/\(\w+\)/g,"");if(addr.match(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2}[mtgvu]?$/i)){while(f.childNodes.length>=1)f.removeChild(f.firstChild);if(f.nodeName.toUpperCase()=="A"){f.appendChild(text(addr));f.href="mailto:"+addr;}else{f.appendChild(anchor("mailto:"+addr,addr));}}}mailto_links();provides("net");function is_addr(name){return is_addr4(name);}function is_addr4(name){return name.match(/^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])([.]([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$/);}function is_host(name){return name.match(/^([a-z0-9][-0-9a-z]*[a-z0-9]\.)+[a-z]{2,6}$/i);}function is_localhost(name){return name.match(/^(localhost|127\.0\.0\.1)$/i);}function server_name(){return window.location.hostname;}function server_port(){return parseInt(window.location.port)||80;}function domain(name){var result;if(!name)name=server_name();if(is_addr(name)||is_identifier(name)){result=name;}else if(is_host(name)){var part=name.split(".");result=part[part.length-2]+"."+part[part.length-1];}else{throw new Error("Invalid host name "+name);}return result;}function subdomain(name){var sub;if(!name)name=server_name();if(is_addr(name)||is_localhost(name)){sub="";}else if(is_identifier(name)){sub=name;}else if(is_host(name)){part=name.split(".");if(part.length>2){sub=part[part.length-3];}else{sub="";}}else{throw new Error("Invalid host name "+name);}return sub;}provides("request");var request_wait=new Array();function HttpRequest(f){var req=null;if(window.ActiveXObject){try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){req=new ActiveXObject("Microsoft.XMLHTTP");}}if(!req&&window.XMLHttpRequest){req=new XMLHttpRequest;}if(req){req.onreadystatechange=request_state;this.req=req;this.completed=f;this.async=(f!=null);this.request_header=new Array();this.get=HttpRequest_get;this.post=HttpRequest_post;this.query_string=HttpRequest_query_string;this.response=HttpRequest_response;this.header=HttpRequest_header;}else{throw new Error("Unable to construct HTTP Request");}}function HttpRequest_header(name,value){var req=this.req;if(value){this.request_header[name]=value;}if(req.readyState>=2){return req.getResponseHeader(name);}else{return null;}}function HttpRequest_get(fn,vars){request_add(this);var req=this.req;req.open("GET",fn+this.query_string(vars),this.async);for(var i in this.request_header){req.setRequestHeader(i,this.request_header[i]);}req.send(null);return this.response();}function HttpRequest_post(fn,vars){var data=this.query_string(data);this.header("Content-Type","application/x-www-form-urlencoded; charset="+CHARSET);this.header("Content-length",data.length);request_add(this);var req=this.req;req.open("POST",fn,this.async);for(var i in this.request_header){req.setRequestHeader(i,this.request_header[i]);}req.send(data);return this.response();}function HttpRequest_query_string(vars){var query="";if(vars){for(var i in vars){query+=(query?"&":"?")+i;if(vars[i])query+="="+encodeURIComponent(vars[i]);}}return query;}function HttpRequest_response(){var result=null;var req=this.req;if(req.readyState==4){if(req.status==200){if(req.responseXML&&req.responseXML.childNodes.length){result=req.responseXML;}else{result=req.responseText;}}else{throw new Error(req.statusText);}}return result;}function http_get(fn,vars){var http=new HttpRequest();return http.get(fn,vars);}function http_post(fn,vars){var http=new HttpRequest();return http.post(fn,vars);}function request_add(http){request_wait.push(http);}function request_state(req){for(var i=0;i<request_wait.length;i++){var http=request_wait[i];if(http.req.readyState==4){if(http.completed){http.completed(http.response());}request_wait.splice(i,1);break;}}}provides("file");function dequote(str){str=trim(str);if(str.substr(0,1)=="\""&&str.substr(str.length-1,1)=="\""){str=str.substr(1,str.length-2);}if(str.substr(0,1)=="\'"){str=str.substr(1);}str=str.replace(/""/,"\"");return str;}provides("browser");function scroll_left(){var x=0;if(document.documentElement.scrollLeft){var t=document.documentElement.scrollLeft;if(t>x){x=t;}}if(document.body.scrollLeft){var t=document.body.scrollLeft;if(t>x){x=t;}}if(window.pageXOffset){var t=window.pageXOffset;if(t>x){x=t;}}return x;}function scroll_top(){var y=0;if(document.documentElement.scrollTop){var t=document.documentElement.scrollTop;if(t>y){y=t;}}if(document.body.scrollTop){var t=document.body.scrollTop;if(t>y){y=t;}}if(window.pageYOffset){var t=window.pageYOffset;if(t>y){y=t;}}return y;}function scroll_width(){var w=document.body.scrollWidth+margin_left(document.body)+margin_right(document.body);w=_scroll_width(document.body,w);w=Math.max(w,inner_width());return w;}function _scroll_width(f,w){var x=offset_left(f)+offset_width(f);if(w<x)w=x;for(var i=0;i<f.childNodes.length;i++){w=_scroll_width(f.childNodes[i],w);}return w;}function scroll_height(){return Math.max(inner_height(),document.body.scrollHeight+margin_top(document.body)+margin_bottom(document.body));}function inner_width(){var w=0;if(typeof(window.innerWidth)=='number'){w=window.innerWidth;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){w=document.documentElement.clientWidth;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){w=document.body.clientWidth;}return w;}function inner_height(){var h=0;if(typeof(window.innerHeight)=='number'){h=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){h=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){h=document.body.clientHeight;}return h;}function offset_left(f){var x=0;if(f.offsetParent){x=f.offsetLeft;while(f=f.offsetParent){x+=f.offsetLeft;}}return x;}function offset_top(f){var y=0;if(f.offsetParent){y=f.offsetTop;while(f=f.offsetParent){y+=f.offsetTop;}}return y;}function offset_width(f){var w=0;if(f.offsetWidth){w+=f.offsetWidth;}else if(f.style&&f.style.pixelWidth){w+=f.style.pixelWidth;}return w;}function offset_height(f){var h=0;if(f.offsetHeight){h+=f.offsetHeight;}else if(f.style&&f.style.pixelHeight){h+=f.style.pixelHeight;}return h;}function margin_top(f){return parseInt(get_style(f,"marginTop"))||0;}function margin_bottom(f){return parseInt(get_style(f,"marginBottom"))||0;}function margin_left(f){return parseInt(get_style(f,"marginLeft"))||0;}function margin_right(f){return parseInt(get_style(f,"marginRight"))||0;}function border_top(f){return parseInt(get_style(f,"borderTopWidth"))||0;}function border_bottom(f){return parseInt(get_style(f,"borderBottomWidth"))||0;}function border_left(f){return parseInt(get_style(f,"borderLeftWidth"))||0;}function border_right(f){return parseInt(get_style(f,"borderRightWidth"))||0;}function padding_top(f){return parseInt(get_style(f,"paddingTop"))||0;}function padding_bottom(f){return parseInt(get_style(f,"paddingBottom"))||0;}function padding_left(f){return parseInt(get_style(f,"paddingLeft"))||0;}function padding_right(f){return parseInt(get_style(f,"paddingRight"))||0;}function min_width(f){var w=parseInt(get_style(f,"minWidth"))||0;return w>0?w:0;}function max_width(f){var w=parseInt(get_style(f,"maxWidth"))||1920;return w>0?w:1920;}function min_height(f){var h=parseInt(get_style(f,"minHeight"))||0;return h>0?h:0;}function max_height(f){var h=parseInt(get_style(f,"maxHeight"))||999999;return h>0?h:999999;}function get_style(f,prop){var w=0;if(f.currentStyle){w=f.currentStyle[prop];}else if(window.getComputedStyle&&f.style){var name="";for(var i=0;i<prop.length;i++){var c=prop[i];if("A"<=c&&c<="Z"){name=name+"-"+c.toLowerCase();}else{name=name+c;}}w=document.defaultView.getComputedStyle(f,null).getPropertyValue(name);}return w||0;}provides("cookie");function getcookie(cookie){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;++i){var item=cookies[i];var value,name;var pos=item.indexOf("=");if(pos>=0){name=trim(item.substr(0,pos));value=item.substr(pos+1);}else{name=trim(item);value="";}if(name==cookie){return value;}}return "";}function setcookie(cookie,value,expire,path,domain){var cookiedef;cookiedef=cookie+"="+escape(value)+";";if(expire!=null){cookiedef+="expires"+"="+expire.toGMTString()+";";}if(path!=null){cookiedef+="path"+"="+path+";";}if(domain!=null){cookiedef+="domain"+"="+domain+";";}document.cookie=cookiedef;}provides("time");var SHORT_DATE_FORMAT={"US":"%b %e %Y"};var LONG_DATE_FORMAT={"US":"%A %B %e %Y"};var FULL_DATE_FORMAT={"US":"%a %b %e %Y %I:%M %p"};var day_name=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var month_name=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var abbreviated_month=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var abbreviated_day=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");function parse_date(str){var re,match;var year,month=0,day;re=new RegExp(/^([1-2][0-9]{3})-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/);match=re.exec(str);if(match){year=match[1];month=match[2];day=match[3];}if(match){var r=new Date();r.setYear(year);r.setMonth(month-1,day);r.setHours(0,0,0,0);if(r.getFullYear()==year||r.getMonth()+1==month||r.getDate()==day){return r;}}return null;}function short_date(t){return format_date(SHORT_DATE_FORMAT[COUNTRY],t);}function long_date(t){return format_date(LONG_DATE_FORMAT[COUNTRY],t);}function full_date(t){return format_date(FULL_DATE_FORMAT[COUNTRY],t);}function format_date(format,t){var day=t.getDate();var month=t.getMonth()+1;var year=t.getFullYear();var hour=t.getHours();var min=t.getMinutes();var sec=t.getSeconds();var weekday=t.getDay();var i=0;var n=format.length;var output="";while(i<n){var c=format.substr(i++,1);if(c=="%"){c=format.substr(i++,1);switch(c){case "a":output+=translate(abbreviated_day[weekday]);break;case "A":output+=translate(day_name[weekday]);break;case "d":output+=(day<10?"0":"")+day;break;case "e":output+=day;break;case "m":output+=(month<10?"0":"")+month;break;case "h":case "b":output+=translate(abbreviated_month[month-1]);break;case "B":output+=translate(month_name[month-1]);break;case "Y":output+=year;break;case "H":output+=(hour<10?"0":"")+hour;break;case "M":output+=(min<10?"0":"")+min;break;case "I":var x=hour%12;if(x==0)x=12;output+=(x<10?"0":"")+x;break;case "p":if(hour<12){output+="AM";}else{output+="PM";}break;case "P":if(hour<12){output+="am";}else{output+="pm";}break;case "S":output+=(sec<10?"0":"")+sec;break;default:output+=c;}}else{output+=c;}}return output;}function offset_days(n,t){var msecs=24*60*60*1000;if(t==null){t=new Date();}var r=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0);r.setTime(r.getTime()+n*msecs+msecs/4);r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r;}function leap_year(year){return((year%4)==0&&(year%100)!=0)||((year%400)==0);}function days_in_month(year,month){switch(month){case 0:return 31;case 1:return leap_year(year)?29:28;case 2:return 31;case 3:return 30;case 4:return 31;case 5:return 30;case 6:return 31;case 7:return 31;case 8:return 30;case 9:return 31;case 10:return 30;case 11:return 31;default:throw new Error("Invalid month "+month);}}api_version(3);provides("i18n");requires("file");requires("request");requires("cookie");requires("time");FULL_DATE_FORMAT={"GB":"%a %e %b %H:%M %Y","US":"%a, %b %e, %Y %I:%M %p","FI":"%d.%m.%Y klo %H.%M"};SHORT_DATE_FORMAT={"GB":"%e %b %Y","US":"%b %e %Y","FI":"%d.%m.%Y"};LONG_DATE_FORMAT={"GB":"%A %e %B %Y","US":"%A, %B %e, %Y","FI":"%A %e. %Bta %Y"};function load_translations(lang){var fn=ROOT+lang+"/"+lang+".csv";var file=http_get(fn);if(file.constructor!=String){throw new Error("Expecting string");}var lines=file.split("\n");for(var i=0;i<lines.length;i++){var fields=lines[i].split("\t");if(fields.length==2){from=dequote(fields[0].toLowerCase());to=dequote(fields[1]);add_translation(from,to);}}}function add_translation(from,to){var key=from.toLowerCase().replace(/^\s+|\s+$/g,'').replace(/\s+/g,' ');TRANSLATIONS[key]=to;}function init_i18n(){var arr=$$("meta");for(var i=0;i<arr.length;i++){var eq=arr[i].getAttribute("http-equiv");var val=arr[i].getAttribute("content");if(eq=="content-language"){LANG=val.substr(0,2);COUNTRY=val.substr(3,2);}}if(getcookie("lang")!=LANG){setcookie("lang",LANG,offset_days(365),"/");}load_translations(LANG);}init_i18n();provides("event");function onload_handler(f){add_handler("load",f);}function onresize_handler(f){add_handler("resize",f);}function onscroll_handler(f){add_handler("scroll",f);}function onmousemove_handler(f){add_handler("mousemove",f);}function onexit_handler(f){add_handler("beforeunload",f);}function event_key(e){if(!e)e=window.event;var key="";if(e.which==null){key=String.fromCharCode(e.keyCode);}else{switch(e.which){case 8:key=null;break;case null:case 0:key=null;break;default:key=String.fromCharCode(e.which);}}return key;}function event_specialkey(e){if(!e)e=window.event;if(e.keyIdentifier){switch(e.keyIdentifier){case "U+0008":return "Back";case "U+0009":return "Tab";case "U+001B":return "Esc";case "U+0020":return "Space";case "U+007F":return "Delete";default:return e.keyIdentifier;};}else{switch(e.keyCode){case 32:return "Space";case 38:return "Up";case 40:return "Down";case 37:return "Left";case 39:return "Right";case 36:return "Home";case 35:return "End";case 13:return "Enter";case 45:return "Insert";case 34:return "PageDown";case 33:return "PageUp";case 8:return "Back";case 9:return "Tab";case 27:return "Esc";case 46:return "Delete";default:return String.fromCharCode(e.keyCode);};}}function add_handler(id,f){if(window.addEventListener){window.addEventListener(id,f,false);}else if(window.attachEvent){window.attachEvent("on"+id,f);}}function stop_propagation(e){if(!e)e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}requires("browser");requires("event");provides("layout");function LayoutController(){this.mgrs=new Array();this.nmgrs=0;this.height=0;this.add=LayoutController_add;this.remove=LayoutController_remove;this.update=LayoutController_update;this.ontimer=LayoutController_ontimer;this.onscroll=LayoutController_onscroll;}function LayoutController_add(obj){this.mgrs[this.nmgrs++]=obj;obj.update();return obj;}function LayoutController_remove(id){var i=0;while(i<this.nmgrs){if(this.mgrs[i].id==id){this.mgrs.splice(i,1);this.nmgrs--;}else{i++;}}}function LayoutController_update(){for(var i=0;i<this.nmgrs;i++){this.mgrs[i].update();}this.height=offset_height(document.body);}function LayoutController_ontimer(){if(this.height!=offset_height(document.body)){this.update();}}function LayoutController_onscroll(){for(var i=0;i<this.nmgrs;i++){this.mgrs[i].onscroll();}}function Layout(id){var f=$(id);this.id=id;this.element=f;if(f){this.minw=min_width(f);this.maxw=max_width(f);this.minh=min_height(f);this.maxh=max_height(f);}this.update=Layout_update;this.resize=Layout_resize;this.setpos=Layout_setpos;this.offset=Layout_offset;this.onscroll=Layout_onscroll;}function Layout_update(){;}function Layout_onscroll(){;}function Layout_resize(w,h){var f=this.element;if(w){if(w<this.minw)w=this.minw;if(w>this.maxw)w=this.maxw;}if(h){if(h<this.minh)h=this.minh;if(h>this.maxh)h=this.maxh;}if(w&&w<0){throw new Error("Invalid width "+w);}if(h&&h<0){throw new Error("Invalid height "+h);}if(f){if(w){f.style.width=Math.round(w)+"px";}if(h){f.style.height=Math.round(h)+"px";}}}function Layout_setpos(x,y){if(x<0)x=0;if(y<0)y=0;var f=this.element;if(f){f.style.left=Math.round(x)+"px";f.style.top=Math.round(y)+"px";f.style.position="absolute";}}function Layout_offset(s,w1,w2){var offset=0;var re=new RegExp(/^([-+]?)([0-9]+)([%px]*)$/);var match=re.exec(s);if(match){var offset=parseInt(match[2])||0;if(match[3]=="%"){offset=(offset/100)*w1-(offset/100)*w2;}if(match[1]=="-"){offset=w1-offset-w2;}}return offset;}function StretchLayout(id,minh,maxh){this.parent=Layout;this.parent(id);if(minh)this.minh=minh;if(maxh)this.maxh=maxh;this.update=StretchLayout_update;}function StretchLayout_update(){var f=this.element;if(f){var bottom=offset_height(document.body)-offset_top(f)-offset_height(f);var h=inner_height()-offset_top(f)-bottom;this.resize(null,h);}}function RelativeLayout(id,xoffs,yoffs){this.parent=Layout;this.parent(id);this.xoffs=xoffs;this.yoffs=yoffs;this.update=RelativeLayout_update;}function RelativeLayout_update(){var f=this.element;if(f){var p=f.parentNode;var x=offset_left(p)+this.offset(this.xoffs,offset_width(p),offset_width(f));var y=offset_top(p)+this.offset(this.yoffs,offset_height(p),offset_height(f));this.setpos(x,y);}}function MaxLayout(id){this.parent=Layout;this.parent(id);this.update=MaxLayout_update;}function MaxLayout_update(){this.setpos(0,0);this.resize(scroll_width(),scroll_height());}function FloatLayout(id,xoffs,yoffs){this.parent=Layout;this.parent(id);this.update=FloatLayout_update;this.onscroll=FloatLayout_onscroll;if(!xoffs)xoffs="50%";this.xoffs=xoffs;if(!yoffs)yoffs="50%";this.yoffs=yoffs;}function FloatLayout_update(){var f=this.element;if(f){var x=scroll_left()+this.offset(this.xoffs,inner_width(),offset_width(f));var y=scroll_top()+this.offset(this.yoffs,inner_height(),offset_height(f));this.setpos(x,y);}}function FloatLayout_onscroll(){this.update();}function StackLayout(id){this.parent=Layout;this.parent(id);this.update=StackLayout_update;var f=this.element;f.style.position="relative";f.style.overflow="hidden";this.children=new Array();for(var i=0;i<f.childNodes.length;i++){var p=f.childNodes[i];var type=p.nodeName.toUpperCase();if(type=="IMG"||type=="DIV"||type=="A"){p.style.position="absolute";p.style.left=padding_left(f)+"px";p.style.top=padding_top(f)+"px";p.xminWidth=min_width(p)+"px";p.xminHeight=min_height(p)+"px";this.children[this.children.length]=p;}}}function StackLayout_update(){var f=this.element;for(var i=0;i<this.children.length;i++){var p=this.children[i];p.style.minWidth=p.xminWidth;p.style.minHeight=p.xminHeight;}var t;var w=min_width(f);var h=min_height(f);for(var i=0;i<this.children.length;i++){var p=this.children[i];w=Math.max(w,offset_width(p));h=Math.max(h,offset_height(p));}if(w>max_width(f))w=max_width(f);if(h>max_height(f))h=max_height(f);this.resize(w,h);for(var i=0;i<this.children.length;i++){var p=this.children[i];var wt=w-padding_left(p)-padding_right(p)-border_left(p)-border_right(p);var ht=h-padding_top(p)-padding_bottom(p)-border_top(p)-border_bottom(p);p.style.minWidth=wt+"px";p.style.minHeight=ht+"px";}}var layout=new LayoutController();onresize_handler(function(){layout.update();});onscroll_handler(function(){layout.onscroll();});window.setInterval(function(){layout.ontimer();},1000);api_version(3);requires("cookie");function ie_version(require){var ver=0;if(navigator.appName=="Microsoft Internet Explorer"){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null){ver=parseFloat(RegExp.$1);}if(require&&ver+1.0e-6<require){if(!getcookie("ie")){setcookie("ie",1);alert(translate("This website has been designed for a later version of Internet Explorer.  Please update your copy of Internet Explorer or use another web browser such as Firefox or Opera for optimal viewing experience."));}}}return ver;}api_version(3);provides("target");requires("net");function targeted_links(){var base=server_name().toLowerCase();var links=$$("a");for(var i=0;i<links.length;i++){var domain;var protocol;var href=links[i].href;var start=href.indexOf("://");if(start>=0){protocol=href.substring(0,start).toLowerCase();start+=3;}else{start=0;protocol="";}var end=href.indexOf("/",start);if(end<0){end=href.length;}domain=href.substring(start,end).toLowerCase();if((protocol=="http"||protocol=="https")&&domain!=base&&!links[i].target){links[i].setAttribute("target","_blank");}}}onload_handler(function(){targeted_links();});
