function doLoading(){		

// For preloading the images
	var d=document;
	var myimages= new Array(	
		'top_home_l.gif',
		'top_admin_l.gif',
		'top_webmail_l.gif',
		'top_contact_l.gif',
		'abtus_l.gif',
		'admission_l.gif',
		'activities_l.gif',
		'acad_courses_l.gif',
		'dept_l.gif',
		'teaching_hs_l.gif',
		'ethics_l.gif',
		'notices_l.gif',
		'journal_l.gif',
  		'tdhover.gif',
		'wait.gif'
	);
	if(!d.preLoads){
		d.preLoads = new Array;
		for(var i=0; i<myimages.length; i++){
			d.preLoads[i] = new Image;
			d.preLoads[i].src='images/'+myimages[i];
			}
		}
}

function MouseOn(name){
	document.getElementById(name).src='images/'+name+'_l.gif';
}

function MouseOut(name){
	document.getElementById(name).src='images/'+name+'.gif';
}


function writeNotice(){

	var theSrc='addEntry.php?Content=Notices';
	showFloatingDiv(theSrc,530,400);
}

function writeNews(){

	var theSrc='addEntry.php?Content=News';
	showFloatingDiv(theSrc,530,400);
}

function editEntry(content,id){
	var theSrc='editEntry.php?Content='+content+'&Id='+id;
	showFloatingDiv(theSrc,530,400);
}

function addFaculty(department){

	var theSrc='addFaculty.php?Department='+department;
	showFloatingDiv(theSrc,530,250);
}

function editFaculty(id){
	var theSrc='editFaculty.php?Id='+id;
	showFloatingDiv(theSrc,530,300);
}

function addGovern(){

	var theSrc='addGovern.php';
	showFloatingDiv(theSrc,530,250);
}

function editGovern(id){
	var theSrc='editGovern.php?Id='+id;
	showFloatingDiv(theSrc,530,300);
}

function addFile(content){

	var theSrc='addFile.php?Content='+content;
	showFloatingDiv(theSrc,530,180);
}

function addAd(){

	var theSrc='addAd.php';
	showFloatingDiv(theSrc,430,180);
}

function renContent(Id){

	var theSrc='rename.php?Id='+Id;
	showFloatingDiv(theSrc,400,150);
}


function delContent(Page,Id){
	
	var sureDel = confirm ("Delete this Content ?")	
	
	if(sureDel){
		var sDate=new Date();
		var cTime=sDate.getMilliseconds();
	
		var e = document.createElement("script");
	
		e.id='dynascr';
		e.src = 'delContent.php?Page='+Page+'&Id='+Id+'&Chk='+cTime;
		e.type="text/javascript";
		e.language="javascript";
		e.defer="true";
		if(document.getElementById('dynascr')){
			document.body.removeChild(document.getElementById('dynascr'));
		}
		document.body.appendChild(e);
		}
}

function login(){

	var theSrc='login.php';
	showFloatingDiv(theSrc,200,150);
}

function showFloatingDiv(theSrc,wd,ht){

	document.getElementById('infrm').src='';
	document.getElementById('infrm').width=wd;
	document.getElementById('infrm').height=ht;
	if(ht>document.body.clientHeight){ht=document.body.clientHeight-10;}
	if(wd>document.body.clientWidth){wd=document.body.clientWidth-10;}
	document.getElementById('infrm').src=theSrc;
	document.getElementById('flContent').style.visibility='visible';
	document.getElementById('flContent').style.top=(document.body.clientHeight-ht)/2 + document.body.scrollTop;
	document.getElementById('flContent').style.left=(document.body.clientWidth-wd)/2;

}

