//Common for all digit validation
var digits = "0123456789";
//Variable Of Phone and Mobile No.
var phoneNumberDelimiters = "- +(), ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber =5;
var minDigitsInIMobileNumber =10;

//Variable of Height and Weight
var minDigitsInIHeightNumber =0;
var minDigitsInIWeightNumber =0;
var validWorldHeightChars ="."
var validWorldWeightChars =""
// Variable of Age And year
var validWorldChars='';
var minDigits=0;

//Country Validation:
function frmCountryValidation()
{ 
	if(!IsBlank(document.frmcountry.country,'Please Enter country name.'))
		return false;
}

//Country language Validation:
function frmCountrylnValidation()
{ 
	if(!IsBlank(document.frmcountryln.txttext,'Please Enter Display Text.'))
		return false;
}

// State Validation.
function frmStateValidator()
{
	if(!IsBlank(document.frmstate.txtstate,'Please Enter State.'))
		return false;
	if(!IsBlank(document.frmstate.country,'Please Select Country Name.'))
		return false;
	
}
/*
// Registration Form Validator
function frmRegistrationValidation()
{ 
	if(!IsBlank(document.frmregister.txtfirstname,'Please Enter First Name'))
		return false;
	if(!IsBlank(document.frmregister.txtlastname,'Please Enter Last Name'))
		return false;
	if(!IsBlank(document.frmregister.txtnikname,'Please Enter Nicname'))
		return false;	
	if(!IsEmail(document.frmregister.txtemail,'Please Enter Valid EmailID'))
		return false;
	if(!IsEmail(document.frmregister.txtconfirmemail,'Please Enter Valid EmailID'))
		return false;
	if(document.frmregister.txtemail.value != document.frmregister.txtconfirmemail.value)
	{
		alert('Email & Confirm Email Not Match');
		document.frmregister.txtconfirmemail.focus();
		return false;
	}
	if(!IsBlank(document.frmregister.txtpassword,'Please Enter Password'))
		return false;
	if(document.frmregister.txtpassword.value.length < 5)
	{
		alert('Password Must be Greater than or Equal to 5 Characters');
 		document.frmregister.txtpassword.focus();
		return false;
	}
	if(!IsBlank(document.frmregister.txtconfirmpassword,'Please Enter Confirm Password'))
		return false;
	if(document.frmregister.txtpassword.value != document.frmregister.txtconfirmpassword.value)
	{
		alert('Password & Confirm Password Not Match');
		document.frmregister.txtconfirmpassword.focus();
		return false;
	}
	if(!IsBlank(document.frmregister.bMonth,'Please Select Month of Birthdate'))
		return false;
	if(!IsBlank(document.frmregister.bDay,'Please Select Day of Birthdate'))
		return false;
	if(!IsBlank(document.frmregister.bYear,'Please Select Year of Birthdate'))
		return false;
		//dev by om
	if(Birthdate()==false)
	    {
		return false;
		}
	if(!age_limit("frmregister"))
	    return false;//dev end
	    
	 if(document.frmregister.chkConfirm.checked == false)
	 {	
	 	alert('Please Confirm Your Age');
		document.frmregister.chkConfirm.focus();	
		return false;
		}
		   
	if(!IsBlank(document.frmregister.country,'Please Select Country'))
		return false;

	if(document.frmregister.hdState.value == "")
		{
			if(!IsBlank(document.frmregister.txtState,'Please Enter OtherState'))
				return false;
		}
		else{
			if(document.frmregister.txtState.value !="") {		
					document.frmregister.txtState.value = "";}

		}

	if(!IsBlank(document.frmregister.txtcity,'Please Enter City'))
		return false;
	if(!IsBlank(document.frmregister.txtzipcode,'Please Enter Zipcode'))
		return false;
	if(document.frmregister.rbgender[0].checked == false && document.frmregister.rbgender[1].checked == false)
	{
		alert('Please Select Gender');
		return false;
	}	
	if(!IsBlank(document.frmregister.gd_string,'Please Enter Text'))
		return false;

	if(document.frmregister.chkagree.checked == false)
	{
		alert('Please Check Terms & Conditions of Wamba');
		return false;
	}
	return true;
}
*/

