// go, basically a handler for onclick events.
// go('/foo/bar') has the same effect as href='/foo/bar'
function go(url) {
	this.location.href = url;
	return false;
}

var popup=null;
function setFocus(form,field){ 
 if (form!='') {
	try	{document.forms[form][field].focus();} catch(e) {}
 }
 else {
	try	{document.forms[0][field].focus();} catch(e) {}
 }
} 
function winpop(loc,w,h,scroll) {
	var name = loc.replace(/\W/g, "");
	window.open(loc,name,'width='+w+', height='+h+', location=no, directories=no, menubar=no, scrollbars='+scroll+', resizable=no, status=no, toolbar=no');
}
function hidestatus(){
window.status=''
return true
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus


function getById(tag)
{
  if (document.getElementById) //  Netscape, Mozilla, etc. 
  {
    return document.getElementById(tag);
  }
  else if (document.all)      //  IE, Konqueror, etc.
  {
	return document.all[tag];
  }
}

function blockingall(tag)	{
	if (document.getElementById)	{
		var state = document.getElementById(tag).style.display;		}
	else if (document.all)	{
		var state = document.all[tag].style.display;	}
	var newState = "block";
	if (document.getElementById)	{
		document.getElementById(tag).style.display = newState;	}
	else if (document.all)	{
		document.all[tag].style.display = newState;	}
}

function hidingall(tag)	{
	if (document.getElementById)	{
		var state = document.getElementById(tag).style.display;		}
	else if (document.all)	{
		var state = document.all[tag].style.display;	}
	var newState = "none";
	if (document.getElementById)	{
		document.getElementById(tag).style.display = newState;	}
	else if (document.all)	{
		document.all[tag].style.display = newState;	}
}

function show_profilepic(fname, toggle)
{
    if (toggle == 1)
    {
        obj_infoPic = document.getElementById("pLayer")
        obj_infoPic.style.display = '';
        obj_image = document.getElementById("pLayerBody");
        obj_image.innerHTML = '<img src="' + fname + '" alt="" class="profilepicLayer" border="0" />';
    }
    else
    {
        obj_infoPic = document.getElementById("pLayer")
        obj_infoPic.style.display = 'none';
    }
}

function switchdiv(div1_id, div2_id, form)
{
	if (document.getElementById)	{
	    if(!document.getElementById(div1_id)) return ;
	    if(!(document.getElementById(div1_id).style)) return ;
	    if(!(document.getElementById(div1_id).style.display)) return ;
	
		var state1 = document.getElementById(div1_id).style.display;
		if(state1=="none") {
        		document.getElementById(div1_id).style.display="block";
        		document.getElementById(div2_id).style.display="none";		
                if (form != null)
                {
                   form[div1_id].value='true';
                   form[div2_id].value='false';
                 }
	     }
	    if(state1=="block") {
        		document.getElementById(div2_id).style.display="block";		
        		document.getElementById(div1_id).style.display="none";
                if (form != null)
                {
                   form[div1_id].value='false';
                   form[div2_id].value='true';
                 }
	     }
	}
	else if (document.all)	{
	    if(!document.all[div1_id]) return ;
	    if(!(document.all[div1_id].style)) return ;
	    if(!(document.all[div1_id].style.display)) return ;
	
		var state1 = document.all[div1_id].style.display;	
		if(state1=="none") {
		        document.all[div1_id].style.display = "block";
		        document.all[div2_id].style.display = "none";
                if (form != null)
                {
                   form[div1_id].value='true';
                   form[div2_id].value='false';
                 }			
		}	
		if(state1=="block") {
        		document.getElementById(div1_id).style.display="none";
        		document.getElementById(div2_id).style.display="block";		
                if (form != null)
                {
                   form[div1_id].value='false';
                   form[div2_id].value='true';
                 }
	     }
    }
}