//position and height
function getDim(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
		
		
	return {x:lx,y:ly}
}

                     
//div handling
var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  } 
  else this.exists = false;
}


function hideFormList() {
	selectLists = document.getElementsByTagName('select');
	                                                            
	for (var counter=0; counter<selectLists.length; counter++) 
	    selectLists[counter].style.visibility = 'hidden';    	
}  
function showFormList() {
	selectLists = document.getElementsByTagName('select');
	                                                            
	for (var counter=0; counter<selectLists.length; counter++) 
	    selectLists[counter].style.visibility = 'visible';   
}



function showFullAboutSection() {	         
	if (!DHTML) return;              
 	calculateCoordinates();        

	var x = new getObj('about_section');
	x.style.visibility = 'visible';
	x.style.top = top_dim.y - 26;
	if (left_dim.x == 0) x.style.left = top_dim.x;
	else x.style.left = left_dim.x;
	x.style.height = div_height + 'px';  
	
	hideFullLinksSection();
	hideFormList();
}

function hideFullAboutSection() {     
	var x = new getObj('about_section');
	x.style.visibility = 'hidden'; 
	
	showFormList();
	}    
	

function showFullLinksSection() {         
	if (!DHTML) return;              
 	calculateCoordinates();
	                                     
	var x = new getObj('links_section');
	x.style.visibility = 'visible';
	x.style.top = top_dim.y - 26;
	if (left_dim.x == 0) x.style.left = top_dim.x;
	else x.style.left = left_dim.x;
	x.style.height = div_height + 'px';  
	
	hideFullAboutSection();
	hideFormList();
}

function hideFullLinksSection() {     
	var x = new getObj('links_section');
	x.style.visibility = 'hidden';  
	
	showFormList();
	} 
	
function calculateCoordinates() {
	top_dim = getDim(document.images.top_pos);
	bottom_dim = getDim(document.images.bottom_pos);	
	left_dim = getDim(document.images.left_pos); 
	

	 
	//alert(left_dim.x);    

			
	var x = new getObj('bottom_pos');
	dim = getDim(x.obj);	                       
	div_height = dim.y - top_dim.y + 15;    
}

function repositionAll() {
     calculateCoordinates();  
     
     	var x = new getObj('about_section');
	x.style.top = top_dim.y - 26;
	if (left_dim.x == 0) x.style.left = top_dim.x;
	else x.style.left = left_dim.x;
	x.style.height = div_height + 'px';     
	
	var x = new getObj('links_section');
	x.style.top = top_dim.y - 26;
	if (left_dim.x == 0) x.style.left = top_dim.x;
	else x.style.left = left_dim.x;
	x.style.height = div_height + 'px';  
     
}
