// Does a nifty grey fade out when logging out 

function log_out()
{
	//ht = document.getElementById("qname");
	ht = document.getElementsByTagName("body"); 
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Are you sure you want to log out?'))
	{
		return true;
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}


// Function to disable right-clicking
var message="Function Disabled!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
/*
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
*/

// Alternative Right Click Method
function rclick()
{
   alert ('Function Disabled!');
   return false;
}

// Add to Favourites
function AddToFavourites (url,title)
{ 

var agt = navigator.userAgent.toLowerCase(); 
var app = navigator.appName.toLowerCase(); 
var ieAgent = agt.indexOf('msie'); 
var nsAgent = app.indexOf('netscape'); 
var opAgent = app.indexOf('opera'); 

	if (nsAgent!= -1) 
		{ // Mozilla Firefox Bookmark		
		window.sidebar.addPanel(title,url,"");	
		} 
	else if(ieAgent!= -1) 
		{ // IE Favorite		
		window.external.AddFavorite(url,title); 

		}	
	else if(opAgent!= -1)
			
			// Other methods of detecting Opera
			
			// window.opera && window.print 
			// opAgent!= -1
			// agt.substr(agt.indexOf('opera')+6,1) < 9
		{
				alert("You are using a browser that does not support adding Favorites by script, please add it manually");	
		}

}  
