
function checkAll(){					// Function for AllChecked....

 for(i=0;i<document.form1.elements.length;i++)
 {
  if(document.form1.elements[i].type=="checkbox")
  { document.form1.elements[i].checked=true;}
 }
}

function uncheck()	{					// Function for UnChecked....

 for(i=0;i<document.form1.elements.length;i++)
 {
  if(document.form1.elements[i].type=="checkbox")
  { document.form1.elements[i].checked=false;}
 }
}


function chk(st,pageurl){				// is for getting Active and In-Active records.....(onChange)
window.location.href=pageurl+'?st='+st;	}

function country_chg(cont,pageurl){				// is for getting Countries....(onChange)
window.location.href=pageurl+'&cont='+cont;	}


function createrby(by,pageurl){				// is for getting Active and In-Active records.....(onChange)
window.location.href=pageurl+'&by='+by;	}

function disp(disp,pageurl){				// is for displaying no of records per page......(onChange)
window.location.href=pageurl+'?disp='+disp;	}

//function focuscalling(){
//	var h=document.head_searchbox;
//	var l=document.head_login;
//	if(h.search_box.value == "Enter keyword to search"){	h.search_box.value="";	}
//	if(l.head_uname.value == "Enter User ID"){	l.head_uname.value="";	}
//	if(l.head_pswd.value == "Enter Password"){	l.head_pswd.value="";	}
//}
//function blurcalling(){
//	var h=document.head_searchbox;
//	var l=document.head_login;
//	if(h.search_box.value == ""){	h.search_box.value="Enter keyword to search";	}
//	if(l.head_uname.value == ""){	l.head_uname.value="Enter User ID";	}
//	if(l.head_pswd.value == ""){	l.head_pswd.value="Enter Password";	}
//}




//---------------------------------------------------------------------------------

// Satee.....


function isAlphabet(elem, helperMsg){
//var x=isAlphabet(document.getElementById('blogurl'), 'Special characters are not allowed');
	var alphaExp = /^[a-zA-Z0-9_]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
function isAlphabet(elem, helperMsg){
//var x=isAlphabet(document.getElementById('blogurl'), 'Special characters are not allowed');
	var alphaExp = /^[0-9_]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isstr(str) {
	str= this != window? this : str;
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function isEmail( string ) {		
	if(string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;	else		return false;	}

function del_rec(id,pageurl){
	if(confirm("You want to delete this record..?")) {
		if(id>0){
			document.location.href=pageurl+'&delid='+id;}
	} 
}
function done_rec(id,pageurl){
	if(confirm("You want to Move this record..?")) {
		if(id>0){
			document.location.href=pageurl+'&doneid='+id;}
	} 
}

function execute_rec(id,pageurl){
	if(confirm("Is it Completed the Execution..?")) {
		if(id>0){
			document.location.href=pageurl+'&exeid='+id;}
	} 
}
function app_exe(id,pageurl){
	if(confirm("Is it Completed the Execution..?")) {
		if(id>0){
			document.location.href=pageurl+'&exeapp='+id;}
	} 
}
function call_exe(id,pageurl){
	if(confirm("Is it Completed the Execution..?")) {
		if(id>0){
			document.location.href=pageurl+'&execall='+id;}
	} 
}
function note_exe(id,pageurl){
	if(confirm("Is it Completed the Execution..?")) {
		if(id>0){
			document.location.href=pageurl+'&exenote='+id;}
	} 
}


function trimstr(str) {
str= this != window? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function contact_valid(){
d=document.contact_form;
if(d.comp_name.value==""){	alert ("Please Enter Company Name ");	d.comp_name.focus();	return false; }
if(d.con_person.value==""){	alert ("Please Enter Contact Person ");	d.con_person.focus();	return false; }
if(d.con_phone.value==""){	alert ("Please Enter Contact Pnone No ");	d.con_phone.focus();	return false; }
if(isEmail(d.comp_email.value)==false){alert ("Please Enter a Valid E-Mail ID");	d.comp_email.focus();	return false; }
if(d.website.value==""){	alert ("Please Enter the Website Url ");	d.website.focus();	return false; }
}

function isDigrns(e) { if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which;  if (code == 8 || code == 9 || code == 13) return true; var character = String.fromCharCode (code); return '0' <= character && character <= '9'; }


