<!--
// Cookies

function Cookiemanager(name,defaultExpiration,expirationUnits,defaultDomain,defaultPath) {
        this.name = name;
        this.defaultExpiration = this.getExpiration(defaultExpiration,expirationUnits);
        this.defaultDomain = (defaultDomain)?defaultDomain:(document.domain.search(/[a-zA-Z]/) == -1)?document.domain:document.domain.substring(document.domain.indexOf('.') + 1,document.domain.length);
        this.defaultPath = (defaultPath)?defaultPath:'/';
        this.cookies = new Object();
        this.expiration = new Object();
        this.domain = new Object();
        this.path = new Object();
        window.onunload = new Function (this.name+'.setDocumentCookies();');
        this.getDocumentCookies();
        }
Cookiemanager.prototype.getExpiration = function(expiration,units) {
        expiration = (expiration)?expiration:7;
        units = (units)?units:'days';
        var date = new Date();
        switch(units) {
                case 'years':
                        date.setFullYear(date.getFullYear() + expiration);
                        break;
                case 'months':
                        date.setMonth(date.getMonth() + expiration);
                        break;
                case 'days':
                        date.setTime(date.getTime()+(expiration*24*60*60*1000));
                        break;
                case 'hours':
                        date.setTime(date.getTime()+(expiration*60*60*1000));
                        break;
                case 'minutes':
                        date.setTime(date.getTime()+(expiration*60*1000));
                        break;
                case 'seconds':
                        date.setTime(date.getTime()+(expiration*1000));
                        break;
                default:
                        date.setTime(date.getTime()+expiration);
                        break;
                }
        return date.toGMTString();
        }
Cookiemanager.prototype.getDocumentCookies = function() {
        var cookie,pair;
        var cookies = document.cookie.split(';');
        var len = cookies.length;
        for(var i=0;i < len;i++) {
                cookie = cookies[i];
                while (cookie.charAt(0)==' ') cookie = cookie.substring(1,cookie.length);
                pair = cookie.split('=');
                this.cookies[pair[0]] = pair[1];
                }
        }
Cookiemanager.prototype.setDocumentCookies = function() {
        var expires = '';
        var cookies = '';
        var domain = '';
        var path = '';
        for(var name in this.cookies) {
                expires = (this.expiration[name])?this.expiration[name]:this.defaultExpiration;
                path = (this.path[name])?this.path[name]:this.defaultPath;
                domain = (this.domain[name])?this.domain[name]:this.defaultDomain;
                cookies = name + '=' + this.cookies[name] + '; expires=' + expires + '; path=' + path + '; domain=' + domain;
                document.cookie = cookies;
                }
        return true;
        }
Cookiemanager.prototype.getCookie = function(cookieName) {
        var cookie = this.cookies[cookieName]
        return (cookie)?cookie:false;
        }
Cookiemanager.prototype.setCookie = function(cookieName,cookieValue,expiration,expirationUnits,domain,path) {
        this.cookies[cookieName] = cookieValue;
        if (expiration) this.expiration[cookieName] = this.getExpiration(expiration,expirationUnits);
        if (domain) this.domain[cookieName] = domain;
        if (path) this.path[cookieName] = path;
        return true;
        }
var cookieManager = new Cookiemanager('cookieManager',1,'years');

//Efa Font-Sizer
var efa_default = 75;                                                                                        //default text size as percentage of user default
var efa_increment = 10;                                                                                        //percentage to increase/decrease font size

var efa_smaller = ['<li><span>Schrift:</span></li><li class="navitems">',
                                   '+',                                //HTML to go before 'smaller' link
                                   'Schrift gr&ouml;sser stellen',                                                        //HTML to go inside 'smaller' anchor tag
                                   'gross',                                                                                        //class attribute
                                   '',                                                                                        //id attribute
                                   '',                                                                                        //name attribute
                                   '',                                                                                        //accesskey attribute
                                   '',                                                                                        //onmouseover attribute
                                   '',                                                                                        //onmouseout attribute
                                   '',                                                                                        //onfocus attribute
                                   ''                                                                        //HTML to go after 'smaller' link
                                   ]

var efa_reset = ['',
                                 'normal',                                //HTML to go before 'reset' link
                                 'Schriftgr&ouml;&szlig;e normal',        //HTML to go inside 'reset' anchor tag
                                  'mittel',                                                                                        //class attribute
                                  '',                                                                                        //id attribute
                                  '',                                                                                        //name attribute
                                  '',                                                                                        //accesskey attribute
                                  '',                                                                                        //onmouseover attribute
                                  '',                                                                                        //onmouseout attribute
                                  '',                                                                                        //onfocus attribute
                                  ' '                                                                                        //HTML to go after 'reset' link
                                  ]

