<!--
	var imagenumber=1;
	var imageparam;
	var maximages=6;
	var imgobj;
	var waittime=3000;

	function preloadBanners() 
	{
		imageobj=new Array();
		loadcount = 0
		while (loadcount != maximages) 
		{
			loadcount++;
			imageobj[loadcount-1] = new Image();
			imageobj[loadcount-1].src = "images/laptopscreen"  + loadcount +".gif";				
		}
	}

	

	function setdivbackgroundopacity(divid, opacitypercentage) {

//		Set a new opacity of an object
//		objectstyle should be the style object of the DOM element to be set.
//		opacitypercentage is the percentage it should be set to.
   
		var objectstyle = document.getElementById(divid).style;
			
   		objectstyle.opacity = (opacitypercentage / 100);
   		objectstyle.MozOpacity = (opacitypercentage / 100);
   		objectstyle.KhtmlOpacity = (opacitypercentage/ 100);
   		objectstyle.filter = "alpha(opacity=" + opacitypercentage + ")";
	}


	function changeimage() {		
			
		imageparam = "url('images/laptopscreen"  + imagenumber +".gif')";
		imagenumber=imagenumber+1;
		if (imagenumber == maximages+1) imagenumber= 1;
			
//		
//		Set the background image = foreground image
//		Set the foreground image invisble (opacity = 0 )
//		Set the foreground image to next image
//

		document.getElementById('MonitorLower').style.backgroundImage=document.getElementById('MonitorUpper').style.backgroundImage;
		document.getElementById('MonitorUpper').style.backgroundImage=imageparam;
			
		setdivbackgroundopacity('MonitorUpper',0);	

//		fade in the top image

    		for(i = 0; i <= 100; i++) {
	       		setTimeout("setdivbackgroundopacity('MonitorUpper'," + i + ")",(i * 20));
        	}
		window.setTimeout("changeimage()",waittime);
		waittime=6000;
	}
			
	
	var newwindow;
	function popup(contentlink, windowname)
	{
		var href;
		if (typeof(contentlink) == "string")
		{		
			href=contentlink;
		}
		else
 		{	
			href=contentlink.href;
		}
		
		newwindow= window.open(href, windowname, "width=600,height=400,left=300,top=300,location=0,menubar=0, status=0, title=0");
		if(window.focus){newwindow.focus()}
		return false;
	}
	
	function getfolder()
	{

		var url = window.location.pathname;
		var strpos = 0;
		var endfirst = 0;
		var startsecond = 0;
		strpos = url.indexOf("\/");
		while ( strpos > -1)
		{
			if (strpos == 0)
			{
				url = "\\" + url.substr(1);	// strip leading character
			}	
			else
			{
				url = url.substr(0,strpos) + "\\" + url.substr(strpos+1);
			}
			strpos = url.indexOf("\/");	
		}

//	First strip off the filename

		strpos = url.lastIndexOf("\\");	
		url = url.substr(0,strpos);

//	Now get the foldername
	
		strpos = url.lastIndexOf("\\");	
		url = url.substr(strpos+1);		
		return url;
	}

	function getpage()
	{

		var url = document.URL;
		strpos=url.lastIndexOf("\/") + 1;
		url = url.substr(strpos);
		if (url == "")
		{
			url = "index.html";
		}
		return url;
	}

