	var hght;
    var frm;
	var rolling=0;    
function signinrefresh(elem)
{
 	var unme='';
	if(document.getElementById('username'))
	unme=' value="'+document.getElementById('username').value+'"';
   	if(document.getElementById('breadcrumbpath'))
	{
		document.getElementById('breadcrumbpath').innerHTML='<table border="0" cellpadding="0" cellspacing="0"><tr><td class="pathelements"><a href="index.php">Goonj 2008</a></td><td class="pathelements"><a href="">Guest</a></td><td style="padding-left:10px;padding-right:20px;"><a href="">Sign In</a></td></tr></table>';
		document.getElementById(elem).innerHTML='<li class="pagehead">Sign In</li><li class="pagedetails"><form onsubmit="return buildnsend(this,\''+elem+'\',\'0\')" style="margin: 0px"><table border="0" cellspacing="1" cellpadding="0" width="179"><tr height="22"><td style="padding-left:8px;">Username:</td><td><input type="text"  class="text" name="username" size="15" id="username" '+unme+' /></td></tr><tr height="20"><td style="padding-left:8px;">Password:</td><td><input type="password"  class="text" name="password" size="15" id="password" /></td></tr><tr height="20"><td colspan="2" align="center"><input type="hidden" size="25" name="page" value="login.php" /><input type="hidden" size="25" name="sec" value="'+elem+'" /><input type="image" src="images/submit.jpg"></td></tr></table></form></li>';	
	}else                                                               
	{
		document.getElementById(elem).innerHTML='<form onsubmit="return buildnsend(this,\''+elem+'\',\'0\')" style="margin: 0px"><table border="0" cellspacing="1" cellpadding="0" width="179"><tr height="22"><td style="padding-left:8px;">Username:</td><td><input type="text"  class="text" name="username" size="15" id="username" '+unme+' /></td></tr><tr height="20"><td style="padding-left:8px;">Password:</td><td><input type="password"  class="text" name="password" size="15" id="password" /></td></tr><tr height="20"><td colspan="2" align="center"><input type="hidden" size="25" name="page" value="login.php" /><input type="hidden" size="25" name="sec" value="'+elem+'" /><input type="image" src="images/submit.jpg"></td></tr></table></form>';
	}
}	
function signincheck()
{
 	if(!rolling)
	{
		frm = document.getElementById('signin');
		if(frm.currentStyle)
		{
		hght = frm.currentStyle["height"];
		}else
		{
			var computedStyle = document.defaultView.getComputedStyle(frm,""); 
			hght = computedStyle.getPropertyValue("height");
		}
		hght = hght.slice(0,-2);
		hght = parseInt(hght);
		if(!hght)
		{
   			document.getElementById('signin').style.display='block';
		 	signinrefresh('signbox');    
			signinInterval = setInterval("showform()",20);
			rolling=1;	
		}else
		{
			signinInterval = setInterval("hideform()",20);	
			rolling=1;
		}
	}
}

function showform()
{
	frm = document.getElementById('signin');
	if(frm.currentStyle)
	{
	hght = frm.currentStyle["height"];
	}else
	{
		var computedStyle = document.defaultView.getComputedStyle(frm,""); 
		hght = computedStyle.getPropertyValue("height");
	}
	hght = hght.slice(0,-2);
	hght = parseInt(hght)+3;
	document.getElementById('signin').style.height=hght+'px';
	if(hght>=106)
	{
		clearInterval(signinInterval);	
		rolling=0;
	}
}

function hideform(stp,min)
{
	frm = document.getElementById('signin');
	if(frm.currentStyle)
	{
	hght = frm.currentStyle["height"];
	}else
	{
		var computedStyle = document.defaultView.getComputedStyle(frm,""); 
		hght = computedStyle.getPropertyValue("height");
	}
	hght = hght.slice(0,-2);
	hght = parseInt(hght)-3;
	document.getElementById('signin').style.height=hght+'px';
	if(hght<=0)
	{
		document.getElementById('signin').style.display='none';
		clearInterval(signinInterval);
		rolling=0;	
	}
}