var efa_bigger = ['',                                        //HTML to go before 'bigger' link
                                  '-',                                //HTML to go inside 'bigger' anchor tag
                                  'Schrift kleiner stellen',                                //title attribute
                                  'klein',                                                                                        //class attribute
                                  '',                                                                                        //id attribute
                                  '',                                                                                        //name attribute
                                  '',                                                                                        //accesskey attribute
                                  '',                                                                                        //onmouseover attribute
                                  '',                                                                                        //onmouseout attribute
                                  '',                                                                                        //onfocus attribute
                                  '<' + '/li>'                                                                                        //HTML to go after 'bigger' link
                                  ]

function Efa_Fontsize(increment,bigger,reset,smaller,def) {
        // check for the W3C DOM
        this.w3c = (document.getElementById);
        // check for the MS DOM
        this.ms = (document.all);
        // get the userAgent string and normalize case
        this.userAgent = navigator.userAgent.toLowerCase();
        // check for Opera and that the version is 7 or higher; note that because of Opera's spoofing we need to
        // resort to some fancy string trickery to extract the version from the userAgent string rather than
        // just using appVersion
        this.isOldOp = ((this.userAgent.indexOf('opera') != -1)&&(parseFloat(this.userAgent.substr(this.userAgent.indexOf('opera')+5)) <= 7));
        // check for Mac IE; this has been commented out because there is a simple fix for Mac IE's 'no resizing
        // text in table cells' bug--namely, make sure there is at least one tag (a <p>, <span>, <div>, whatever)
        // containing any content in the table cell; that is, use <td><p>text</p></td> or <th><span>text</span></th>
        // instead of <td>text</td> or <th>text</th>; if you'd prefer not to use the workaround, then uncomment
        // the following line:
        // this.isMacIE = ((this.userAgent.indexOf('msie') != -1) && (this.userAgent.indexOf('mac') != -1) && (this.userAgent.indexOf('opera') == -1));
        // check whether the W3C DOM or the MS DOM is present and that the browser isn't Mac IE (if above line is
        // uncommented) or an old version of Opera
        if ((this.w3c || this.ms) && !this.isOldOp && !this.isMacIE) {
                // set the name of the function so we can create event handlers later
                this.name = "efa_fontSize";
                // set the cookie name to get/save preferences
                this.cookieName = 'efaSize';
                // set the increment value to the appropriate parameter
                this.increment = increment;
                //default text size as percentage of user default
                this.def = def;
                //intended default text size in pixels as a percentage of the assumed 16px
                this.defPx = Math.round(16*(def/100))
                //base multiplier to correct for small user defaults
                this.base = 1;
                // call the getPrefs function to get preferences saved as a cookie, if any
                this.pref = this.getPref();
                // stuff the HTML for the test <div> into the testHTML property
                this.testHTML = '<div id="efaTest" style="position:absolute;visibility:hidden;line-height:1em;">&nbsp;</div>';
                // get the HTML for the 'bigger' link
                this.biggerLink = this.getLinkHtml(1,bigger);
                // get the HTML for the 'reset' link
                this.resetLink = this.getLinkHtml(0,reset);
                // get the HTML for the 'smaller' link
                this.smallerLink = this.getLinkHtml(-1,smaller);
                // set up an onlunload handler to save the user's font size preferences
        } else {
                // set the link html properties to an empty string so the links don't show up
                // in unsupported browsers
                this.biggerLink = '';
                this.resetLink = '';
                this.smallerLink = '';
                // set the efaInit method to a function that only returns true so
                //we don't get errors in unsupported browsers
                this.efaInit = new Function('return true;');
        }
        // concatenate the individual links into a single property to write all the HTML
        // for them in one shot
        this.allLinks = this.biggerLink + this.resetLink + this.smallerLink;
}
// check the user's current base text size and adjust as necessary
Efa_Fontsize.prototype.efaInit = function() {
                // write the test <div> into the document
                document.writeln(this.testHTML);
                // get a reference to the body tag
                this.body = (this.w3c)?document.getElementsByTagName('body')[0].style:document.all.tags('body')[0].style;
                // get a reference to the test element
                this.efaTest = (this.w3c)?document.getElementById('efaTest'):document.all['efaTest'];
                // get the height of the test element
                var h = (this.efaTest.clientHeight)?parseInt(this.efaTest.clientHeight):(this.efaTest.offsetHeight)?parseInt(this.efaTest.offsetHeight):999;
                // check that the current base size is at least as large as the browser default (16px) adjusted
                // by our base percentage; if not, divide 16 by the base size and multiply our base multiplier
                //  by the result to compensate
                if (h < this.defPx) this.base = this.defPx/h;
                // now we set the body font size to the appropriate percentage so the user gets the
                // font size they selected or our default if they haven't chosen one
                this.body.fontSize = Math.round(this.pref*this.base) + '%';
}
// construct the HTML for the links; we expect -1, 1 or 0 for the direction, an array
// of properties to add to the <a> tag and HTML to go before, after and inside the tag
Efa_Fontsize.prototype.getLinkHtml = function(direction,properties) {
        // declare the HTML variable and add the HTML to go before the link, the start of the link
        // and the onclick handler; we insert the direction argument as a parameter passed to the
        // setSize method of this object
        var html = properties[0] + '<a href="#" onclick="efa_fontSize.setSize(' + direction + '); return false;"';
        // concatenate the title attribute and value
        html += (properties[2])?'title="' + properties[2] + '"':'';
        // concatenate the class attribute and value
        html += (properties[3])?'class="' + properties[3] + '"':'';
        // concatenate the id attribute and value
        html += (properties[4])?'id="' + properties[4] + '"':'';
        // concatenate the name attribute and value
        html += (properties[5])?'name="' + properties[5] + '"':'';
        // concatenate the accesskey attribute and value
        html += (properties[6])?'accesskey="' + properties[6] + '"':'';
        // concatenate the onmouseover attribute and value
        html += (properties[7])?'onmouseover="' + properties[7] + '"':'';
        // concatenate the onmouseout attribute and value
        html += (properties[8])?'onmouseout="' + properties[8] + '"':'';
        // concatenate the title onfocus and value
        html += (properties[9])?'onfocus="' + properties[9] + '"':'';
        // concatenate the link contents, closing tag and any HTML to go after the link and return the
        // entire string
        return html += '>'+ properties[1] + '<' + '/a>' + properties[10];
}
// get the saved preferences out of the cookie, if any
Efa_Fontsize.prototype.getPref = function() {
        // get the value of the cookie for this object
        var pref = this.getCookie(this.cookieName);
        // if there was a cookie value return it as a number
        if (pref) return parseInt(pref);
        // if no cookie value, return the default
        else return this.def;
}
// change the text size; expects a direction parameter of 1 (increase size), -1 (decrease size)
// or 0 (reset to default)
Efa_Fontsize.prototype.setSize = function(direction) {
        // see if we were passed a nonzero direction parameter;
        // if so, multiply it by the increment and add it to the current percentage size;
        // if the direction was negative, it will reduce the size; if the direction was positive,
        // it will increase the size; if the direction parameter is undefined or zero, reset
        // current percentage to the default
        this.pref = (direction)?this.pref+(direction*this.increment):this.def;
        this.setCookie(this.cookieName,this.pref);
        // set the text size
        this.body.fontSize = Math.round(this.pref*this.base) + '%';
}
// get the value of the cookie with the name equal to a string passed as an argument
Efa_Fontsize.prototype.getCookie = function(cookieName) {
        var cookie = cookieManager.getCookie(cookieName);
        return (cookie)?cookie:false;
}
// set a cookie with a supplied name and value
Efa_Fontsize.prototype.setCookie = function(cookieName,cookieValue) {
        return cookieManager.setCookie(cookieName,cookieValue);
}

