function expand (textArea, icon) 
{
       jQuery('#'+textArea).toggle('fast',
                function()
                {        
                 if (jQuery('#'+textArea).css('display')=='none')
                 {
                  jQuery('#'+icon).html('(+)');
                 }
                 else
                 {
                  jQuery('#'+icon).html('(&ndash;)');
                 }
                 
                }
               );
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
			
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		
		}
		else { // IE 4
			document.all.id.style.display = 'block';

		}
	}
}

function resetAllForms(){
var allForms = document.forms;
var len = allForms.length;
for (var i=0; i<len; i++){
allForms[i].reset();
}
}
function getPageHeightWithScroll(){
    if (window.innerHeight && window.scrollMaxY) {// Firefox
        return( window.innerHeight + window.scrollMaxY);
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
        return(document.body.scrollHeight);
    } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
        return(document.body.offsetHeight+document.body.offsetTop);
      }
}

var vis=1;
function cover(obj) 
{
var cover=document.getElementById('cover');
var divPopup=document.getElementById(obj);
	if(vis)
	{
		vis=0;
             cover.style.height = getPageHeightWithScroll() + 'px';
			cover.style.display='block';   
		divPopup.style.display='block';        
	}
	else 
	{  
		vis=1;
		cover.style.display='none'; 
		divPopup.style.display='none'; 
                document.getElementById(obj).style.display='none';
	}
}