// JavaScript Document
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function exp_in(a)
{
	   //var a=confirm("Are you sure you want to Express")	
		//location.href="express.php?path="+a;
		window.open("xyz.php?path="+a,'rr','width=600,height=380,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no');
}
////////// Forward option window //////////
function for_ward(a)
{
	   //var a=confirm("Are you sure you want to Express")	
		//location.href="express.php?path="+a;
		window.open("forward.php?path="+a,'rt','width=350,height=200,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no');
}
/////////////////////////////////

function del_img(aa)
{
   var a=confirm("Are you sure you want to delete this Image")
   if (a)
   {
     location.href="delimage.php?path="+aa
   }
}



function del_exp(aa)
{
	
	   var a=confirm("Are you sure you want to Express?")

	if(a)
	{
		//document.write(aa);
		location.href="passsss.php?path="+aa
	}
	
}


function del_message(ss){
   var s=confirm("Are you sure you want to delete this Image")
   
   if (s){
     location.href="delmsg.php?path="+ss
   }
}
function update_img(aa)
{
	var a=confirm("Do you want to upload New Image")
	if(a){
		location.href="updateimage.php?path="+aa,'hsh','height=400,width=200';
	}
}


 var lookups = new Array();
 lookups[lookups.length] = new Lookup(106, 1, "ANDHRA PRADESH");
 lookups[lookups.length] = new Lookup(106, 2, "ARUNACHAL PRADESH");
 lookups[lookups.length] = new Lookup(106, 3, "ASSAM");
 lookups[lookups.length] = new Lookup(106, 4, "BIHAR");
 lookups[lookups.length] = new Lookup(106, 5, "CHHATTISGARH");
 lookups[lookups.length] = new Lookup(106, 6, "DELHI");
 lookups[lookups.length] = new Lookup(106, 7, "GOA");
 lookups[lookups.length] = new Lookup(106, 8, "GUJARAT");
 lookups[lookups.length] = new Lookup(106, 9, "HARYANA");
 lookups[lookups.length] = new Lookup(106, 10, "HIMACHAL PRADESH");
 lookups[lookups.length] = new Lookup(106, 11, "JAMMU & KASHMIR");
 lookups[lookups.length] = new Lookup(106, 12, "JHARKHAND");
 lookups[lookups.length] = new Lookup(106, 13, "KARNATAKA");
lookups[lookups.length] = new Lookup(106, 14, "KERALA");
lookups[lookups.length] = new Lookup(106, 15, "MADHYA PRADESH");
lookups[lookups.length] = new Lookup(106, 16, "MAHARASHTRA");
lookups[lookups.length] = new Lookup(106, 17, "MANIPUR");
lookups[lookups.length] = new Lookup(106, 18, "MEGHALAYA");
lookups[lookups.length] = new Lookup(106, 19, "MIZORAM");
lookups[lookups.length] = new Lookup(106, 20, "NAGALAND");
lookups[lookups.length] = new Lookup(106, 21, "ORISSA");
lookups[lookups.length] = new Lookup(106, 22, "PUNJAB");
lookups[lookups.length] = new Lookup(106, 23, "RAJASTHAN");
lookups[lookups.length] = new Lookup(106, 24, "SIKKIM");
lookups[lookups.length] = new Lookup(106, 25, "TAMIL NADU");
lookups[lookups.length] = new Lookup(106, 26, "TRIPURA");
lookups[lookups.length] = new Lookup(106, 27, "UTTARANCHAL");
lookups[lookups.length] = new Lookup(106, 28, "UTTAR PRADESH");
lookups[lookups.length] = new Lookup(106, 29, "WEST BENGAL");

function Lookup(parentId, value, name)
	{
		this.parentId = parentId;
		this.value = value;
		this.name = name;
	}
	
