﻿String.prototype.trim = function() { return this.replace(/^\s*/, '').replace(/\s*$/, ''); }

function isIE(){if(navigator.appName.indexOf('Microsoft')!=-1)return true;else return false;}
function tI(el){el.src=el.src.indexOf('_0.')>-1?el.src.replace('_0.','_1.'):el.src.replace('_1.','_0.');}

function sT(el,t){el.style.top=t+'px';}
function sL(el,l){el.style.left=l+'px';}
function sIH(id,h){sH(gE(id),h);}

function gW(el){var w;w=el.offsetWidth;return w;}
function gH(el){var h;h=el.offsetHeight;return h;}
function sW(el,w){if(!isNaN(w))w+='px';el.style.width=w;}
function sH(el,h){if(!isNaN(h))h+='px';el.style.height=h;}

function gE(id){var o;if(document.getElementById){o=document.getElementById(id);}else if(document.all){o=document.all[id];}return o;}
function gL(el){var x=0;if(el.offsetParent)while(1){x+=el.offsetLeft;if(!el.offsetParent)break;el=el.offsetParent;}else if(el.x)x += el.x;return x;}
function gT(el) { var y = 0; if (el.offsetParent) while (1) { y += el.offsetTop; if (!el.offsetParent) break; el = el.offsetParent; } else if (el.y) y += el.y; return y; }
function gST() { var t; t = document.documentElement.scrollTop; return t; }
function gH(el){var h;h=el.offsetHeight;return h;}
function dC(d){var c;if(d){if(isIE())c='hand';else c='pointer';}else{c='default';}document.body.style.cursor=c;}
function dM(b){var w,h;var x=$('main');var m=$('mask');if(b){sW(m,gW(x));sH(m,gH(x));}else{sW(m,0);sH(m,0);}}
//function hE(el){el.className=el.className.replace('show','hide');}
//function sE(el){el.className=el.className.replace('hide','show');}

function cE(el){el.className=el.className.replace('expd','coll');}
function eE(el){el.className=el.className.replace('coll','expd');}
function fI(el,d){var f=new Fx.Morph(el,{'duration':d});el.set('opacity',0);f.start({'opacity':1});}
function fO(el,d){var f=new Fx.Morph(el,{'duration':d});el.set('opacity',1);f.start({'opacity':0});}

function wH(id, html) { gE(id).innerHTML = html; }

//function setIframeHeight()
//{
//    if (parent.editMode != null)
//    {
//        var h = gH(gE('main'));        
//        parent.sIH('ifrCMS', h+150);
//        
//        //parent.setLastVisited();        
//    }
//}