function popup(URL,id,w,h) {
//var winpops=window.open(popurl,id,"width=600px,height=500px,left=212,top=84,status,scrollbars")
day = new Date();
//id = day.getTime();
//id="test";
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",top = 84');");
}

function popup_close()
{
	window.close();
}

function NavigationAlert()
{ objLinks = document.links;
  for(i=0;i<objLinks.length;i++)
  { objLinks[i].onclick =new Function("return onClickAlert();");}
}
function onClickAlert()
{return confirm("Are you sure? you want Navigate this page.");}
		
function marquee_action()
{
	var title_name;
	title_name=document.getElementById("action_img").title;
	if(title_name=="pause")
	{
		document.getElementById("marquee").stop();
		document.getElementById("action_img").title="play";
		document.getElementById("action_img").src="images/play_button.jpg"
	}
	else
	{
		document.getElementById("marquee").start();
		document.getElementById("action_img").title="pause";
		document.getElementById("action_img").src="images/pause_button.jpg"
	}
	
}
var r={'special':/[\W]/g}
//var r={'special':/(^-?\d\d*$)/}
var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|\<\><?\/\+\!\'\"\:\;]/;
var RateExp = /[.\\1\\2\\3\\4\\5\\6\\7\\8\\9\\0]/;
function SpecialCharValidation(Field,Check)
{
  //Field.value = Field.value.replace(r[Check],'');
var strPass = Field.value;
var strLength = strPass.length;
var lchar = Field.value.charAt((strLength) - 1);
if(lchar.search(mikExp) != -1) {
var tst = Field.value.substring(0, (strLength) - 1);
Field.value = tst;
   }
   
}


function SpecialCharValidationBlur(Field,Check) {
/*if(Field.value.length < 1) {
alert("Please enter something.");
return false;
}*/
if(Field.value.search(mikExp) == -1) {
//alert("Correct Input");
return false;
}
else {
alert("Special Charcters are not allowed...Check your Inputs!\n");
Field.select();
Field.focus();
return false;
}
}

function PriceValidation(Field,Check)
{

var strPass = Field.value;
var strLength = strPass.length;
var lchar = Field.value.charAt((strLength) - 1);
if(lchar.search(RateExp) ==-1) {
var tst = Field.value.substring(0, (strLength) - 1);
Field.value = tst;
   }
}

function PriceValidationBlur(Field,Check) {
/*if(Field.value.length < 1) {
alert("Please enter something.");
return false;
}*/
if(!isNaN(Field.value)) 
{
	return false;
}
else {
	if(Field.value.split(".").length-1 > 1)
	{
		alert("Currency Value Allowed Only one dot.!\n");
	}
	else
	{
		alert("Please Enter Valid Currency Value.!\n");
	}
	Field.select();
	Field.focus();
	return false;
}

}
function isInteger(digitField)
{

//var re5digit=/^\d{5}$/ //regular expression defining a 5 digit number
/*if (digitField.value.search(re5digit)==-1) //if match failed
alert("Please enter a valid 5 digit number inside form");
*/
var s=digitField.value;
     var i;
	s = s.toString();
      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
       if (isNaN(c)) 
	   {
		//alert("Given value is not a number");
		var strLength = s.length;
		var lchar = digitField.value.charAt((strLength) - 1);
		var tst = digitField.value.substring(0, (strLength) - 1);
		digitField.value = tst;
   	   }
      }
    }
function isIntegerBlur(digitField)
{
var s=digitField.value;
     var i;
	s = s.toString();
	if (isNaN(s)) 
	  {
		alert("Alphabets & Special Characters are Not Allowed...");
		digitField.select();
		digitField.focus();
		return false;
	  }
}
function checkKeyCode(evt)
{
//alert("HAI");
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
//alert(evt.keyCode);

if(event.keyCode==116)
{
evt.keyCode=0;
alert("Sorry! This key[F5] function Was Disabled!!");
return false
}
if(event.keyCode==122)
{
evt.keyCode=0;
alert("Sorry! This key[F11] function Was Disabled!!");
return false
}
if(event.keyCode==8)
{
evt.keyCode=0;
alert("Sorry! This key[back] function Was Disabled!!");
return false
}
if(event.keyCode==17)
{
evt.keyCode=0;
alert("Sorry! This key[ctrl] function Was Disabled!!");
return false
}
if(window.event.ctrlKey)
{
evt.keyCode=0;
alert("Sorry! This [ctrl+]key function are Disabled!!");
}


//if (event.ctrlKey &&(keyCode == 78 || keyCode == 82)) 
 //        {
                // When ctrl is pressed with R or N<br>
     //           evt.keyCode=0;
   //       }
	//alert(evt.keyCode);
	shortcut.remove("Ctrl+N");
	return false;

}
function rightclick()
{
alert("Sorry! Right Click Option Was Disabled!!");
return false;

}


function confirm_fun()
{
if(confirm('Are you sure? Once you confirm it, you cannot undo this action')==true)
{	return true;
}
else
{	return false;
}
}