/*
// User Profile Validator
function  frmUserProfileValidation()
{
		if(!IsBlank(document.frmuserprofile.txtfirstname,'Please Enter First Name'))
			return false;

		if(!IsBlank(document.frmuserprofile.txtlastname,'Please Enter Last Name'))
			return false;
		
		if(!IsBlank(document.frmuserprofile.txtpassword,'Please Enter Password'))
			return false;
		if(document.frmuserprofile.txtpassword.value.length < 5)
		{
			alert('Password Must be Greater than or Equal to 5 Characters');
			document.frmuserprofile.txtpassword.focus();
			return false;
		}
		if(!IsBlank(document.frmuserprofile.txtconfirmpassword,'Please Enter Confirm Password'))
			return false;
		if(document.frmuserprofile.txtpassword.value != document.frmuserprofile.txtconfirmpassword.value)
		{
			alert('Password & Confirm Password Not Match');
			document.frmuserprofile.txtconfirmpassword.focus();
			return false;
		}
		if(!IsBlank(document.frmuserprofile.bMonth,'Please Select Month of Birthdate'))
		return false;
		if(!IsBlank(document.frmuserprofile.bDay,'Please Select Day of Birthdate'))
		return false;
		if(!IsBlank(document.frmuserprofile.bYear,'Please Select Year of Birthdate'))
		return false;
		if(Profile_Birthdate()==false)
		{
			return false;
		}
		if(!age_limit("frmuserprofile")) 
			return false;//dev end
			//if(!IsBlank(document.frmuserprofile.cmbState,'Please Select State'))
				//return false;
		 if(document.frmuserprofile.chkConfirm.checked == false)
		 {	
	 	alert('Please Confirm Your Age');
		document.frmuserprofile.chkConfirm.focus();	
		return false;
			}		
		if(!IsBlank(document.frmuserprofile.country,'Please Select Country'))
		{
			return false;
		}

		if(document.frmuserprofile.hdState.value == "")
		{
			if(!IsBlank(document.frmuserprofile.txtState,'Please Enter OtherState'))
				return false;
		}
		else
		{	//if(document.frmuserprofile.txtState.value!="") alert("you cannot enter other state");
			document.frmuserprofile.txtState.value = "";

		}
		if(!IsBlank(document.frmuserprofile.txtcity,'Please Enter City'))
			return false;

		if(!IsBlank(document.frmuserprofile.txtzipcode,'Please Enter Zipcode'))
			return false;

		if(document.frmuserprofile.rbgender[0].checked == false && document.frmuserprofile.rbgender[1].checked == false)
		{
			alert('Please Select Gender');
			return false;
		}	
	    if(!Validate_image()){ 
		alert("Invalid Files Format"); 
		return false;
		}
	    if(!Validate_audiofile()){ 
		alert("Invalid Files Format. Only Mp3 file is allow."); 
		return false;
		}

		
		return true;
}
*/
/*
function Validate_image()
    {
    var objUpload=eval("document.getElementById('flUpload')");
    var sUpload=objUpload.value;
	 if(sUpload=="")
	  return true;
//    if(sUpload!="")
   else
        {
        		var iExt=sUpload.indexOf("\\");
        		var iDot=sUpload.indexOf(".");
        if((iExt < 0 ) || (iDot < 0))
            {
           // alert("Invalid File Path for Upload!");
            objUpload.focus();
            //event.returnValue=false; 
            return false; 
       		 }
        if(iDot > 0)
           {
           var vv=sUpload.toLowerCase();
            var aUpload=vv.split(".");
            if(aUpload[aUpload.length-1]=="jpg" || aUpload[aUpload.length-1]=="gif" || aUpload[aUpload.length-1]=="bmp" || aUpload[aUpload.length-1]=="png"){
				
				//event.returnValue=true; 
                return true; 
			}else{
               // alert("Invalid Files Format");
                objUpload.focus();
                //event.returnValue=false; 
                return false; 
            }

        }
		
    }

}

function Validate_audiofile()
    {
    var objUpload=eval("document.getElementById('flUploadAudio')");
    var sUpload=objUpload.value;
	 if(sUpload=="")
	  return true;
//    if(sUpload!="")
   else
        {
        		var iExt=sUpload.indexOf("\\");
        		var iDot=sUpload.indexOf(".");
        if((iExt < 0 ) || (iDot < 0))
            {
           // alert("Invalid File Path for Upload!");
            objUpload.focus();
            //event.returnValue=false; 
            return false; 
       		 }
        if(iDot > 0)
           {
            var aUpload=sUpload.split(".");
            if(aUpload[aUpload.length-1]=="mp3"){
				
				//event.returnValue=true; 
                return true; 
			}else{
               // alert("Invalid Files Format");
                objUpload.focus();
                //event.returnValue=false; 
                return false; 
            }

        }
		
    }

}

*/
// Personality Validators
function frmPersonalityValidation()
{
	if(!IsBlank(document.frmpersonality.selEthnicity,'Please Select Ethnicity'))
		return false;	
	if(!IsBlank(document.frmpersonality.selBodytype,'Please Select Bodytype'))
		return false;
	if(!IsBlank(document.frmpersonality.selHaircolor,'Please Select Haircolor'))
		return false;
	if(!IsBlank(document.frmpersonality.txtHeight,'Please Enter Height'))
		return false;
    if(Height()==false)
	    return false;
	if(!IsBlank(document.frmpersonality.txtWeight,'Please Enter Weight'))
		return false;
	if(Weight()==false)
	    return false;
	return true;
}
function Height()
{
	var Height=document.frmpersonality.txtHeight;
	
	if ((Height.value==null)||(Height.value=="")){
		alert("Please Enter Height in Number");
		Height.focus();
		return false;
	}
   if (checkInternationalHeight(Height.value)==false){
		alert("Invalid Height ! Enter in Digit ");
		Height.focus();
		return false;
	}
	return true;
}
function Weight()
{
	var Weight=document.frmpersonality.txtWeight;
	if ((Weight.value==null)||(Weight.value=="")){
		alert("Please Enter Weight in Digit");
		Weight.focus();
		return false;
	}
   if (checkInternationalWeight(Weight.value)==false){
		alert("Invalid Weight ! Enter in Digit ");
		Weight.focus();
		return false;
	}
	return true;
}