function changed(sel)
	{
		var state = document.forms[0].elements["state"];
		if (!state)
		{
			return; //error
			}
    var selectedValue = sel.options[sel.selectedIndex].value;
  state.options.length = 0;
  for (var i = 0; i < lookups.length; ++i){
   var lookup = lookups[i];
       if (lookup.parentId == selectedValue){
    var option = document.createElement('OPTION');
    option.value = lookup.value;
          option.innerHTML = lookup.name;
          state.appendChild(option);
   			}
			
  }
 }
 function checkform()
 {
 if(document.frm.name.value =="")
 {
 alert("Please Enter Your Name");
document.frm.name.select();
return false;
 }
 //////////////////////////////////////////////////////////////////////////dfd
var str=document.frm.email.value
//alert(str);


	
		if (document.frm.email.value.indexOf("@",1) == -1)
		{
			alert("Invalid E-Mail address");
			document.frm.email.focus();
			document.frm.email.select();
			return(false);
		}
		if (document.frm.email.value.indexOf("@") == 0)
		{
			alert("Invalid E-Mail address");
			document.frm.email.focus();
			document.frm.email.select();
			return(false);
		}
		if (document.frm.email.value.indexOf(".",5) == -1)
		{
			alert("Invalid E-Mail address");
			document.frm.email.focus();
			document.frm.email.select();
			return(false);
		}
		if (document.frm.email.value.indexOf(".") == 0)
		{
			alert("Invalid E-Mail address");
			document.frm.email.focus();
			document.frm.email.select();
			return(false);
		}
		
		if ((document.frm.email.value.lastIndexOf(".")) -(document.frm.email.value.indexOf("@"))<4 )
		{
		
			alert("Invalid E-Mail address");
			document.frm.email.focus();
			document.frm.email.select();
			return(false);
		}
		
		if ((document.frm.email.value.length)-(document.frm.email.value.indexOf("."))<2)
		{
			alert("Invalid E-Mail address");
			document.frm.email.focus();
			myform.frm.select();
			return(false);
		}

var posat=str.indexOf("@");
var posdot=str.indexOf(".");
var rposdot=str.lastIndexOf(".");
//alert(posat); 
//alert(posdot);
//alert(rposdot);


if(rposdot==posdot)
if((posdot < posat) || (posdot-posat < 4))
{
//alert("needs at last 3 cars between @ and . sign");
alert("Invalid E-Mail address");
return false;
}

if(str.charAt(str.length-1)==".")
{
//alert("cannot end with .");
alert("Invalid E-Mail address");
return false;
}

if(str.charAt(str.length-1)=="@")
{
//alert("cannot end with @");
alert("Invalid E-Mail address");
return false;
}

var j=0;
for( var i=0;i<str.length;i++)
{
if(str.charAt(i) == "@")
j++;
}
if(j > 1)
{
//alert("only one @ sign allowed");
alert("Invalid E-Mail address");
return false;
}
 ///////////////////////////////////////////sdf
 //if(document.frm.textfield2.value.indexOf('@',0) < 0)
 //{
// alert("It seems your textfield2 ID is not valid");
// return false;
//}


 if(document.frm.gender.selectedIndex ==0)
 {
 alert("Please Choose Your Gender");
 
 return false;
 }
 if(document.frm.father_name.value =="")
 {
 alert("Please Enter Your Father's Name");
document.frm.father_name.select();
return false;
 }
 
 if(document.frm.addr1.value =="")
 {
 alert("Please Enter Your Address");
document.frm.addr1.select();
return false;
 }

 if(document.frm.country.selectedIndex ==0)
 {
 alert("Please Choose Your Country");
 
 return false;
 }
 if(document.frm.state.selectedIndex ==0)
 {
 alert("Please Choose Your State");
 
 return false;
 }
 if(document.frm.city.value =="")
 {
 alert("Please Enter Your City");
document.frm.city.select();
return false;
 }
 if(document.frm.pincode.value =="")
 {
 alert("Please Enter Your Pincode");
document.frm.pincode.select();
return false;
 }
 if(document.frm.pincode.value != parseInt(frm.pincode.value)) {
    alert("Enter a numeric value for Pincode.");
    return false;
  }
  
 if(document.frm.contact_no.value =="")
 {
 alert("Please Enter Your Contact Number");
document.frm.contact_no.select();
return false;
 }
if(document.frm.contact_no.value != parseInt(frm.contact_no.value)) {
    alert("Enter a numeric value for Contact Number.");
    return false;
  }
  if(document.frm.pwd.value =="")
  {
alert("Please Provide your Unique Password");
document.frm.pwd.select();
return false;
}
if(document.frm.chk.checked ==0)
{
alert("Please Accept Terms and Condition");
document.frm.chk.select();
return false;
}
 }
 
 