var  efa_fontSize = new Efa_Fontsize(efa_increment,efa_smaller,efa_reset,efa_bigger,efa_default);

// Cookie-Funktionen
function WertHolen() {
 var Wert = "";
 if(document.cookie) {
  var Wertstart = document.cookie.indexOf("Checkstr=");
  Wert = document.cookie.substring(Wertstart,document.cookie.length);
  var Wertende = Wert.indexOf(";");
  if (Wertende == -1) Wertende = document.cookie.length;
  Wert = Wert.substring(0,Wertende);
  Wert = Wert.substring(Wert.indexOf("=")+1,document.cookie.length);
 }
 return Wert;
}

function WertSetzen(Bezeichner, Wert, Verfall) {
 var jetzt = new Date();
 var Auszeit = new Date(jetzt.getTime() + Verfall);
 document.cookie = Bezeichner+"="+Wert+"; expires="+Auszeit.toGMTString()+";";
}

function Laden() {
 var Checkstr = WertHolen();
 var Check = "";
 if (Checkstr != "") {
  for (var i=0; i < Checkstr.length; i++) {
   Check = Checkstr.substring(i,i+1);
   if (Check == "1") document.forms['checkliste'].elements[i].click();
  }
  alert("Ihre gespeicherten Daten wurden geladen!\n");
 }
}

