var MIN,SEC,WID=0,value,current=Math.floor(Math.random() * 7) + 1;// randomly showing any one of the updates when user sees any page instead of showing him the first update again and again.
var dump="";
var control=0;

function news(con)
{
	

	
	if(con==1)
	{
	document.getElementById("newsflash").innerHTML="";
	dump="";
	WID=0;
		if(current==0)
		current=5;
		else
		current--;
		}
	if(con==2)
	{
	document.getElementById("newsflash").innerHTML="";
	dump="";
	WID=0;
		if(current==7)
		current=0;
		else
		current++;
		}
		control=con;
		}
//this is the main function to start the timer
var display;

function timer() //the function timer gets started once the page loads... onload()
{
	MIN=00;
	SEC=00;
	start_latestnews();
	list();
}

function change_color(elem)
	{
		var x=document.getElementById(elem);
		x.style.display=none;
	}
	
	function restore_color(elem2)
	{
	}	


function currentPage(){
document.getElementById("cp").value=(location.href);
}
function fun()
{
			var obj1=document.getElementById('a');
			obj1.style.display='';
			var obj2=document.getElementById('b');
			obj2.style.display='';
			var obj3=document.getElementById('c');
			obj3.style.display='';
			
}

function search()
{
//var tmp=document.getElementById("searching").value;
document
document.getElementById("searching").innerHTML="<br><div align='right'><form method=get action='search.php' name='frm'>\
<input onBlur='hidesearch();' type='text' id='srch' name='q' >\
<input type='hidden' name='module'></form>";
document.getElementById("srch").focus();
}
function hidesearch()
{
document.getElementById("searching").innerHTML="";
}
function login()
{
	
	var temp3 = document.getElementById("display").value; 
	document.getElementById("display").innerHTML='<br><form method=post action="./login.php"><table border=0 bgcolor=#c5dcc5 align=right><tr><td><font color=black>Username:</font></td><td><input style=width:150px; id="user_field" type=text onBlur=hide(0) name="uid"></td></tr><tr><td><font color=black>Password:</font></td><td><input id=pass onBlur=hide(0) type=password style=width:150px; name=pword></td></tr><tr><td></td><td><input id="cp" type=hidden name=cpg ><input type=submit onclick=currentPage();" value=Submit></td></tr><tr><td></td></tr></table></form>';
	
	document.getElementById("user_field").focus();
	document.getElementById("close").innerHTML="<a href=JavaScript:hide(1)>Close</a>";
	
}
function hide(identify)
{
    var temp1 = document.getElementById("user_field").value;  
	var temp2 = document.getElementById("pass").value;
	
	if((temp1=="" && temp2=="" && identify==0) || identify==1){
	document.getElementById("close").innerHTML="<a href=JavaScript:login()>Login</a>";
	document.getElementById("display").innerHTML="";

	}
	}




function enlarge(content)
{ 
	var previous,next;
	previous=content-1;
	next=parseInt(content)+1;
	document.getElementById(content).style.width="70px";
	document.getElementById(content).style.height="70px";
	
	document.getElementById("name"+content).style.color="green";
	document.getElementById("name"+content).style.fontWeight="bold";
	if(content!=9)
	{
		document.getElementById(next).style.width="60px";
		document.getElementById(next).style.height="60px";
		}
	if(content!=1)
	{
		document.getElementById(previous).style.width="60px";
		document.getElementById(previous).style.height="60px";
		}
	
	}
function shrink(content)
{
    var	 previous,next;
	previous=content-1;
	next=parseInt(content)+1;
	document.getElementById(content).style.width="";
	document.getElementById(content).style.height="";
	document.getElementById("name"+content).style.color="";
	document.getElementById("name"+content).style.fontWeight="";
	if(content!=9)
	{
		document.getElementById(next).style.width="";
		document.getElementById(next).style.height="";
		}
	if(content!=1)
	{
		document.getElementById(previous).style.width="";
		document.getElementById(previous).style.height="";
		}
	}
	
function list()
{
    document.getElementById("list").style.visibility="visible";
    document.getElementById("list").style.height="100px";
	
    document.getElementById("online").innerHTML="<a href=JavaScript:dontlist()>Hide</a>";
	}
function dontlist()
{
	document.getElementById("online").innerHTML="<a href=JavaScript:list()>Show</div>";
	document.getElementById("list").style.visibility ="collapse";
	document.getElementById("list").style.height="0px";
	
	
	}