function validity()
	{
	if(document.frm.profi_createdby.selectedIndex ==0)
		{
		alert("Please select the profile Field");
		return false;
		}
	if ( ( document.frm.marital[0].checked == false ) && ( document.frm.marital[1].checked == false ) && ( document.frm.marital[2].checked == false ) )
    	{
        alert ( "Please choose your Marital Status" );
        return false;
    	}	
	if((document.frm.children[0].checked == false) && (document.frm.children[1].checked == false))
		{
		alert("Do you have any children");
		return false;
		}
	if(document.frm.religion.selectedIndex ==0)
		{
		alert("Please choose your religion");
		return false;
		}
	if(document.frm.caste.selectedIndex ==0)
		{
		alert("Please choose your caste");
		return false;
		}
	if(document.frm.day.selectedIndex==0)
		{ 
 		alert("Please choose Day of Date of Birth");
		return false;
		}
	if(document.frm.month.selectedIndex==0)
		{ 
 		alert("Please choose Month of Date of Birth");
 		return false;
		}
	if(document.frm.year.selectedIndex==0)
		{ 
 		alert("Please choose Year of Date of Birth");
 		return false;
		}
	
}
   
   function hideLayer(whichLayer) {

if (document.getElementById) { //gecko(NN6) + IE 5+
// this is the way the standards work
document.getElementById(whichLayer).style.display = "none";
}
else if (document.all) { // IE 4
// this is the way old msie versions work
document.all[whichlayer].style.display = "none";
}
else if (document.layers) { //NN4+
// this is the way nn4 works
document.layers[whichLayer].display = "none";
}

}

function showLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.display = "block";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.display = "block";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].display = "block";
}

}

function handleClick(whichClick,id) {

if (whichClick == "show it") {
// then the user wants to hide the layer
showLayer(id);

}
else if (whichClick == "hide it") {
// then the user wants to show the layer
hideLayer(id);
}

}

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=400,width=500,scrollbar=no,statusbar=no');
	if (window.focus) {newwindow.focus()}
}

function filecheck()
{

   var asc=document.uploadfrm.imgfile.value
   var le=asc.length
   var poin=asc.lastIndexOf(".")
   var accu=asc.substring(poin,le)

   if (!((accu==".jpg") || (accu==".gif") || (accu==".JPEG") || (accu==".jpeg") || (accu==".JPG") || (accu==".GIF")))
   {
     alert ("Please Select Valid Gif or Jpeg Image")
     return false;
   }
   
  // if(document.uploadfrm.imgfile.value =="")
   //{
   //  alert ("Please Select File for Upload")
	// document.uploadfrm.imgfile.select();
   //  return false;
  // }
   
   }
   
function pass()
{
	if(document.frm.pwd.value=="")
	{
		alert("Please Enter your Password");
		document.frm.pwd.select();
		return false;
	}
}


function checkboxes(theForm)
{
var num_of_elements = theForm.length;//how many times to loop
var all_checkboxes ;//used to set the state of all other boxes
var first_checkbox = -1;//use is for "if" statements to know it is not
                        //the first box. I used -1 because it can't be
                        //a value of "i" in the loop. Any number other
                        //than 0 to num_of_elements would work. But
                        //num_of_elements is unknown, so a negative
                        //was a safe choice.

for (var i=0; i<num_of_elements; i++)//loop through all elements in 
	{
	var theElement = theForm.elements[i];//saves some typing later
	var element_type = theElement.type;//use in "if" statements

	if (element_type =="checkbox" && first_checkbox == -1)//true only for first checkbox
		{
		first_checkbox = i;//used for later "if" statements
		if (theElement.checked == true)
			all_checkboxes = true;
		else
			all_checkboxes = false;
		}

else if (element_type =="checkbox" && first_checkbox != -1)//true for all BUT first checkbox
		theElement.checked = all_checkboxes;//set to control checkbox state
	}
}


function inbox()
{
	if(document.frm.to.value =="")
	{
		alert("Please Insert SenderID");
		document.frm.to.select();
		return false;
	}
	if(document.frm.subject.value =="")
	{
		alert("Please Insert Subject");
		document.frm.subject.select();
		return false;
	}
	if(document.frm.message.value =="")
	{
		alert("Please Insert your Messages");
		document.frm.message.select();
		return false;
	}
	
	
	
}


