var isExpanded   = false;
var expandStatus = new Array();

function getItem(id)
{
	var itm = false;
	if(document.getElementById) itm = document.getElementById(id);      //all browsers?        
	else if(document.all) itm = document.all[id];						//Opera+IE?          
	else if(document.layers)  itm = document.layers[id];                //IE?       
	return itm;
}

function toggleItem(id)
{
	itm = getItem(id);
	if(!itm) return false;
	if(itm.style.display == 'none'){
		itm.style.display = '';		
		expandStatus.push(id);
		isExpanded = true;
	}
	else{
		itm.style.display = 'none';
		expandStatus.pop();
		if(!expandStatus.length){
			isExpanded   = false;
		}
	}
}

function expandAll() {
 isExpanded=!isExpanded;
 elementsToCheck='DIV';
 elms=document.getElementsByTagName(elementsToCheck); 
         
    for (i=0;i<elms.length;i++)
     if(elms[i].className=="child")
		 if (isExpanded) elms[i].style.display =   "block" ;
		 else elms[i].style.display =  "none";
    
	if(isExpanded){
       getItem("zwin").style.display = "";
       getItem("pokaz").style.display = "none";
      }
	else{
        getItem("zwin").style.display = "none";
        getItem("pokaz").style.display = "";
		expandStatus = new Array();
	}

}

function _element(field_name){
	return document.getElementsByName(field_name).item(0)
}


function setBack(column, color){
	column.style.backgroundColor = color;
}

function sailspec(sail){
		void window.open("sail_spec.php?id="+sail, "sail_spec"+sail, "width=1, height=1, scrollbars=1");
	}	

function boomspec(sail){
	void window.open("boom_spec.php?id="+sail, "boom_spec"+sail, "width=1, height=1, scrollbars=1");
}

function mastspec(sail){
	void window.open("mast_spec.php?id="+sail, "mast_spec"+sail, "width=1, height=1, scrollbars=1");
}