
document.onkeydown=key;

function key(evt)
{
	ie4 = (window.navigator.userAgent.indexOf("MSIE")>=1) ? true : false;
	var kc;
	var currentUrl = this.location.href;
   if(ie4)
   {
		kc=event.keyCode;
	  if((event.altKey) && (kc==192))
	  {

		if(currentUrl.indexOf('Default.aspx')==-1)
		{	
			document.location.href=currentUrl+'Default.aspx?ctl=Login'; 
		}else{
			
			//to check is any parameters in url
			if(location.search.toString()!='')
			{
				document.location.href=currentUrl+'&ctl=Login'; 
			}else{
				document.location.href=currentUrl+'?ctl=Login'; 
			}
		}
	  }
	  if((event.altKey) && (kc==81))
	  {
			document.location.href='Admin/Security/Logoff.aspx';
			//parent.close();		
	  }
	}else{
		kc=evt.which;
	  if((evt.altKey) && (kc==192))
	  {
			
		if(currentUrl.indexOf('Default.aspx')==-1)
		{	
			document.location.href=currentUrl+'Default.aspx?ctl=Login'; 
		}else{

			//to check is any parameters in url
			if(location.search.toString()!='')
			{
				document.location.href=currentUrl+'&ctl=Login'; 
			}else{
				document.location.href=currentUrl+'?ctl=Login'; 
			}
		}
	 }
	 if((evt.altKey) && (kc==81))
	 {
		document.location.href='Admin/Security/Logoff.aspx';
		//parent.close();
	 }
   }
	  
}