<!------------------------Horoscope-------->
function horo()
{
	if(document.horoform.nm.value=="")
	{
		alert("Please Provide your Name");
		document.horoform.nm.select();
		return false;
	}
	if(document.horoform.dd.selectedIndex==0)
	{
		alert("Please Select Date");
		//document.horoform.nm.select();
		return false;
	}
	if(document.horoform.mm.selectedIndex==0)
	{
		alert("Please Select Month");
		//document.horoform.nm.select();
		return false;
	}
	if(document.horoform.yy.selectedIndex==0)
	{
		alert("Please Select Year");
		//document.horoform.nm.select();
		return false;
	}
	if(document.horoform.hr.selectedIndex==0)
	{
		alert("Please Select Hour");
		//document.horoform.nm.select();
		return false;
	}
	if(document.horoform.tt.selectedIndex==0)
	{
		alert("Please Select Time");
		//document.horoform.nm.select();
		return false;
	}
	if(document.horoform.gender.value=="")
	{
		alert("Please Provide your Gender");
		document.horoform.nm.select();
		return false;
	}
	
}
function ch()
{
	var id=document.frm.search2.value;
	var len=id.length;
	if(len<5)
	{
		alert("Member ID must be atleast 5 character");
		return false;
	}
}

function valid()
{
	if(document.login_frm.id.value=="")
	{
		alert("Please provide Your Member ID");
		document.login_frm.id.select();
		return false;
	}
	if(document.login_frm.psw.value=="")
	{
		alert("Please provide Your Password");
		document.login_frm.psw.select();
		return false;
	}
	
}


function refer()
{
	
	var str=document.form3.textfield2.value
//alert(str);


	
		if (document.form3.textfield2.value.indexOf("@",1) == -1)
		{
			alert("Invalid E-Mail address");
			document.form3.textfield2.focus();
			document.form3.textfield2.select();
			return(false);
		}
		if (document.form3.textfield2.value.indexOf("@") == 0)
		{
			alert("Invalid E-Mail address");
			document.form3.textfield2.focus();
			document.form3.textfield2.select();
			return(false);
		}
		if (document.form3.textfield2.value.indexOf(".",5) == -1)
		{
			alert("Invalid E-Mail address");
			document.form3.textfield2.focus();
			document.form3.textfield2.select();
			return(false);
		}
		if (document.form3.textfield2.value.indexOf(".") == 0)
		{
			alert("Invalid E-Mail address");
			document.form3.textfield2.focus();
			document.form3.textfield2.select();
			return(false);
		}
		
		if ((document.form3.textfield2.value.lastIndexOf(".")) -(document.form3.textfield2.value.indexOf("@"))<4 )
		{
		
			alert("Invalid E-Mail address");
			document.form3.textfield2.focus();
			document.form3.textfield2.select();
			return(false);
		}
		
		if ((document.form3.textfield2.value.length)-(document.form3.textfield2.value.indexOf("."))<2)
		{
			alert("Invalid E-Mail address");
			document.form3.textfield2.focus();
			myform.form3.select();
			return(false);
		}

var posat=str.indexOf("@");
var posdot=str.indexOf(".");
var rposdot=str.lastIndexOf(".");
//alert(posat); 
//alert(posdot);
//alert(rposdot);


if(rposdot==posdot)
if((posdot < posat) || (posdot-posat < 4))
{
//alert("needs at last 3 cars between @ and . sign");
alert("Invalid E-Mail address");
return false;
}

if(str.charAt(str.length-1)==".")
{
//alert("cannot end with .");
alert("Invalid E-Mail address");
return false;
}

if(str.charAt(str.length-1)=="@")
{
//alert("cannot end with @");
alert("Invalid E-Mail address");
return false;
}

var j=0;
for( var i=0;i<str.length;i++)
{
if(str.charAt(i) == "@")
j++;
}
if(j > 1)
{
//alert("only one @ sign allowed");
alert("Invalid E-Mail address");
return false;
}
}
<!------------ajax----------------->

function forgotpass()
{

	if(document.forgot.f_mail.value=="")
	{
		alert("Please Provide your email Address");
		document.forgot.f_mail.select();
		return false;
	}
}
function refreshParent() {
  window.opener.location.href = window.opener.location.href; 

  if (window.opener.progressWindow) 
         
 { 
    window.opener.progressWindow.close() 
  } 
  window.close(); 
} 

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));


var pageTracker = _gat._getTracker("UA-3261839-2");
pageTracker._initData();
pageTracker._trackPageview();
