
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 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 profilecheck()
{
 var d=document.form1;
 if(trimstr(d.subject.value)==""){alert("plz Enter subject");d.subject.focus();return false;}
 if (d.gender.selectedIndex == 0)
	{
		alert("Please Select gender");
		d.gender.focus();
		return false;
		}
		if(trimstr(d.dop2.value)==""){alert("plz Enter date");d.dop2.focus();return false;}
		if (d.marital.selectedIndex == 0)
	{
		alert("Please Select maritalstatus");
		d.marital.focus();
		return false;
		}
		if (d.drink.selectedIndex == 0)
	{
		alert("Please Select drinking");
		d.drink.focus();
		return false;
		}
		if (d.smoke.selectedIndex == 0)
	{
		alert("Please Select smoking");
		d.smoke.focus();
		return false;
		}
		
		 if(trimstr(d.ginfo.value)==""){alert("plz Enter general information");d.ginfo.focus();return false;}
		  if(trimstr(d.lookingfor.value)==""){alert("plz Enter lookingfor information");d.lookingfor.focus();return false;}
		
		if (d.diet.selectedIndex == 0)
	{
		alert("Please Select diet");
		d.diet.focus();
		return false;
		}
		 if(trimstr(d.lang.value)==""){alert("plz Enter general language");d.lang.focus();return false;}
		
		if (d.education.selectedIndex == 0)
	{
		alert("Please Select education");
		d.education.focus();
		return false;
		}
		if (d.eyecolour.selectedIndex == 0)
	{
		alert("Please Select eyecolour");
		d.eyecolour.focus();
		return false;
		}
		if (d.haircolour.selectedIndex == 0)
	{
		alert("Please Select haircolour");
		d.haircolour.focus();
		return false;
		}
		if (d.btype.selectedIndex == 0)
	{
		alert("Please Select bodytype");
		d.btype.focus();
		return false;
		}
		if (d.height.selectedIndex == 0)
	{
		alert("Please Select height");
		d.height.focus();
		return false;
		}
		if(trimstr(d.hobbies.value)==""){alert("plz Enter hobbies");d.hobbies.focus();return false;}
		
		 }
		 function trimstr(str) {
	str= this != window? this : str;
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