// Company Validators
function frmCompanyValidation()
{
	if(!IsBlank(document.frmcompanies.txtcompanyname,'Please Enter Company Name'))
			return false;
	if(!IsBlank(document.frmcompanies.cmbCountry,'Please Select Country'))
		return false;
	if(!IsBlank(document.frmcompanies.cmbState,'Please Select State'))
		return false;
	if(!IsBlank(document.frmcompanies.txtcity,'Please Enter City'))
			return false;
	if(!IsBlank(document.frmcompanies.txtjobtitle,'Please Enter Job Title'))
			return false;
	if(!IsBlank(document.frmcompanies.cmbFromMonth,'Please Select From Month'))
			return false;
	if(!IsBlank(document.frmcompanies.cmbFromYear,'Please Select From Year'))
			return false;
	if(!IsBlank(document.frmcompanies.cmbToMonth,'Please Select To Month'))
			return false;
	if(!IsBlank(document.frmcompanies.cmbToYear,'Please Select To Year'))
			return false;
	if(document.frmcompanies.cmbFromYear > document.frmcompanies.cmbToYear)
	{
			alert("From Date must be Less than to To Date");
			return false;
	}
	else
	{
		if(document.frmcompanies.cmbFromYear == document.frmcompanies.cmbToYear)
		{
			if(document.frmcompanies.cmbFromMonth.value >= document.frmcompanies.cmbToMonth.value )
			{
				alert("From Date must be Less than to To Date");
				return false;
			}
		}
	}					
	return true;
}

