/*
compatibility kit v1.2
build by Nikita U.: etdceztg at yahoo dot com
*/

window.onerror=function(msg, url, lno){return true;} //comment when debugging

ext=new _framework_javascript_extensions();
function _framework_javascript_extensions(){
    var userAgent  = navigator.userAgent.toLowerCase();
    this.is_opera  = (userAgent.indexOf('opera') != -1);
    this.is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
    this.is_webtv  = (userAgent.indexOf('webtv') != -1);
    this.is_ie     = ((userAgent.indexOf('msie') != -1) && (!this.is_opera) && (!this.is_saf) && (!this.is_webtv));
    this.is_ie4    = ((this.is_ie) && (userAgent.indexOf('msie 4.') != -1));
    this.is_ie5    = ((this.is_ie) && (userAgent.indexOf('msie 5.') != -1));
    this.is_ie6    = ((this.is_ie) && (userAgent.indexOf('msie 6.') != -1));
    this.is_ie7    = ((this.is_ie) && (userAgent.indexOf('msie 7.') != -1));
    this.is_ie5up  = ((this.is_ie) && ((this.is_ie5)||(this.is_ie6)||(this.is_ie7)) );
    this.is_moz    = ((navigator.product == 'Gecko') && (!this.is_saf));
    this.is_kon    = (userAgent.indexOf('konqueror') != -1);
    this.is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!this.is_opera) && (!this.is_webtv) && (!this.is_saf));
    this.is_ns4    = ((this.is_ns) && (parseInt(navigator.appVersion) == 4));
    this.is_ns7    = (userAgent.indexOf('Netscape/7') != -1);
    this.is_mac    = (userAgent.indexOf('mac') != -1);
    this.is_hotjava= (userAgent.indexOf('hotjava') != -1);
    this.pointer_cursor = (this.is_ie ? 'hand' : 'pointer');
    this.get_element      = function(idname){if(document.getElementById){return document.getElementById(idname);}else if(document.all){return document.all[idname];}else if(document.layers){return document.layers[idname];}else{return null;}}
    this.get_tags         = function(parentobj, tag){if(typeof(parentobj)=="string")parentobj=this.get_element(parentobj);if(typeof parentobj.getElementsByTagName!='undefined'){return parentobj.getElementsByTagName(tag);}else if(parentobj.all&&parentobj.all.tags){return parentobj.all.tags(tag);}else{return null;}}
    this.get_offset       = function(obj){var left_offset = obj.offsetLeft;var top_offset = obj.offsetTop; while((obj = obj.offsetParent)!=null){left_offset += obj.offsetLeft;top_offset += obj.offsetTop;}return { 'left' : left_offset, 'top' : top_offset };}
    this.get_window_size  = function(){if(!document.all&&(document.getElementById||document.layers))return {'w' : window.innerWidth, 'h' : window.innerHeight }; if(document.all)return {'w' : document.body.clientWidth, 'h' : document.body.clientHeight}; return {'w' : 0, 'h' : 0 };}
    this.get_window_scroll= function(){if(document.body && (document.body.scrollTop || document.body.scrollLeft) && !(window.debug || navigator.vendor == 'KDE' ))return {'x':document.body.scrollLeft,'y':document.body.scrollTop};if(document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) && !( window.debug || navigator.vendor == 'KDE' ))return{'x':document.documentElement.scrollLeft,'y':document.documentElement.scrollTop};return{'x':0,'y':0}}
    this.get_event_xy     = function(e){if(!document.all&&document.getElementById)return{'x':e.clientX+window.scrollX,'y':e.clientY+window.scrollY};if(document.all)return{'x':document.body.scrollLeft+window.event.clientX,'y':document.body.scrollTop+window.event.clientY};if(!document.all&&!document.getElementById&&document.layers)return{'x':e.pageX,'y':e.pageY};return{'x':0,'y':0}}
    this.get_cookie       = function(name){cookie_name=name+'='; cookie_length=document.cookie.length; cookie_begin=0; while(cookie_begin < cookie_length) {value_begin=cookie_begin + cookie_name.length; if(document.cookie.substring(cookie_begin,value_begin)==cookie_name){var value_end=document.cookie.indexOf(';',value_begin); if(value_end==-1){value_end=cookie_length;} return unescape(document.cookie.substring(value_begin,value_end));} cookie_begin=document.cookie.indexOf(' ',cookie_begin)+1; if(cookie_begin==0){break;}}return null;}
    this.set_visibility   = function(id,visible){if((document.getElementById||document.all)&&!document.layers){get_element(id).style.visibility=(visible==0)?'hidden':'visible';return;}if(document.layers){get_element(id).visibility=(visible==0)?'hide':'visible';return;}}
    this.set_cookie       = function(name, value, expires){document.cookie = name + '=' + escape(value) + '; path=/' + (typeof expires != 'undefined' ? '; expires=' + expires.toGMTString() : '');}
    this.delete_cookie    = function(name){document.cookie = name + '=' + '; expires=Thu, 01-Jan-70 00:00:01 GMT' +  '; path=/';}
    this.add_event        = function(object, type, handler){if (object.addEventListener && !this.is_saf) {object.addEventListener(type, handler, false);} else if (object.attachEvent && !this.is_saf) {object.attachEvent(['on',type].join(''), handler);} else {object[['on',type].join('')] = handler;}}
    this.get_script_base  = function(script_name){var elements=this.get_tags(document,"script");for(var i=0;i<elements.length;i++){if(elements[i].src&&(elements[i].src.indexOf(script_name)!=-1)){var src=elements[i].src;return src.substring(0,src.lastIndexOf('/'));}}}
    this.load_script      = function(url,strict){if(strict){se=document.createElement('SCRIPT');se.setAttribute('language','JavaScript');se.setAttribute('type','text/javascript');se.setAttribute('src',url);this.get_tags(document,"head")[0].appendChild(se);}else{document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'"></script>');}}
    this.load_css         = function(url,strict){if (strict){le=document.createElement('link');le.setAttribute('href',url);le.setAttribute('rel','stylesheet');le.setAttribute('type','text/css');this.get_tags(document,"head")[0].appendChild(le);}else{document.write('<link href="' + url + '" rel="stylesheet" type="text/css" />');}}
    this.list_props       = function(obj){for(q in obj)document.writeln(q+' '+obj[q]+'<br />');}
    return this;
}

