var pup

function helpWin(url) {
        var pup = window.open(url, 'helpwin','status=no,resizable=no,menubar=no,toolbar=no,scrollbars=yes,height=380,width=450');
        if (window.focus) {
          pup.focus();
        }
        }

 var DOM = (typeof(document.getElementById) != 'undefined');

// child windows hash
var top = {};



/// Check functions
function CheckAll(Element,Name)
{
        if (DOM) {
                thisCheckBoxes = Element.parentNode.parentNode.parentNode.getElementsByTagName('input');
                for (i = 1; i < thisCheckBoxes.length; i++) {
                        if (thisCheckBoxes[i].name == Name){
                                thisCheckBoxes[i].checked = Element.checked;
                                Colorize(document.getElementById(thisCheckBoxes[i].id.replace('cb','tr')), thisCheckBoxes[i]);
                        }
                }
        }
}

function CheckedOnLoad()
{
        if (DOM) {
                var thisCheckBoxes = document.getElementsByTagName('input');
                for (var i = 1; i < thisCheckBoxes.length; i++) {
                        var cb = thisCheckBoxes[i];
                        if (cb.name == 'ids[]'){
                                if (cb.checked) {
                                        cb.disabled = false;
                                        Colorize(document.getElementById(cb.id.replace('cb','tr')), cb);
                                }
                        }
                }
        }
}

function Colorize(Element, CBElement)
{
        if (Element && CBElement) {
                Element.className = (CBElement.checked ? 'selected' : 'default');
        }
}

function CheckRadioTR(Element)
{
        if (DOM) {
                CheckTR(Element);
                thisTRs = Element.parentNode.getElementsByTagName('tr');
                for (i = 0; i < thisTRs.length; i++){
                        if (thisTRs[i].id != Element.id && thisTRs[i].className != 'header') thisTRs[i].className = 'default';
                }
        }
}

function CheckTR(Element)
{
        if (DOM) {
        if(document.inf.close.value !=6)
        {
                thisCheckbox = document.getElementById(Element.id.replace('tr','cb'));
                thisCheckbox.checked = !thisCheckbox.checked;
                Colorize(Element, thisCheckbox);
                if(thisCheckbox.checked){document.inf.coun.value= document.inf.coun.value *1+1; }
                else {document.inf.coun.value= document.inf.coun.value *1-1; }
           }
         else {document.inf.close.value =0;}
        }
}

function CheckCB(Element)
{

        if (DOM) {

                if(document.getElementById(Element.id.replace('cb','tr')))
                {  Element.checked = !Element.checked;

                       }

        }

}

function chenge_check(Element)
{    var con = document.inf.coun.value;

  //  for (var i in Element) {
//if (Element.checked) { document.inf.coun.value= con *1+1;  Element.checked = true;}
//else  { document.inf.coun.value= con *1-1;  Element.checked = false;}}

  //  CheckCB(Element) ;
   if(Element.checked){document.inf.coun.value= con *1-1; }
    else if(!Element.checked) {document.inf.coun.value= con *1+1;}

}

function sbmfrm(hrf) {
	document.forms["inf"].action=hrf;
	document.forms["inf"].redurl.value=hrf;
	document.forms["inf"].submit();
}
function sbmfrm2(lnk) {
	document.forms["inf"].redurl.value=lnk;
	document.forms["inf"].submit();
}
