function Go(link){
    document.location=link;
    return true
    }
function CGo(link,mesg){
    if(confirm(mesg)){
        document.location=link;return true
        }
    }
function _v(id){
    return document.getElementById(id)
}

function _h(id){
    _v(id).style.display='none'
    }

function _s(id){
    _v(id).style.display='block'
}
function cSubm(id,fm){
    if('add_idea_link'==_v(id).className
    )_v(fm).submit()
}

function Show(link,w,h){
    if(!w){w=100}if(!h){h=100}window.open(link,'popup','resizable=1,left=150,top=150, width='+w+', height='+h+', scrollbars=yes')}
    
function number_format(number,decimals,dec_point,thousands_sep){
    
    var n=number,prec=decimals;n=!isFinite(+n)?0:+n;prec=!isFinite(+prec)?0:Math.abs(prec);var sep=(typeof thousands_sep=="undefined")?',':thousands_sep;var dec=(typeof dec_point=="undefined")?'.':dec_point;var s=(prec>0)?n.toFixed(prec):Math.round(n).toFixed(prec);var abs=Math.abs(n).toFixed(prec);var _,i;if(abs>=1000){_=abs.split(/\D/);i=_[0].length%3||3;_[0]=s.slice(0,i+(n<0))+_[0].slice(i).replace(/(\d{3})/g,sep+'$1');s=_.join(dec)}else{s=s.replace('.',dec)}return s}
	
	function IsNumeric(strString){var strValidChars="0123456789.-";var strChar;var blnResult=true;if(strString.length==0)return false;for(i=0;i<strString.length&&blnResult==true;i++){strChar=strString.charAt(i);if(strValidChars.indexOf(strChar)==-1){blnResult=false}}return blnResult}
	function switch_element(id){if(document.getElementById(id).style.display!="none"){document.getElementById(id).style.display="none"}else{document.getElementById(id).style.display=""}return false}
	function popup(file,width,height){window.open(file,"site_path","height="+height+",width="+width+",status=no,location=no,toolbar=no,directories=no,resizable=yes,scrollbars=yes,menubar=no,top=10,left=10")}
	function makeSiteLink(name){if(!window.js_base_url){str=document.location.toString();js_base_url=str.replace("/javascript/editor/scripts/hyperlink.htm","");js_base_url=js_base_url.replace("/javascript/editor/scripts/moz/hyperlink.htm","")}popup(js_base_url+'/admin/index.php?mod=tree&action=mini_browser&returnname='+name,'600','400')}
	function retBack(obj,str){window.close();obj.value=str}function insertIntoWYSIWYG(str){doc="window.opener";for(property in eval(doc)){fullPropertyName="document."+property;if(fullPropertyName.indexOf("document.myStyle")!=-1){objName=fullPropertyName.replace("document.myStyle","");break}}objName=eval(doc+".window."+objName);objName.insertCustomTag(str);self.window.close()}function check4compare(obj){for(i=0;i<obj.elements.length;i++)if(obj.elements[i].type=="checkbox"&&obj.elements[i].checked)return true;alert('Не выделено ни одного продукта для сравнения');return false}
	
	function switch_loading_box(box_id){if(document.getElementById(box_id).style.display!="none"){document.getElementById(box_id).style.display="none"}else{document.getElementById(box_id).style.display="";var ie=document.all;iebody=document.body;var scroll_top=(ie)?iebody.scrollTop:window.pageYOffset;var docwidth=(ie)?iebody.clientWidth:window.innerWidth;docheight=(ie)?iebody.clientHeight:window.innerHeight;var objwidth=document.getElementById(box_id).offsetWidth;objheight=document.getElementById(box_id).offsetHeight;var test=docwidth/2-objwidth/2+"px";document.getElementById(box_id).style.left=docwidth/2-objwidth/2+"px";document.getElementById(box_id).style.top=scroll_top+docheight/2-objheight/2+"px"}return false}
    
     function win(url)
            {
                window.open(url, "face", "width=550,height=450,left=100,top=100");

                return false;
            }