//Edit Company
function companiesAction(companyId,companyMstId,action)
{
	if(action == 'Delete')	{
		if(confirm('Are you sure you want to delete this record'))
		{
			document.frmcompanies.hidId.value = companyId;
			document.frmcompanies.hidAction.value = action;
			document.frmcompanies.hidCompanyMasterId.value = companyMstId;
			document.frmcompanies.submit();
			return true;
		}
	} else {
	document.frmcompanies.hidId.value = companyId;
	document.frmcompanies.hidAction.value = action;
	document.frmcompanies.hidCompanyMasterId.value = companyMstId;
	document.frmcompanies.submit();
	return true;
	}
}
/*
//School Validators
function frmSchoolsValidation()
{
	if(!IsBlank(document.frmschools.cmbCountry,'Please Select Contry'))
		return false;
	if(!IsBlank(document.frmschools.cmbState,'Please Select State'))
		return false;
	if(!IsBlank(document.frmschools.cmbSchool,'Please Select School'))
		return false;
	
	if(document.frmschools.cmbFrom.value > document.frmschools.cmbTo.value)
	{
		alert("From must Less than or Equal to To");
		document.frmschools.cmbFrom.focus();
		return false;
	}
	document.frmschools.hidSchool.value = document.frmschools.cmbSchool.value;
	return true;
}
*/
//Edit Schools
/*
function schoolsAction(schoolId,schoolMstId,action,country,state)
{
	if(action == 'Delete')	{
		if(confirm('Are you sure you want to delete this record','Yes','No'))
		{
			document.frmschools.hidId.value = schoolId;
			document.frmschools.hidSchoolMasterId.value = schoolMstId;
			document.frmschools.hidAction.value = action;
			document.frmschools.submit();
			return true;
		}
	} else {
		document.frmschools.hidId.value = schoolId;
		document.frmschools.hidSchoolMasterId.value = schoolMstId;
		document.frmschools.hidCountry.value = country;
		document.frmschools.hidState.value = state;
		document.frmschools.hidSchool.value = schoolMstId;
		document.frmschools.hidAction.value = action;
		document.frmschools.submit();
		return true;		
	}
}
*/
//Life Style Validators
function frmLifeStyleValidation()
{
	if(!IsBlank(document.frmlifestyle.txttitle,'Please Enter Title'))
			return false;
	if(document.frmlifestyle.rbsmoker[0].checked == false && document.frmlifestyle.rbsmoker[1].checked == false)
	{
		alert('Please Select Smoker');
		return false;
	}		
	if(document.frmlifestyle.rbdrinker[0].checked == false && document.frmlifestyle.rbdrinker[1].checked == false)
	{
		alert('Please Select Drinker');
		return false;
	}		
	return true;
}

