function bag_link(link) {
	document.location.href = link;
	return false;
}

function winopen (popupURL,width,height) {
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height );
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}

function winopen_mess (popupURL,width,height) {
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height );
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}

function sub_zakaz(){
    document.forms["pre_zakaz"].ac.value=0;
    document.forms["pre_zakaz"].submit();
}

function sub_del(id){
    document.forms["pre_zakaz"].ac.value=1;
    document.forms["pre_zakaz"].itemid.value=id;
    document.forms["pre_zakaz"].submit();
}

function sub_ch(){
    document.forms["pre_zakaz"].ac.value=2;
    document.pre_zakaz.submit();
}

function showBlock(blk){
       var agt = navigator.userAgent.toLowerCase();
       var is_bsd   = (agt.indexOf("bsd") != -1);
       var is_x11   = (agt.indexOf("x11") != -1);
       var is_linux = (agt.indexOf("linux") != -1);
       var is_mac   = (agt.indexOf("mac") != -1);
       obj = document.getElementById(blk).style;
       if ( is_bsd || is_x11 || is_linux || is_mac ) {
             obj.top = '20px';
       }
       obj.display = (obj.display != 'block' ? 'block' : 'none');
}


function ShowHide(elem, icon_elem){
  var s = elem.style;
  s.display = (s.display != 'none') ? 'none': '';
  if(icon_elem) { icon_elem.innerHTML = (s.display != 'none') ? '[+]': '[&ndash;]'; }
}