function Speichern() {
 var Verfallszeit = 1000*60*60*24*365; // 1 Jahr
 var Checkstr = "";
 var Check = "";
 for (var i=0; i < document.forms['checkliste'].length; i++) {
  if (document.forms['checkliste'].elements[i].checked) Check = "1";
  else Check = "0";
  Checkstr += Check;
 }
 WertSetzen("Checkstr",Checkstr,Verfallszeit);
}

// PopUp Funktionen

function openShop(artnr) {
url="http://twl.gipsprojekt.de/shop/warenkorb.php";
if (artnr!="") url="http://twl.gipsprojekt.de/shop/produkt.php?SHOPArtnr="+artnr;
popup = window.open(url, 'PopUp4', 'width=750,height=650,scrollbars=1,resizable=1,status=yes');
popup.focus();
}

function PopUp(url,w,h)
{
popup = window.open(url, 'PopUp2', 'width='+w+',height='+h+',scrollbars=yes,resizable=yes');
popup.resizeTo(w, h);
popup.focus();
}

function openWin(url,w,h){
popup = window.open(url, 'PopUp3', 'width='+w+',height='+h+',toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
}

function openVBZ(url){
popup = window.open(url, 'PopUp4', 'width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
}

function openPortal(){
popup = window.open('https://kundenportal.twl.de/twl/public/frameset_top_html.jsp', 'PopUp61', 'width=1000,height=800,toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function openPortalreg(){
popup = window.open('https://kundenportal.twl.de/twl/public/frameset_top_html.jsp', 'PopUp62', 'width=1000,height=800,toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function openZaehler(){
popup = window.open('https://kundenportal.twl.de/twl/publicMeterReadingStart.sap', 'PopUp63', 'width=1000,height=800,toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

// Und noch eine PopUp-Funktion
function openPopup(url,w,h){
popup = window.open(url, 'PopUp5', 'width='+w+',height='+h+'');
}

// PopUp-Funktion für Routenplaner
function openRoute(url) {
popup = window.open(url,'Anfahrt','width=652,height=540,location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes');
}

// Versenden von e-cards
function openEcard(pic) {
        url="http://twl.gipsprojekt.de/twl/service/ecards.php?bild="+pic;
        window.open(url, 'ecards', 'width=650,height=550,hotkeys=no,locationbar=no,menubar=no,resizable=no,status=no,scrollbars=yes');
}

// Funktion zum Bookmark setzen
function bookmark(page){
         bookmarkurl="http://twl.gipsprojekt.de"+page;
         bookmarktitle=document.title;
         if (document.all) {
                 window.external.AddFavorite(bookmarkurl,bookmarktitle)
         }
         else alert("STRG + D drücken");
}

// Ab hier folgen iBox Scripte

var indicator_img_path="https://www.gipsprojekt.de/twlGips/static/cms/Webpage/img/indicator.gif";var indicator_img_html="<img name=\"ibox_indicator\" src=\""+indicator_img_path+"\" alt=\"Loading...\" style=\"width:128px;height:128px;\"/>";var opacity_level=8;var ibAttr="rel";var imgPreloader=new Image();function init_ibox(){var elem_wrapper="ibox";createIbox(document.getElementsByTagName("body")[0]);var docRoot=document.getElementsByTagName("a");var e;for(var i=0;i<docRoot.length-1;i++){e=docRoot[i];if(e.getAttribute(ibAttr)){var t=e.getAttribute(ibAttr);if((t.indexOf("ibox")!=-1)||t.toLowerCase()=="ibox"){e.onclick=function(){var t=this.getAttribute(ibAttr);var params=parseQuery(t.substr(5,999));var url=this.href;if(this.target!=""){url=this.target}
var title=this.title;if(showIbox(url,title,params)){showBG();window.onscroll=maintPos;window.onresize=maintPos;}
return false;};}}}}
showBG=function(){var box_w=getElem('ibox_w');box_w.style.opacity=0;box_w.style.filter='alpha(opacity=0)';setBGOpacity=setOpacity;for(var i=0;i<=opacity_level;i++){setTimeout("setIboxOpacity('ibox_w',"+i+")",70*i);}
box_w.style.display="";var pagesize=new getPageSize();var scrollPos=new getScrollPos();var ua=navigator.userAgent;if(ua.indexOf("MSIE ")!=-1){box_w.style.width=pagesize.width+'px';}
box_w.style.height=pagesize.height+scrollPos.scrollY+'px';}
hideBG=function(){var box_w=getElem('ibox_w');box_w.style.display="none";}
var loadCancelled=false;showIndicator=function(){var ibox_p=getElem('ibox_progress');ibox_p.style.display="";posToCenter(ibox_p);ibox_p.onclick=function(){hideIbox();hideIndicator();loadCancelled=true;}}
hideIndicator=function(){var ibox_p=getElem('ibox_progress');ibox_p.style.display="none";ibox_p.onclick=null;}
createIbox=function(elem){var strHTML="<div id=\"ibox_w\" style=\"display:none;\"></div>";strHTML+="<div id=\"ibox_progress\" style=\"display:none;\">";strHTML+=indicator_img_html;strHTML+="</div>";strHTML+="<div id=\"ibox_wrapper\" style=\"display:none\">";strHTML+="<div id=\"ibox_content\"></div>";strHTML+="<div id=\"ibox_footer_wrapper\"><div id=\"ibox_close\" style=\"float:right;\">";strHTML+="<a id=\"ibox_close_a\" href=\"javascript:void(null);\" >Fenster schlie&szlig;en</a></div>";strHTML+="<div id=\"ibox_footer\">&nbsp;</div></div></div></div>";var docBody=document.getElementsByTagName("body")[0];var ibox=document.createElement("div");ibox.setAttribute("id","ibox");ibox.style.display='';ibox.innerHTML=strHTML;elem.appendChild(ibox);}
var ibox_w_height=0;showIbox=function(url,title,params){var ibox=getElem('ibox_wrapper');var ibox_type=0;var ibox_footer=getElem('ibox_footer');if(title!=""){ibox_footer.innerHTML=title;}else{ibox_footer.innerHTML="&nbsp;";}
var urlString=/\.jpg|\.jpeg|\.png|\.gif|\.html|\.htm|\.php|\.cfm|\.asp|\.aspx|\.jsp|\.jst|\.rb|\.rhtml|\.txt/g;var urlType=url.match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'){ibox_type=1;}else if(url.indexOf("#")!=-1){ibox_type=2;}else if(urlType=='.htm'||urlType=='.html'||urlType=='.php'||urlType=='.asp'||urlType=='.aspx'||urlType=='.jsp'||urlType=='.jst'||urlType=='.rb'||urlType=='.txt'||urlType=='.rhtml'||urlType=='.cfm'){ibox_type=3;}else{if(params['type']){ibox_type=parseInt(params['type']);}
else{hideIbox();return false;}}
ibox_type=parseInt(ibox_type);switch(ibox_type){case 1:showIndicator();imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader=resizeImageToScreen(imgPreloader);hideIndicator();var strHTML="<img name=\"ibox_img\" src=\""+url+"\" style=\"width:"+imgPreloader.width+"px;height:"+imgPreloader.height+"px;border:0;cursor:hand;margin:0;padding:0;position:absolute;\"/>";if(loadCancelled==false){ibox.style.height=imgPreloader.height+'px';ibox.style.width=imgPreloader.width+'px';ibox.style.display="";ibox.style.visibility="hidden";posToCenter(ibox);ibox.style.visibility="visible";setIBoxContent(strHTML);}}
loadCancelled=false;imgPreloader.src=url;break;case 2:var strHTML="";if(params['height']){ibox.style.height=params['height']+'px';}
else{ibox.style.height='280px';}
if(params['width']){ibox.style.width=params['width']+'px';}
else{ibox.style.width='450px';}
ibox.style.display="";ibox.style.visibility="hidden";posToCenter(ibox);ibox.style.visibility="visible";getElem('ibox_content').style.overflow="auto";var elemSrcId=url.substr(url.indexOf("#")+1,1000);var elemSrc=getElem(elemSrcId);if(elemSrc){strHTML=elemSrc.innerHTML;}
setIBoxContent(strHTML);break;case 3:showIndicator();http.open('get',url,true);http.onreadystatechange=function(){if(http.readyState==4){hideIndicator();if(params['height']){ibox.style.height=params['height']+'px';}
else{ibox.style.height='280px';}
if(params['width']){ibox.style.width=params['width']+'px';}
else{ibox.style.width='450px';}
ibox.style.display="";ibox.style.visibility="hidden";posToCenter(ibox);ibox.style.visibility="visible";getElem('ibox_content').style.overflow="auto";var response=http.responseText;setIBoxContent(response);}}
http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");http.send(null);break;default:}
ibox.style.opacity=0;ibox.style.filter='alpha(opacity=0)';var ibox_op_level=10;setIboxOpacity=setOpacity;for(var i=0;i<=ibox_op_level;i++){setTimeout("setIboxOpacity('ibox_wrapper',"+i+")",30*i);}
if(ibox_type==2||ibox_type==3){ibox.onclick=null;getElem("ibox_close_a").onclick=function(){hideIbox();}}else{ibox.onclick=hideIbox;getElem("ibox_close_a").onclick=null;}
return true;}
setOpacity=function(elemid,value){var e=getElem(elemid);e.style.opacity=value/10;e.style.filter='alpha(opacity='+value*10+')';}
resizeImageToScreen=function(objImg){var pagesize=new getPageSize();var x=pagesize.width-100;var y=pagesize.height-100;if(objImg.width>x){objImg.height=objImg.height*(x/objImg.width);objImg.width=x;if(objImg.height>y){objImg.width=objImg.width*(y/objImg.height);objImg.height=y;}}
else if(objImg.height>y){objImg.width=objImg.width*(y/objImg.height);objImg.height=y;if(objImg.width>x){objImg.height=objImg.height*(x/objImg.width);objImg.width=x;}}
return objImg;}
maintPos=function(){var ibox=getElem('ibox_wrapper');var box_w=getElem('ibox_w');var pagesize=new getPageSize();var scrollPos=new getScrollPos();var ua=navigator.userAgent;if(ua.indexOf("MSIE ")!=-1){box_w.style.width=pagesize.width+'px';}
if(ua.indexOf("Opera/9")!=-1){box_w.style.height=document.body.scrollHeight+'px';}
else{box_w.style.height=pagesize.height+scrollPos.scrollY+'px';}
posToCenter(ibox);}
hideIbox=function(){hideBG();var ibox=getElem('ibox_wrapper');ibox.style.display="none";clearIboxContent();window.onscroll=null;}
posToCenter=function(elem){var scrollPos=new getScrollPos();var pageSize=new getPageSize();var emSize=new getElementSize(elem);var x=Math.round(pageSize.width/2)-(emSize.width/2)+scrollPos.scrollX;var y=Math.round(pageSize.height/2)-(emSize.height/2)+scrollPos.scrollY;elem.style.left=x+'px';elem.style.top=y+'px';}
getScrollPos=function(){var docElem=document.documentElement;this.scrollX=self.pageXOffset||(docElem&&docElem.scrollLeft)||document.body.scrollLeft;this.scrollY=self.pageYOffset||(docElem&&docElem.scrollTop)||document.body.scrollTop;}
getPageSize=function(){var docElem=document.documentElement
this.width=self.innerWidth||(docElem&&docElem.clientWidth)||document.body.clientWidth;this.height=self.innerHeight||(docElem&&docElem.clientHeight)||document.body.clientHeight;}
getElementSize=function(elem){this.width=elem.offsetWidth||elem.style.pixelWidth;this.height=elem.offsetHeight||elem.style.pixelHeight;}
setIBoxContent=function(str){clearIboxContent();var e=getElem('ibox_content');e.style.overflow="auto";e.innerHTML=str;}
clearIboxContent=function(){var e=getElem('ibox_content');e.innerHTML="";}
getElem=function(elemId){return document.getElementById(elemId);}
parseQuery=function(query){var Params=new Object();if(!query)return Params;var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2)continue;var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}

createRequestObject = function() {
        var xmlhttp;
        /*@cc_on
        @if (@_jscript_version>= 5)
                        try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                        } catch (e) {try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}catch (E) {xmlhttp = false;}
                        }
        @else
                xmlhttp = false;
        @end @*/
        if (!xmlhttp && typeof XMLHttpRequest != "undefined") {
                try {xmlhttp = new XMLHttpRequest();} catch (e) {xmlhttp = false;}
        }
        return xmlhttp;
}

var http = createRequestObject();

function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
addEvent(window,'load',init_ibox);