//Login form Validation
function frmLoginValidation()
{
		if(!IsBlank(document.frmlogin.txtusername,'Please Enter User Name'))
			return false;
		if(!IsBlank(document.frmlogin.txtpassword,'Please Enter Password'))
			return false;
		return true;
				
}
/*
//	My Addressbook Validation
function frmAddressbookValidation()
{
	if(!IsBlank(document.frmaddressbook.txtname,'Please Enter Name'))
		return false;		
	if(!IsEmail(document.frmaddressbook.txtemail,'Please Enter Valid E-mail Id'))
		return false;
	if(!IsBlank(document.frmaddressbook.txtusername,'Please Enter Username'))
		return false;
	if(document.frmaddressbook.txtphone.value.length < 1)
	{
		alert("Please Enter Phone Number");
		document.frmaddressbook.txtphone.focus();
		return false;
	}
	if(Phone()==false)
	{
	    return false;
	}
	/*
		if(document.frmaddressbook.txtmobile.value.length < 1)
		{
			alert("Please Enter Mobile Number");
			document.frmaddressbook.txtmobile.focus();
			return false;
		}
		if(Mobile()==false)
		{
			return false;
		}
	*/
	/*return true;
}	

function Phone()
{
	var Phone=document.frmaddressbook.txtphone;
	
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter Phone Number");
		Phone.focus();
		return false;
	}
   if (checkInternationalPhone(Phone.value)==false){
		alert("Invalid Phone No.! Enter 5 Digit No");
		Phone.focus();
		return false;
	}
	return true;
}
*/
function Mobile()
{
	var mobile=document.frmaddressbook.txtmobile;
	
	if ((mobile.value==null)||(mobile.value=="")){
		alert("Please Enter Mobile Number");
		mobile.focus();
		return false;
	  }
	  if (checkInternationalMobile(mobile.value)==false){
		alert("Invalid Mobile No.! Enter 10 Digit No");
		mobile.focus();
		return false;
	}
	return true;
}
//Mail Address
/*function  frmForgotPasswordValidation()
{
	if(!IsEmail(document.frmForgotPassword.txtemailid,'Please Enter Valid E-mail Id'))
		return false;
	return true;
}
*/
//Commonfile Validator Blank
function frmBlankFielValidator(obj,msg)
{
	if(!IsBlank(obj,msg))
		return false;
	return true;
}
/*
//SearchByKeyword Validation
function frmSearchByKeywordValidation()
{
	
	if(document.frmSearchByKeyword.cmbSearchType != null) {
		if(!IsBlank(document.frmSearchByKeyword.cmbSearchType,'Please Select Search In'))
			return false;	
	}
	if(!IsBlank(document.frmSearchByKeyword.txtKeyword,'Please Enter Search Keyword'))
		return false;
	if(!CharLimit(document.frmSearchByKeyword.txtKeyword,'This Search term is too Short.')){
		document.frmSearchByKeyword.txtKeyword.focus();
		return false;
	}
	return true;
}

function CharLimit(obj,msg)
{
	if(obj.value.length < 4){
		alert(msg);
		
		return false;
	}
	return true;
}
function frmFindSomeoneValidation()
{
	if(!document.frmFindSomeone.rbSomeone[0].checked && !document.frmFindSomeone.rbSomeone[1].checked)
	{
		alert('Please Select Search In');
		document.frmFindSomeone.rbSomeone[0].focus();
		return false;
	}
	if(!IsBlank(document.frmFindSomeone.txtSomeone,'Please Enter Someone Whom You Know'))
	{
		return false;
	}
	if(document.frmFindSomeone.rbSomeone[1].checked)
	{
		if(!IsEmail(document.frmFindSomeone.txtSomeone,'Please Enter Valid Email Id'))
		{
			return false;
		}		
	}
	if(!CharLimit(document.frmFindSomeone.txtSomeone,'This Search term is too Short.')){
		document.frmFindSomeone.txtSomeone.focus();
		return false;
	}
	
	return true;
}*/
function validateCheckbox(what)		// if checkboxes are checked or not,for many checkboxes 
{
    var valid = true;
        val=" ";
    var checkBoxes = false;
    var checkboxChecked = false;
       
    for (var i=0, j=what.elements.length; i<j; i++) {
        myType = what.elements[i].type;
       // mn=what.elements[i].name;
		if (myType == 'checkbox') {
            checkBoxes = true;
            if (what.elements[i].checked && what.elements[i].id!="y"){ checkboxChecked = true;
					val+=what.elements[i].id+" ";
					//cid=val.split(" ");
					}
				       }
			
    		}
	cid=val;
	if ((checkBoxes && !checkboxChecked) ) valid = false;
    //if (!valid)
      //  alert("please check the box");
    return valid;
}
/*
function searchDetails_validate()
{ 
var d=document.frmSearchDetail;
		if(d.rbGender[0].checked == false && d.rbGender[1].checked == false && d.rbGender[2].checked == false && d.txtStartAge.value == "" &&  d.txtEndAge.value == ""  && d.selCountry.value == "" && d.selState.value == "" && d.chkPhoto.checked == false)
		{
			if(!validateCheckbox(d)) 
			{
					alert("Please Select atleast one search criteria ");
					return false;
			}
		}
		if(!Age(d.txtStartAge)) return false;
		if(!Age(d.txtEndAge)) return false;
		if(parseInt(d.txtStartAge.value) > parseInt(d.txtEndAge.value))
		{
			alert ("Start age must be less than end age");
			return false;
		}
return true;
}
function Age(age)
{
	   if (checkInternational(age.value)==false){
		alert("Invalid Age ! Enter in Digit ");
		age.focus();
		return false;
	}
	return true;
}
function checkInternational(strAge)
{
	s=stripCharsInBag(strAge,validWorldChars);
	return (isInteger(s) && s.length >= minDigits);
}
*/
/*
// my_friendrequest
function declaine_request(id)
{
if (confirm("Are you sure you want to declained this request"))
	{
	document.frm_friend.declaine_id.value = id;
	document.frm_friend.action = "my_friendrequest.php";
	document.frm_friend.submit();
	}
}
function accept_request(id)
{
document.frm_friend.accept_id.value = id;
document.frm_friend.action = "friend_request_approve.php";
document.frm_friend.submit();
}*/
//my_pendingrequest
function cancleRequest(id)
{
document.frm_pending.cancle_id.value = id;
document.frm_pending.submit();
}
/*
function searchClassmate_validate()
{
	var d = document.frmSearchClassmate;
	if(d.txtSchool.value == "") {
		alert("Please Enter School Name");
		d.txtSchool.focus();
		return false;
	}

	if(d.txtSchool.value == "" && d.txtStartYear.value == "" &&  d.txtEndYear.value == "" && d.selCountrySchool.value == "" && d.selStateSchool.value == "")
	{
		alert("Please Select atleast one item ");
		return false;
	}
	if(!Year(d.txtStartYear)) 
	   return false;
	if(!Year(d.txtEndYear))
	   return false;
	if(d.txtStartYear.value > d.txtEndYear.value)
	{
		alert ("Start Year must be less than end Year");
		return false;
	}
	
	if(!CharLimit(document.frmSearchClassmate.txtSchool,'This Search term is too Short.')){
		document.frmSearchClassmate.txtSchool.focus();
		return false;
	}

return true;
}
function Year(year)
{
   if (!checkInternational(year.value)){
        alert("Invalid Year ! Enter in Digit ");
		year.focus();
		return false;
    }
	return true;
}
function checkInternational(strYear)
{
	s=stripCharsInBag(strYear,validWorldChars);
	return (isInteger(s) && s.length >= minDigits);
}
*/
function searchCollegues_validate()
{
	var d = document.frmSearchCollegues;

	if(d.txtCompany.value == "" && d.txtStartYearCol.value == "" &&  d.txtEndYearCol.value == "" && d.selCountryCollegues.value == "" && d.selStateCollegues.value == "")
	{
		alert("Please Select atleast one item ");
		return false;
	}
	if(d.txtStartYearCol.value > d.txtEndYearCol.value)
	{
		alert ("Start Year must be less than end Year");
		return false;
	}
	return true;
}



