if('function'!=typeof(GI)){var GI=function(){this.isIE=function(){if(/Microsoft/.test(window.navigator.appName)){return true}return false};return this};this.getIEVersion=function(){var a=window.navigator.userAgent;var b=a.indexOf("MSIE ");if(b==-1){return 0}else{return parseFloat(a.substring(b+5,a.indexOf(";",b)))}}}GI.Loader=function(){var f=this;this.defaultOptions={onComplete:null};this.parseOptions=function(a,b){var c={};if('object'!=typeof(a)){a={}}var d={};if('object'==typeof(b)){d=b}else{d=this.defaultOptions}for(var e in d){if('undefined'!=typeof(a[e])){c[e]=a[e]}else{c[e]=d[e]}}return c};this.loadJs=function(b,c){c=this.parseOptions(c);if('undefined'==typeof(b))return f;var d=document.createElement('script');d.setAttribute('type','text/javascript');d.setAttribute('src',b);d.setAttribute('language','javascript');if('function'==typeof(c.onComplete)){if(d.addEventListener){d.addEventListener('load',function(a){c.onComplete(a)},false)}else{d.onreadystatechange=function(){if('complete'==this.readyState)c.onComplete(this)}}}document.getElementsByTagName('head')[0].appendChild(d);return this};this.loadCss=function(a,b){b=this.parseOptions(b);if('undefined'==typeof(a))return f;if('undefined'==typeof(b.media)||null==b.media){b.media='screen'}var c=document.createElement('link');c.setAttribute('rel','stylesheet');c.setAttribute('type','text/css');c.setAttribute('media',b.media);c.setAttribute('href',a);if('function'==typeof(b.onComplete)){this.addOnLoadEvent(b.onComplete)}document.getElementsByTagName('head')[0].appendChild(c);return this};this.addOnLoadEvent=function(a){if('function'!=typeof(a))return f;if(window.addEventListener&&!window.opera){window.addEventListener('load',a,false)}else if(window.attachEvent){window.attachEvent('onload',a)}else{var o=window.onload;window.onload=function(){if(o){o();a()}else a()}}return this};return this};GI.AjaxRequest=function(g,h){var i=this;var j={onComplete:null,method:'get',params:null,encode:true};var k={};var l=null;var m=function(){var a=null;if('undefined'!=typeof(window.XMLHttpRequest)){a=new XMLHttpRequest()}else if(window.ActiveXObject){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){a=null}}}return a};var n=function(a,b){if('string'!=typeof(a)){throw'Need a valid url to use for an ajax request';};k=GI.Loader().parseOptions(b,j);i._url=a;return i};var o=function(a){if(null!=k.onComplete){if(4==a.readyState){if(200==a.status){k.onComplete(a)}}}return i};var p=function(a,b){var c=new Array();for(var d in a){var e=d;var f=a[d];if(b){e=encodeURIComponent(e);f=encodeURIComponent(f)}c.push(e+'='+f)}c=c.join('&');return c};var q=function(){var a=m();var b='GET';var c=null;switch(k.method.toLowerCase()){case'post':b='POST';c=p(k.params,k.encode);break;case'get':default:break}if(null!=k.onComplete){a.onreadystatechange=function(){o(a)}}a.open(b,i._url,true);a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.setRequestHeader("HTTP_X_REQUESTED_WITH","XMLHttpRequest");if('POST'==b){a.setRequestHeader('Content-type','application/x-www-form-urlencoded');a.setRequestHeader('Content-length',c.length);a.setRequestHeader('Connection','close')}a.send(c);return i};n(g,h);q();return this};
