/* (c) 2006 Field of View (www.fov.ru) */
var CLR=new Object();CLR.version=1442;CLR.AddEvent=function(obj,event,handler){tmp='__tmp';obj[event]=function(e){if(!e){e=window.event;}if(!e.target){e.target=e.srcElement;}obj[tmp]=handler;result=obj[tmp](e);obj[tmp]=null;return result;}};CLR.AddStrictEvent=function(obj,event,handler){tmp='__tmp';obj[event]=function(e){if(!e){e=window.event;}if(!e.target){e.target=e.srcElement;}obj[tmp]=handler;result=obj[tmp](e);obj[tmp]=null;e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return result;}};CLR.Append=function(baseVar,newValue){return newValue?newValue:baseVar;};CLR.ArrayToQuery=function(arr){var data='';for(var key in arr){data+='&'+key+'='+encodeURIComponent(arr[key]);}return data.substr(1);};CLR.FormatNumber=function(num,decNum,decSep,thSep){base=String(Math.ceil(num));fbase='';for(j=base.length;j>=0;j--){if((j<base.length-3)&&((base.length-j-1)%3==0)){fbase=thSep+fbase;}fbase=base.substr(j,1)+fbase;}base=fbase;tmp=String(Math.round(num*Math.pow(10,decNum)));decimals=tmp.substr(tmp.length-decNum,decNum);return base+decSep+decimals;};CLR.GetObject=function(id){return document.getElementById(id);};CLR.GetParentNode=function(name,node){while(node&&node.tagName.toLowerCase()!=name){node=node.parentNode;}return node;};CLR.GetClass=function(node){return(cname=node.getAttribute('class'))?cname:node.getAttribute('className');};CLR.GetCSSValue=function(element,property){if(element.currentStyle){return element.currentStyle[property];}else if(window.getComputedStyle){return document.defaultView.getComputedStyle(element,null).getPropertyValue(property);}};CLR.GetOffsetLeft=function(){return document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;};CLR.GetOffsetTop=function(){return document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;};CLR.GetPixelLeft=function(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}else if(obj.x){curleft+=obj.x;}return curleft;};CLR.GetPixelTop=function(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}else if(obj.y){curtop+=obj.y;}return curtop;};CLR.GetScreenHeight=function(){if(document.body.clientHeight){if(document.documentElement.clientHeight&&(document.documentElement.clientHeight<document.body.clientHeight)){return document.documentElement.clientHeight;}return document.body.clientHeight;}else if(document.documentElement.clientHeight){return document.documentElement.clientHeight;}};CLR.GetScreenWidth=function(){if(document.body.clientWidth){if(document.documentElement.clientWidth&&(document.documentElement.clientWidth<document.body.clientWidth)){return document.documentElement.clientWidth;}return document.body.clientWidth;}else if(document.documentElement.clientWidth){return document.documentElement.clientWidth;}};CLR.GetURL=function(uri){url=document.location.protocol+'/'+'/'+document.location.hostname;if(uri.substr(0,1)=='/'){url+=uri;}else{url+=document.location.pathname.replace(/\/[^\/]+$/,'/')+uri;}return url;};CLR.GetUserAgentInfo=function(){if(window.userAgentInfo){return window.userAgentInfo;}var userAgent=navigator.userAgent;var userAgentName=navigator.appName;var userAgentVersion=navigator.appVersion;var info=new Object();var matches;if(userAgentName.search(/Microsoft\sInternet\sExplorer/i)!=-1){info.engine='MSIE';info.name='Internet Explorer';matches=userAgentVersion.match(/(\d\.\d)/);if(matches&&matches[1].length>0){info.version=matches[1];}else{info.version=false;}}else if(userAgent.search(/Firefox/i)!=-1){info.engine='Gecko';info.name='Firefox';matches=userAgentVersion.match(/Firefox\/(\d\.\d)/);if(matches&&matches[1].length>0){info.version=matches[1];}else{info.version=false;}}else if(userAgent.search(/Mozilla/i)!=-1){info.engine='Gecko';info.name='Mozilla';matches=userAgentVersion.match(/(\d\.\d)/);if(matches&&matches[1].length>0){info.version=matches[1];}else{info.version=false;}}else if(userAgentName.search(/Opera/i)!=-1){info.engine='Opera';info.name='Opera';matches=userAgentVersion.match(/(\d\.\d)/);if(matches&&matches[1].length>0){info.version=matches[1];}else{info.version=false;}}else{info.engine=false;info.name=false;info.version=false;}window.userAgentInfo=info;return info;};CLR.ProcessTemplate=function(template,values){for(var key in values){template=template.replace(new RegExp('\{'+key+'\}'),values[key]);}return template;};CLR.RandomNumber=function(min,max){return Math.round(min+(max-min)*Math.random());};CLR.RandomString=function(len){matrix='0123456789abcdefghijklmnopqrstuvwxyz';str='';for(i=1;i<=len;i++){str+=matrix.substr(CLR.RandomNumber(0,matrix.length-1),1);};return str;};CLR.ReplaceNodeContents=function(dstNode,srcNode){var i,nodes,node;nodes=dstNode.childNodes;for(i=nodes.length-1;i>=0;i--){dstNode.removeChild(nodes[i]);}nodes=srcNode.childNodes;for(i=0;i<nodes.length;i++){dstNode.appendChild(nodes[i].cloneNode(true));}};CLR.RxGet=function(str,rx,i){if(m=str.match(rx)){return m[i];}};CLR.RxQuote=function(str){};CLR.SetClass=function(node,value){node.setAttribute((navigator.appName.search(/Microsoft\sInternet\sExplorer/i)!=-1)?'className':'class',value);};