//For Phone Validation
function checkInternationalPhone(strPhone)
{
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

//For Mobile Validation
function checkInternationalMobile(strPhone)
{
	
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIMobileNumber);
}
/*
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    
	for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}*/
// End of Phone Validation: 

/*
//Skin Form Validation Start
function SkinValidation()
{
	if(!IsBlank(document.frmSkin.txtName,'Please Enter Skin Name'))
		return false;
		
	if(!IsBlank(document.frmSkin.txtPltc,'Please Select Text Color'))
		return false;
	if(!IsBlank(document.frmSkin.txtHsbg,'Please Select Header Color'))
		return false;
	if(!IsBlank(document.frmSkin.txtPllc,'Please Select Label Color'))
		return false;
	if(!IsBlank(document.frmSkin.txtPllinkc,'Please Select Link Color'))
		return false;


	//Skin Image
	if(document.frmSkin.HidFile.value == "") {
		document.frmSkin.HidFile.value = document.frmSkin.fileSkinImage.value;
	} else {
		if(document.frmSkin.fileSkinImage.value != "") {
			document.frmSkin.HidFile.value = document.frmSkin.fileSkinImage.value;
		} else {
			document.frmSkin.HidFile.value = document.frmSkin.HidFile.value;
		}
	}
	if(document.frmSkin.HidFile.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFile.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.fileSkinImage.focus();
			return false;
		}
	}
	
	//Skin Large Header Image
	if(document.frmSkin.HidFileLH.value == "") {
		document.frmSkin.HidFileLH.value = document.frmSkin.fileLH.value;
	} else {
		if(document.frmSkin.fileLH.value != "") {
			document.frmSkin.HidFileLH.value = document.frmSkin.fileLH.value;
		} else {
			document.frmSkin.HidFileLH.value = document.frmSkin.HidFileLH.value;
		}
	}
	if(document.frmSkin.HidFileLH.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFileLH.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.fileLH.focus();
			return false;
		}
	}

	//Skin Small Header Image
	if(document.frmSkin.HidFileHsbgurl.value == "") {
		document.frmSkin.HidFileHsbgurl.value = document.frmSkin.fileHsbgurl.value;
	} else {
		if(document.frmSkin.fileHsbgurl.value != "") {
			document.frmSkin.HidFileHsbgurl.value = document.frmSkin.fileHsbgurl.value;
		} else {
			document.frmSkin.HidFileHsbgurl.value = document.frmSkin.HidFileHsbgurl.value;
		}
	}
	if(document.frmSkin.HidFileHsbgurl.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFileHsbgurl.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.fileHsbgurl.focus();
			return false;
		}
	}
	
	//Skin Large Footer Image
	if(document.frmSkin.HidFileLF.value == "") {
		document.frmSkin.HidFileLF.value = document.frmSkin.fileLF.value;
	} else {
		if(document.frmSkin.fileLF.value != "") {
			document.frmSkin.HidFileLF.value = document.frmSkin.fileLF.value;
		} else {
			document.frmSkin.HidFileLF.value = document.frmSkin.HidFileLF.value;
		}
	}
	if(document.frmSkin.HidFileLF.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFileLF.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.fileLF.focus();
			return false;
		}
	}
	
	//Skin Small Footer Image
	if(document.frmSkin.HidFileSF.value == "") {
		document.frmSkin.HidFileSF.value = document.frmSkin.fileSF.value;
	} else {
		if(document.frmSkin.fileSF.value != "") {
			document.frmSkin.HidFileSF.value = document.frmSkin.fileSF.value;
		} else {
			document.frmSkin.HidFileSF.value = document.frmSkin.HidFileSF.value;
		}
	}
	if(document.frmSkin.HidFileSF.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFileSF.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.fileSF.focus();
			return false;
		}
	}
	
	//Skin Bullet Image
	if(document.frmSkin.HidFileBullet.value == "") {
		document.frmSkin.HidFileBullet.value = document.frmSkin.fileBullet.value;
	} else {
		if(document.frmSkin.fileBullet.value != "") {
			document.frmSkin.HidFileBullet.value = document.frmSkin.fileBullet.value;
		} else {
			document.frmSkin.HidFileBullet.value = document.frmSkin.HidFileBullet.value;
		}
	}
	if(document.frmSkin.HidFileBullet.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFileBullet.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.fileBullet.focus();
			return false;
		}
	}
	
	//Skin Bullet Image
	if(document.frmSkin.HidFilePlbgurl.value == "") {
		document.frmSkin.HidFilePlbgurl.value = document.frmSkin.filePlbgurl.value;
	} else {
		if(document.frmSkin.filePlbgurl.value != "") {
			document.frmSkin.HidFilePlbgurl.value = document.frmSkin.filePlbgurl.value;
		} else {
			document.frmSkin.HidFilePlbgurl.value = document.frmSkin.HidFilePlbgurl.value;
		}
	}
	if(document.frmSkin.HidFilePlbgurl.value != '') {
		var ExtArray = Array();
		ExtArray = document.frmSkin.HidFilePlbgurl.value.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'swf' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			document.frmSkin.filePlbgurl.focus();
			return false;
		}
	}
	
	return true;
}*/
//Skin Form Validation End
//Photo upload form validation
/*
function photo_validation()
	{
	var d=document.frm_photo_upload;
	if(!IsBlank(d.txttitle,"Title cannot be left blank")) 
		return false;
		if(!validateCheckbox(d)) 
			{
					alert("Please Select atleast one Category ");
					return false;
			}
	 if(total_checkbox(d)>3){ alert("Please select maximum three Category");return false;};
	 
	if(!IsBlank(d.cmbPhotoAlbum, "Please Select Album Category"))
		return false;
		
	 if(!IsBlank(d.sel_photo,"Please Upload Photo")) 
		return false;
	 if(d.sel_photo.value != '')
	  {
		var ExtArray = Array();
		var vv=d.sel_photo.value.toLowerCase();
		ExtArray = vv.split('.');
		if(ExtArray[ExtArray.length-1] != 'jpg' && ExtArray[ExtArray.length-1] != 'gif' && ExtArray[ExtArray.length-1] != 'jpeg' && ExtArray[ExtArray.length-1] != 'pcx' && ExtArray[ExtArray.length-1] != 'png' && ExtArray[ExtArray.length-1] != 'bmp') {
			alert('Please Upload Only Image File');
			d.sel_photo.focus();
			return false;
		}
	}	
	//return true;
	}
*/
/*
	//for photo edit
	function photo_edit_validation()
	{
	var d=document.frm_photo_edit;
	if(!IsBlank(d.txttitle,"Title cannot be left blank")) 
		return false;
	if(!validateCheckbox(d)) 
			{
					alert("Please Select atleast one Category ");
					return false;
			}
	 if(total_checkbox(d)>3){ alert("Please select maximum three Category");return false;};
	 
	if(!IsBlank(d.cmbPhotoAlbum, "Please Select Album Category"))
		return false;
	return true;
	}
*/
function total_checkbox(what)		
{
    var tot="0";
    for (var i=0, j=what.elements.length; i<j; i++)
     {
        myType = what.elements[i].type;
    	if (myType == 'checkbox')
    	 {
            if (what.elements[i].checked)
            	{ 	tot++; 		
        		}
		  }
	}
	return tot;
}
/*
// create group validation
function gr_create_validation()
{
		var d=document.frm_grcreate;
		
		if (!IsBlank(d.txt_grurl,"Group URL cannot be left blank")) return false;
		if (!IsBlank(d.txt_grname,"Group Name cannot be left blank")) return false;
		if (!IsBlank(d.sel_grcategory,"Please select Category")) return false;
		
		if (!IsBlank(d.sel_grcountry,"Please select Country")) return false;
		if (!IsBlank(d.sel_grstate,"Please select State ")) return false;
		if (!IsBlank(d.txt_grcity,"City cannot be left blank")) return false;
		if (!IsBlank(d.txt_grzipcode,"Zipcode cannot be left blank")) return false;
		if (!IsBlank(d.txt_grshortdesc,"Short Description cannot be left blank")) return false;
		if (!IsBlank(d.txt_grlongdesc,"Long Description cannot be left blank")) return false;
		if(d.txt_image.value !="")
		{
			var ExtArray = Array();
			ExtArray = d.txt_image.value.split('.');
			if(ExtArray[ExtArray.length-1] != 'jpg' ) 
			{
				alert('Please Upload Only JPG File');
				d.txt_image.focus();
				return false;
			}
		}
	return true;
}*/
/*
//search validation
function gr_search_validation()
{
	var d=document.frm_search;
	if(d.sel_grcountry.value== "" || d.sel_grcountry.value =="") 
		{if (!IsBlank(d.txt_keyword1,"Keyword cannot be left blank")) return false;}
return true;
}
*/
function frmsearchblog()
{
	if(!IsBlank(document.frmsearch.txtkeyword,'Please Enter Search Keyword'))
		return false;
	return true;
}