_framework_javascript_extensions.prototype.form=new _framework_javascript_extensions_form_plugin();
function _framework_javascript_extensions_form_plugin(){
    this.is_not_empty=function(obj){
        if (typeof(obj)=="string")obj=ext.get_element(obj);
        for (i=0;i<obj.value.length;i++){
            if ((obj.value.charAt(i)!=' ')&&(obj.value.charAt(i)!='\t')&&(obj.value.charAt(i)!='\n')&&(obj.value.charAt(i)!='\r')){return true;}
        }
        return false;
    }
    this.is_empty=function(obj){
        return !this.is_not_empty(obj);
    }
    this.is_num=function(obj){
        if(typeof(obj)=="string")obj=ext.get_element(obj);
        var pat=/^[0-9]+$/;
        return pat.test(obj.value);
    }
    this.is_hexnum=function(obj){
        if(typeof(obj)=="string")obj=ext.get_element(obj);
        var pat=/^[0-9a-fA-F]+$/;
        return pat.test(obj.value);
    }
    this.is_email=function(obj){
        if(typeof(obj)=="string")obj=ext.get_element(obj);
        emailStr=obj.value;
        var e_half_pat=/^([^\s\(\)><@,;:\\\"\.\[\]]+)(\.([^\s\(\)><@,;:\\\"\.\[\]]+))*$/;
        var e_full_pat=/^(.+)@(.+)$/;
        var e_domn_pat=/^[a-zA-Z]{2}$/;
        var e_dom3_pat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/i;
        if (e_full_pat.test(emailStr)==false){return false}
        eArr=emailStr.match(e_full_pat);
        for (i=0; i<eArr[1].length; i++) {
            if (eArr[1].charCodeAt(i)>127) {return  false}
        }
        for (i=0; i<eArr[2].length; i++) {
            if (eArr[2].charCodeAt(i)>127) {return false}
        }
        if (e_half_pat.test(eArr[1])==false){return false};
        if (e_half_pat.test(eArr[2])==false){return false};
        f_domain=eArr[2].split(".");
        f_domain=f_domain[f_domain.length-1];
        if((f_domain.length==2)&&!(f_domain.match(e_domn_pat)))return false;
        if((f_domain.length!=2)&&!(f_domain.match(e_dom3_pat)))return false;
        return true;
    }
    return this;
}

_framework_javascript_extensions.prototype.ajax=new _framework_javascript_extensions_ajax_plugin();
function _framework_javascript_extensions_ajax_plugin(){
    this.responsed=false;
    this.response="";
    this.xmlrequest=function(){{var httprequest=false;if(window.XMLHttpRequest){httprequest=new XMLHttpRequest();}else if(window.ActiveXObject){try{httprequest=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{httprequest=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){try{httprequest=new ActiveXObject("MSXML2.XMLHTTP.5.0");}catch(e){try{httprequest=new ActiveXObject("MSXML2.XMLHTTP.4.0");}catch(e){try{httprequest=new ActiveXObject("MSXML2.XMLHTTP.3.0");}catch(e){}}}}}};return httprequest;}}
    this.string2xml=function(xmlString){
        var myDocument;
        if (document.implementation&&document.implementation.createDocument){
            var parser = new DOMParser();
            myDocument = parser.parseFromString(xmlString, "text/xml");
        }
        else if (window.ActiveXObject){
           myDocument = new ActiveXObject("Microsoft.XMLDOM");
           myDocument.async="false";
           myDocument.loadXML(xmlString);
        }
		return myDocument;
    }
    this.get_request=function(url,parameters,rfunction,isxml,efunction){
        this.request=this.xmlrequest();
        if(!this.request)return;
            var self=this;
            this.responsed=false;
            this.response="";
            this.request.onreadystatechange=function(){
                if(!self.responsed){
                    if(self.request.readyState==4){
                        if(self.request.status==200||window.location.href.indexOf("http")==-1){
                            self.responsed=true;
                            isxml?self.response=self.request.responseXML:self.response=self.request.responseText;
                            if(rfunction)rfunction();
                        }
                        else if(self.request.status==404){
                            self.responsed=true;
                            if(efunction)efunction();
                        }
                    }
                }
            };
            this.request.open('GET',[url,'?',parameters,"&_framework_javascript_extensions_prevent_cache=",new Date().getTime()].join(''),true);
            this.request.send(null);
    }
    this.post_request=function(url,parameters,rfunction,isxml,efunction){
        this.request=new this.xmlrequest();
        if(!this.request)return;
            var self=this;
            this.responsed=false;
            this.request.onreadystatechange=function(){
                if (!self.responsed){
                    if (self.request.readyState==4){
                        if (self.request.status==200||window.location.href.indexOf("http")==-1){
                            self.responsed=true;
                            isxml?self.response=self.request.responseXML:self.response=self.request.responseText;
                            if(rfunction)rfunction();
                        }
                        else if(self.request.status==404){
                            self.responsed=true;
                            if(efunction)efunction();
                        }
                    }
                }
            };
            this.request.open('POST',url,true);
            this.request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
            this.request.setRequestHeader("Content-Length", parameters.length);
            this.request.setRequestHeader("Connection", "close");
            this.request.send(parameters);
    }
    this.head_request=function(url,parameters,rfunction,efunction){
        this.request=new xmlrequest();
        if(!this.request)return;
            var self=this;
            this.responsed=false;
            this.response="";
            this.request.onreadystatechange=function(){
                if(!self.responsed){
                    if(self.request.readyState==4){
                        if(self.request.status==200||window.location.href.indexOf("http")==-1){
                            self.responsed=true;
                            if(parameters=='all'){self.response=self.request.getAllResponseHeaders()}else{self.response=self.request.getResponseHeader(parameters)};
                            if(rfunction)rfunction();
                        }
                        else if(self.request.status==404){
                            self.responsed=true;
                            if(efunction)efunction();
                        }
                    }
                }
            };
            this.request.open('GET',[url,"?_framework_javascript_extensions_prevent_cache=",new Date().getTime()].join(''),true);
            this.request.send(null);
    }
    return this;
}

_framework_javascript_extensions.prototype.url=new _framework_javascript_extensions_url_plugin();
function _framework_javascript_extensions_url_plugin(){
    /* Part of TinyMCE; License (LGPL); Copyright (c) 2003-2006 Moxiecode Systems AB */
    this.parseURL       = function(url_str){var urlParts=new Array();if(url_str){var pos,lastPos;pos=url_str.indexOf('://');if (pos!=-1){urlParts['protocol']=url_str.substring(0,pos);lastPos=pos+3;}for(var i=lastPos;i<url_str.length;i++){var chr=url_str.charAt(i);if(chr==':')break;if(chr=='/')break;}pos=i;urlParts['host']=url_str.substring(lastPos,pos);urlParts['port']="";lastPos=pos;if(url_str.charAt(pos)==':'){pos=url_str.indexOf('/',lastPos);urlParts['port']=url_str.substring(lastPos+1,pos);}lastPos=pos;pos=url_str.indexOf('?',lastPos);if(pos==-1)pos=url_str.indexOf('#',lastPos);if(pos==-1)pos=url_str.length;urlParts['path']=url_str.substring(lastPos,pos);lastPos=pos;if(url_str.charAt(pos)=='?'){pos=url_str.indexOf('#');pos=(pos==-1)?url_str.length:pos;urlParts['query']=url_str.substring(lastPos+1, pos);}lastPos=pos;if(url_str.charAt(pos)=='#'){pos=url_str.length;urlParts['anchor']=url_str.substring(lastPos+1, pos);}}return urlParts;};
    this.serializeURL   = function(up){var o="";if(up['protocol'])o+=up['protocol'] + "://";if(up['host'])o+=up['host'];if(up['port'])o+=":"+up['port'];if(up['path'])o+=up['path'];if(up['query'])o+="?"+up['query'];if(up['anchor'])o+="#"+up['anchor'];return o;};
    this.getDocumentBase= function(){documentBasePath=document.location.href;if(documentBasePath.indexOf('?')!=-1)documentBasePath=documentBasePath.substring(0,documentBasePath.indexOf('?'));documentBasePath=documentBasePath.substring(0,documentBasePath.lastIndexOf('/')+1);return documentBasePath;}
    this.abs2rel        = function(base_url,url_to_relative){var baseURL=this.parseURL(base_url);var targetURL=this.parseURL(url_to_relative);var strTok1;var strTok2;var breakPoint=0;var outPath="";var forceSlash=false;if (targetURL.path=="")targetURL.path = "/";else forceSlash=true;base_url=baseURL.path.substring(0,baseURL.path.lastIndexOf('/'));strTok1=base_url.split('/');strTok2=targetURL.path.split('/');if(strTok1.length>=strTok2.length){for(var i=0;i<strTok1.length;i++){if(i>=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length<strTok2.length){for(var i=0;i<strTok2.length;i++){if(i>=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath += "../";for(var i=breakPoint-1;i<strTok2.length;i++){if (i != (breakPoint-1))outPath += "/" + strTok2[i];else outPath += strTok2[i];}targetURL.protocol=null;targetURL.host=null;targetURL.port=null;targetURL.path=outPath==""&&forceSlash?"/":outPath;var fileName=baseURL.path;var pos;if((pos=fileName.lastIndexOf('/'))!=-1)fileName=fileName.substring(pos+1);if(fileName==targetURL.path&&targetURL.anchor!="")targetURL.path="";if(targetURL.path==""&&!targetURL.anchor)targetURL.path="/";return this.serializeURL(targetURL);};
    this.rel2abs        = function(base_url,relative_url){var baseURL=this.parseURL(base_url);var relURL=this.parseURL(relative_url);if (relative_url==""||relative_url.charAt(0)=='/'||relative_url.indexOf('://')!=-1||relative_url.indexOf('mailto:')!=-1||relative_url.indexOf('javascript:')!=-1)return relative_url;baseURLParts=baseURL['path'].split('/');relURLParts=relURL['path'].split('/');var newBaseURLParts=new Array();for(var i=baseURLParts.length-1;i>=0;i--){if(baseURLParts[i].length == 0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i];}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue;}if(numBack>0){numBack--;continue;}newRelURLParts[newRelURLParts.length]=relURLParts[i];}relURLParts = newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path = absPath;return this.serializeURL(relURL);};
}

_framework_javascript_extensions.prototype.string=new _framework_javascript_extensions_string_plugin();
function _framework_javascript_extensions_string_plugin(){
    /*UTF-8 Decoder and Encoder; base64 Encoder and Decoder; written by Tobias Kieslich, justdreams; Contact: tobias@justdreams.de; http://www.justdreams.de*/
    var b64s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';b64=new Array();f64=new Array();for (var i=0;i<b64s.length;i++){b64[i]=b64s.charAt(i);f64[b64s.charAt(i)]=i;};
    /* returns an array of byterepresenting dezimal numbers which represent the plaintext in an UTF-8 encoded version. Expects a string.This function includes an exception management for those nasty browsers like NN401, which returns negative decimal numbers for chars>128. I hate it!! This handling is unfortunately limited to the user's charset. Anyway, it works in most of the cases! Special signs with an unicode>256 return numbers, which can not be converted to the actual unicode and so not to the valid utf-8 representation. Anyway, this function does always return values which can not misinterpretd by RC4 or base64 en- or decoding, because every value is >0 and <255!! Arrays are faster and easier to handle in b64 encoding or encrypting....*/
    this.utf8t2d=function(t){t=t.replace(/\r\n/g,"\n");var d=new Array;var test=String.fromCharCode(237);if (test.charCodeAt(0)<0)for(var n=0;n<t.length;n++){var c=t.charCodeAt(n);if (c>0)d[d.length]=c;else{d[d.length]=(((256+c)>>6)|192);d[d.length]=(((256+c)&63)|128);}}else for(var n=0;n<t.length;n++){var c=t.charCodeAt(n);if (c<128)d[d.length]= c;else if((c>127)&&(c<2048)) {d[d.length]=((c>>6)|192);d[d.length]=((c&63)|128);}else{d[d.length]=((c>>12)|224);d[d.length]=(((c>>6)&63)|128);d[d.length]=((c&63)|128);}}return d;};
    /* returns plaintext from an array of bytesrepresenting dezimal numbers, which represent an UTF-8 encoded text; browser which does not understand unicode like NN401 will show "?"-signs instead expects an array of byterepresenting decimals; returns a string*/
    this.utf8d2t=function(d){var r=new Array;var i=0;while(i<d.length){if(d[i]<128){r[r.length]=String.fromCharCode(d[i]);i++;}else if((d[i]>191)&&(d[i]<224)){r[r.length]=String.fromCharCode(((d[i]&31)<<6)|(d[i+1]&63));i+=2;}else{r[r.length]=String.fromCharCode(((d[i]&15)<<12)|((d[i+1]&63)<<6)|(d[i+2]&63));i+=3;}}return r.join("");};
    /* creates a base64 encoded text out of an array of byerepresenting dezimals it is really base64 :) this makes serversided handling easier expects an array; returns a string*/
    this.b64d2t=function(d) {var r=new Array; var i=0; var dl=d.length;/* this is for the padding*/if ((dl%3) == 1) {d[d.length] = 0; d[d.length] = 0;}if ((dl%3) == 2)d[d.length] = 0;/* from here conversion*/while (i<d.length){r[r.length] = b64[d[i]>>2];r[r.length] = b64[((d[i]&3)<<4) | (d[i+1]>>4)];r[r.length] = b64[((d[i+1]&15)<<2)|(d[i+2]>>6)];r[r.length]=b64[d[i+2]&63];if((i%57)==54)r[r.length]="\n";i+=3;};/* this is again for the padding*/if((dl%3)==1)r[r.length-1]=r[r.length-2]="=";if((dl%3)==2)r[r.length-1]="=";/* we join the array to return a textstring*/var t=r.join("");return t;};
    /* returns array of byterepresenting numbers created of an base64 encoded text it is still the slowest function in this modul; I hope I can make it faster expects string; returns an array*/
    this.b64t2d=function(t){var d=new Array;var i=0;/* here we fix this CRLF sequenz created by MS-OS; arrrgh!!!*/t=t.replace(/\n|\r/g,"");t=t.replace(/=/g,"");while (i<t.length){d[d.length]=(f64[t.charAt(i)]<<2)|(f64[t.charAt(i+1)]>>4);d[d.length]=(((f64[t.charAt(i+1)]&15)<<4)|(f64[t.charAt(i+2)]>>2));d[d.length]=(((f64[t.charAt(i+2)]&3)<<6)|(f64[t.charAt(i+3)]));i+=4;}if(t.length%4==2)d=d.slice(0,d.length-2);if(t.length%4==3)d=d.slice(0,d.length-1);return d;};
    this.base64_encode=function(t){return this.b64d2t(this.utf8t2d(t))}
    this.base64_decode=function(t){return this.utf8d2t(this.b64t2d(t))}
	/*end UTF-8 Decoder and Encoder;*/
    this.encodeURI=function(t){d=this.utf8t2d(t);hex=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");ahex="";for (i=0;i<d.length;i++){if(d[i]==33||(d[i]>34&&d[i]<58)||d[i]==58||d[i]==59||d[i]==58||d[i]==61||(d[i]>62&&d[i]<91&&d[i]!=62)||(d[i]>94&&d[i]<123)||d[i]==126)ahex+=String.fromCharCode(d[i]);else ahex+=["%",hex[Math.floor(d[i]/16)],hex[d[i]%16]].join("");}return ahex;}
    this.encodeURIComponent=function(t){d=this.utf8t2d(t);hex=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");ahex="";for (i=0;i<d.length;i++){if(d[i]==33||(d[i]>38&&d[i]<43)||(d[i]>=48&&d[i]<=57)||(d[i]>=65&&d[i]<=90)||(d[i]>=97&&d[i]<=122))ahex+=String.fromCharCode(d[i]);else ahex+=["%",hex[Math.floor(d[i]/16)],hex[d[i]%16]].join("");}return ahex;}
}

_framework_javascript_extensions.prototype.window=new _framework_javascript_extensions_window_plugin();
function _framework_javascript_extensions_window_plugin(){
    this.open=function(w,h,location){
        for(q in ext){
            if((typeof(ext[q])=='object')&&(typeof(ext[q].on_blur)=='function')){
                if(!window.parent)
                    ext[q].on_blur();
            }
            if((typeof(ext[q])=='object')&&(typeof(ext[q].on_focus)=='function')){
                if(!window.parent)
                    ext[q].on_focus();
            }
        }
        ws=ext.get_window_size();
        if(!location)location='';
        if(screen.width)wsw=screen.width;else wsw=ws['w'];
        if(screen.height)wsh=screen.height;else wsh=ws['h']+100;
        scrollbars=0;
        wleft=(wsw/2-w/2);
        wtop=(wsh/2-h/2);
        if(wsw<w){scrollbars=1;wleft=0;w=wsw;if(ext.is_ie)w=w-10;}
        if(wsh<h){scrollbars=1;wtop=0;h=wsh;}
        win=window.open(location,'',['width=',w,',height=',h,',left=',wleft,',top=',wtop,',resize=0,location=0,status=0,scrollbars=',scrollbars].join(''));
    }
}

Array.prototype.array_clear=function(){for(var k in this)this[k] = null; return this;};
if(!Array.prototype.pop){ Array.prototype.pop=function(){var array_pop_lastelement = this[this.length-1];this.length--;return array_pop_lastelement;}}
if(!Array.prototype.push){Array.prototype.push =function(value){this[this.length] = value;return this.length;}}

String.prototype.base64_encode     =function(){return ext.string.base64_encode(this)}
String.prototype.base64_decode     =function(){return ext.string.base64_decode(this)}
String.prototype.encodeURI         =function(){return ext.string.encodeURI(this)}
String.prototype.encodeURIComponent=function(){return ext.string.encodeURIComponent(this)}
String.prototype.md5               =function(){if(ext.md5)  return ext.md5.hex_md5(this);     else return false;}
String.prototype.sha1              =function(){if(ext.sha1) return ext.sha1.hex_sha1(this);   else return false;}
String.prototype.sha256            =function(){if(ext.sha2) return ext.sha2.hex_sha256(this); else return false;}
String.prototype.htmlspecialchars  =function(){str=this;str=str.replace(/&/g,'&amp;');str=str.replace(/</g,'&lt;');str=str.replace(/>/g,'&gt;');str=str.replace(/"/g,'&quot;');return str;}
String.prototype.htmlspecialchars_decode  =function(){str=this;str=str.replace(/&amp;/g,'&');str=str.replace(/&lt;/g,'<');str=str.replace(/&gt;/g,'>');str=str.replace(/&quot;/g,'"');return str;}

if (ext.is_moz) {
    HTMLElement.prototype.__defineGetter__("innerText", function ()    { return(this.textContent); });
    HTMLElement.prototype.__defineSetter__("innerText", function (txt) { this.textContent = txt; });
    Event.prototype.__defineSetter__("cancelBubble", function (b) { if (b) this.stopPropagation();});
    Event.prototype.__defineSetter__("returnValue", function (b) {if (!b) this.preventDefault();this._returnValue = b;return(b);});
    Event.prototype.__defineGetter__("returnValue", function () {return (this._returnValue);});
    // enable using evt.srcElement in Mozilla/Firefox
    Event.prototype.__defineGetter__("srcElement", function () {
        var node = this.target;
        while (node.nodeType != 1) node = node.parentNode;
        // test this:
        if (node != this.target) alert("Unexpected event.target!") // it still happens sometime, why ?
        return node;
    });
}

// Simulating inserAdjacentHTML on NS6
// Code by thor@jscript.dk
if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode){switch (where){case 'beforeBegin':this.parentNode.insertBefore(parsedNode,this);break;case 'afterBegin':this.insertBefore(parsedNode,this.firstChild);break;case 'beforeEnd':this.appendChild(parsedNode);break;case 'afterEnd':if (this.nextSibling)this.parentNode.insertBefore(parsedNode,this.nextSibling);else this.parentNode.appendChild(parsedNode);break;}};HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){var r = this.ownerDocument.createRange();r.setStartBefore(this);var parsedHTML = r.createContextualFragment(htmlStr);this.insertAdjacentElement(where,parsedHTML);}}

_framework_javascript_extensions.prototype.force_d=new _framework_javascript_extensions_force_d_plugin();
function _framework_javascript_extensions_force_d_plugin(){
    this.init=function(){
        links=ext.get_tags(document,'A');
        if(!links)return;
        for(link=0;link<links.length;link++){
            if(links[link].getAttribute('rel')=='download-scrap'){
			    /* don't think it accepts ALL files :) */
                links[link].onclick=function(){window.location.href=['./download.php?destination=',this.href].join('');return false;};
            }
        }
    }
}
_framework_javascript_extensions.prototype.unselectable=new _framework_javascript_extensions_unselectable_plugin();
function _framework_javascript_extensions_unselectable_plugin(){
    this.init=function(){
        if(ext.is_ie){
            for(i=0;i<document.all.length;i++){
                if(document.all[i].className=='unselectable'){
                    document.all[i].setAttribute('unselectable','on');
                    document.all[i].unselectable='on';
                }
            }
        }
    }
}

_framework_javascript_extensions.prototype.quickstart=function(){
    for(q in this){
        if((typeof(this[q])=='object')&&(typeof(this[q].init)=='function'))
            this[q].init();
    }
}

/* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/. SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: http://www.opensource.org/licenses/mit-license.php */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;