var alltags=document.all? document.all : document.getElementsByTagName("*")
function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function Expandtoggle(ec){
   
    ccollect=getElementbyClass(alltags, "WorkE")
    statecollect=getElementbyClass(alltags, "WorkC")
    ProductCollect=getElementbyClass(alltags, "WorkP")
    ImageCollect=getElementbyClass(alltags,"StatusFlag")
    var inc=0
    while (ProductCollect[inc]){
        //ccollect[inc].style.display=""
        ProductCollect[inc].style.display=(ec=="contract")? "none" : "inline";    
        inc++
        }
        inc=0
        while (ccollect[inc]){
        ccollect[inc].style.display=(ec=="contract")? "none" : "inline";
        inc++
        }
        inc=0
        while (statecollect[inc]){
        statecollect[inc].style.display=(ec=="contract")? "inline" : "none";
        inc++
        }
        inc=0
        while (ImageCollect[inc]){
        var str=ImageCollect[inc].src
        var i=String(str).length;
        var j=str.substring(i-3)        
        if ( j=='gif' || j=='jpeg' || j=='bmp')
        {       
        }
        else
        {
        ImageCollect[inc].style.visibility="hidden";
        ImageCollect[inc].style.height=1;
        ImageCollect[inc].style.width=1;
        }        
        inc++
        }
        
}

function showInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "inline";
	}
	var ImageCollect=getElementbyClass(alltags,"StatusFlag")
	var  inc=0
        while (ImageCollect[inc]){
            var str=ImageCollect[inc].src
            var i=String(str).length;
            var j=str.substring(i-3)        
            if ( j=='gif' || j=='jpeg' || j=='bmp')
            {       
            }
            else
            {
            ImageCollect[inc].style.visibility="hidden";
            }        
            inc++
            }
}
function hideInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}

function toggleDisplay(divName){
	var tempDiv = document.getElementById(divName);
	if (!tempDiv) {
		return;
	}  
	 if ((tempDiv.style.display=="block")||(tempDiv.style.display=="" && tempDiv.className.indexOf("hid") == 0)){
	 	tempDiv.style.display="none";
	 }
	 else {	
	 	if ((tempDiv.style.display=="none")||(tempDiv.className.indexOf("hid") != 0)){
			tempDiv.style.display="block";
		}
	 }
}