function frmsearcharticle()
{
	if(!IsBlank(document.frmsearch.txtkeyword,'Please Enter Search Keyword'))
		return false;
	return true;
}


function frmsearchgroup()
{
	if(!IsBlank(document.frmsearch.txtkeyword,'Please Enter Search Keyword'))
		return false;
	return true;
}
/*
function frmAbuseValidation()
{
	if(!IsBlank(document.frmAbuse.txtReport,'Please Enter Report'))
		return false;
	return true;
}*/
/*
//for reply_mail page
function validate_reply_mail()
{
d=document.frm_reply;
if(!IsBlank(d.subject,"Subject Cannot be Left Blank"))
	return false;
return true;	
}

//for froward_mail page
function validate_forward_mail()
{
d=document.frm_forward;
if(!IsBlank(d.subject,"Subject Cannot be Left Blank"))
	return false;
return true;	
}
*/

//for admin blacklist
function frmBlackListValidation()
{

	if(!IsEmail(document.frmblacklist.txtemail,"Please Enter Valid EmailID"))
		return false;
	if(!IsBlank(document.frmblacklist.txtip,"Please Enter IP Address"))
		return false;

	return true;	
	
}

function frmWarmsValidation()
{
	if(!IsBlank(document.frmWarms.txtAction,"Please Enter Action"))
		return false;
	if(!IsBlank(document.frmWarms.txtEvent,"Please Enter Event"))
		return false;
	if(!IsBlank(document.frmWarms.txtStartRange,"Please Enter StartRange"))
		return false;
	if(!IsBlank(document.frmWarms.txtEndRange,"Please Enter EndRange"))
		return false;
	if(!IsBlank(document.frmWarms.txtPoints,"Please Enter Points"))
		return false;
	if(!IsBlank(document.frmWarms.txtPointsPerDay,"Please Enter PointsPerDay"))
		return false;

	return true;	
	
}