/********************************************************************************************************/
/*													*/
/*	Account Handling windows functions	-  openattachpopup &	closeattachpopup		*/
/*													*/
/********************************************************************************************************/

	function openaccountwindow() 
	{
		
		 	url=getpage();
			params  = 'width='+(screen.width);
 			params += ', height='+(screen.height);
 			params += ', top=0, left=0';
			params += ', fullscreen=no';
			params += ', scrollbars=yes';
	 		if ((getfolder() == "scripts")) 
			{
				winref=window.open( "./account.php?source="+url,"DGDaccountwindow" , params);
			}
			else
			{
				winref=window.open( "./scripts/account.php?source="+url,"DGDaccountwindow" , params);
			}
 			if (window.focus) {winref.focus()}
			
 		return false;
	}

	
	function exitaccountwindow(url)
	{
		
		var answer = confirm ("Please confirm you want to browse away from this window.\n\n" + 
				     "If you browse away, the session window will be closed. If you have information\nthat has not been saved it will be lost.\n\n" + 
					      "Should you wish to keep this window open, or save away any unsecured\ninformation, please cancel this request.");	
		if (answer)
		{
			
			self.close();
			if (url != "")
			{
				if (window.opener && !window.opener.closed) window.opener.location.href = url;
			}
			if (window.opener && !window.opener.closed) window.opener.focus();
			return true;
		}
		return false;
	}


	function logoutaccountwindow(mode)
	{

		if (mode == 0)
		{
	
			return confirm ("Please confirm you want to disconnect.\n\n" + 
					"If you disconnect, any information that have entered will be no longer be available. You should only disconnect when\n" +
 					"you have completely finished and want to be sure that information you have entered is not left available to others.\n\n" +
					"If you have not completely finished, cancel this request and continue to work on or submit your proposal.");
		}	

		else
		{
			return confirm ("Do you want to end your account session?\n\n" + 
					      "If you end the session, any information that has not been saved will be lost and the session window closed.\n" + 
					      "If you wish to save any information you have just entered, cancel this request and use the Save Changes command.")
		}
	}
		
	function closeaccountwindow(url)
	{
		
		self.close();
//		if (window.opener && !window.opener.closed) window.opener.location.href = url;
		if (window.opener && !window.opener.closed) window.opener.focus();
		return false;
	}

	
	function textLimit(field, maxlen) 
	{
		if (field.value.length > maxlen)
		field.value = field.value.substring(0, maxlen);
	}

/********************************************************************************************************/
/*													*/
/*	Attachment pop up windows functions	-  openattachpopup &	closeattachpopup		*/
/*													*/
/********************************************************************************************************/

	var attachpopupwindow;

	function openattachpopup(attachmentform, windowname)
	{
		var w = 1000, h = 500;

		if (document.all || document.layers) 
		{
			w = screen.availWidth;
   			h = screen.availHeight;
		}

		var popW = 1030, popH = 500;
		var leftPos = (w-popW)/2, topPos = (h-popH)/2;

		params  = 'width='+popW;
 		params += ', height='+popH;
		params += ', top='+topPos;
		params += ', left='+leftPos;
		params += ', scrollbars=yes';
 		
		attachpopupwindow=window.open("", windowname,  params);
		attachmentform.target=windowname;
		attachpopupwindow.focus();
		return true;
	}

	
	function closeattachpopup() 
	{
		self.close();
		if (window.opener && !window.opener.closed)window.opener.focus();
		return true;
	}

	function loadattachmentdir()
	{
		this.document.upload_form.serverdir.value = opener.document.proposal_form.serverdir.value;
	}

		
	function saveloadedfile(savedfile)
	{
		if (savedfile != "")
		{
			if (opener.document.proposal_form.attachments.value != "")
			{
				opener.document.proposal_form.attachments.value = opener.document.proposal_form.attachments.value + '\n' + savedfile;
			}
			else
			{
				opener.document.proposal_form.attachments.value = savedfile;
			}
		}
	}

	function checkcallerwindowopen()
	{
		if (window.opener && !window.opener.closed)
		{
		}
		else
		{
			alert ("The proposal window, that opened this file attachment pop-up window, has been \nclosed or browsed away from." +
				"It is not possible to save attachments to this (closed) proposal\nuntil it is reopened.\n\n"  +
				"This window will now be closed.	");
			self.close();
			return true;
		}
	}
	


	function submitFunction() {
		document.upload_form.action= "DGDupload.pl";
	}
-->
