// JavaScript Document
var message="The right click menu is not available at this time.";

///////////////////////////////////
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;
}
}
}

function checkclick(id)
{
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")
}


function disableCtrlKeyCombination(e)
{
        //list all CTRL + key combinations you want to disable
        var key;
        
        if(window.event)
        {
			key = window.event.keyCode;     //IE
			if(window.event.ctrlKey){
				switch(key){
					case 65: alert("The select all functionality is not available at this time."); break;
					case 67: alert("The copy functionality is not available at this time."); break;
					case 83: alert("The save functionality is not available at this time."); break;						
				}
			}  
			//alert(key);
				
        }
        else
        {
			key = e.which;     //firefox
			if(e.ctrlKey){				
				switch(key){					
					case 65: 
						alert("The select all functionality is not available at this time.");
						break;
					case 67: 
						alert("The copy functionality is not available at this time."); 
						break;
					case 83: 
						alert("The save functionality is not available at this time."); 
						break;		
				}
			}					
        }			
        
}
 /*document.onselectstart=function(){
	 alert('in')
	 return false;
	 }*/
	 
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function javaCheck(){

	if(navigator.javaEnabled()){
		setCookie('NC_JAVA','jenabled','1');
		return true;
	}
	else{
		setCookie('NC_JAVA','jdisabled','1');
		return false;
	}
}

function popUp(url){
	window.open(url,'','width=500,height=500,resizable=1,scrollbars=1');
}

function preview(frm,frmAction){
	document.getElementById(frm).target = "_blank";
	document.getElementById(frm).action = frmAction;
	document.getElementById(frm).submit();
}