function createElementEx(type,name){type=type.toUpperCase();var elem=null;try{elem=document.createElement(type);if(name)elem.name=name}catch(e){try{elem=document.createElement('<'+type+(name?' name="'+name+'"':'')+'></'+type+'>')}catch(e){}}return elem}function count(arr){if(arr.length)return arr.length;else{var y=0;for(var x in arr)y++;return y}}function array_search(needle,haystack,strict){for(var key in haystack){if((strict&&haystack[key]===needle)||(!strict&&haystack[key]==needle)){return key}}return false}function ksort(array){var tmp_arr={},keys=[],key_num=0,key;for(key in array){keys[key_num++]=key}keys=keys.sort();for(var i=0;i<key_num;i++){key=keys[i];tmp_arr[key]=array[key]}return tmp_arr}function get_cookies(){var cookies=[];if(document.cookie){var tar=document.cookie.split("; ");for(var x=0;x<tar.length;x++){var tmp=tar[x].split("=");cookies[tmp[0]]=tmp[1]}}return cookies}function set_cookie(name,value){var expiresTime=new Date();expiresTime.setTime(expiresTime.getTime()+999999*1000);document.cookie=name+"="+escape(value)+"; expires="+expiresTime.toGMTString()+"; path=/";return true}function get_cookie(name){var cookies=get_cookies();for(var x in cookies){if(x==name){return cookies[x]}}return null}function getOpacity(node){var opacityProp=getOpacityProperty();if(!node||!opacityProp)return;var opacity=opacityProp=="filter"?node.filters.alpha.opacity/100:node.style[opacityProp]||1;return opacity>=0.999999?1.0:Number(opacity)}function setOpacity(node,nOpacity){var opacityProp=getOpacityProperty();if(!node||!opacityProp)return;if(opacityProp=="filter"){nOpacity*=100;var oAlpha=node.filters['alpha']||node.filters.alpha;if(oAlpha)oAlpha.opacity=nOpacity;else node.style.filter+="alpha(opacity="+nOpacity+")"}else node.style[opacityProp]=nOpacity}function getOpacityProperty(){if(typeof document.body.style.opacity=='string')return'opacity';else if(typeof document.body.style.MozOpacity=='string')return'MozOpacity';else if(typeof document.body.style.KhtmlOpacity=='string')return'KhtmlOpacity';else if(document.body.filters&&navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5)return'filter';return false}function isset(variable){if(typeof(variable)=='undefined'||variable===null)return false;return true}function base64_encode(data){var b64='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';var o1,o2,o3,h1,h2,h3,h4,bits,i=ac=0,enc='',tmp_arr=[];data=utf8_encode(data);do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i<data.length);enc=tmp_arr.join('');switch(data.length%3){case 1:enc=enc.slice(0,-2)+'==';break;case 2:enc=enc.slice(0,-1)+'=';break}return enc}function utf8_encode(string){string=(string+'').replace(/\r\n/g,'\n');var utftext='',n,cl,enc,start=end=0,len=string.length;for(n=0;n<len;n++){c1=string.charCodeAt(n);enc=null;if(c1<128){end++}else if((c1>127)&&(c1<2048)){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128)}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128)}if(enc!=null){if(end>start)utftext+=string.substring(start,end);utftext+=enc;start=end=n+1}}if(end>start){utftext+=string.substring(start,string.length)}return utftext}var flagTime;function showHide(id,hide){var el=document.getElementById(id);if(el.className=='on'||hide===true)el.className='off';else el.className='on'}function flagClick(){showHide('flags')}function flagSelect(country,code){showHide('flags',true);document.getElementById('flag').title=country;country=country.replace(/\s/g,'_');set_cookie('country',country);set_cookie('country_code',code);document.getElementById('flag').src='/images/flags/Flag_'+country+'.gif'}function flagOut(){flagTime=window.setTimeout('flagTimer()',1000)}function flagOver(){if(flagTime)window.clearTimeout(flagTime)}function flagTimer(){showHide('flags',true)}
