
function setProfilePasswordForm(WeddingId,curobj,WebUrl){
	 var divPos = new ElementPosition(curobj); 
	 xpos = divPos.x;
	 ypos = divPos.y;
	 xpos = xpos + 300;
	 ypos = ypos - 200;
	 document.getElementById(TransLayerId).style.left  = xpos+'px';
	 document.getElementById(TransLayerId).style.top  = ypos+'px';
	 strContent  = '<div class="transparent-layer-loading1" style="width:300px"><img src="images/spinner_grey.gif" align="absmiddle" > please wait a moment to get it..</div>'; 
	 document.getElementById(TransLayerId).innerHTML= TransStartcontent +strContent+ TransEndcontent;	 
	 document.getElementById(TransLayerId).style.display="block";
	 
	 var success = function(t){setProfilePasswordFormCompleted(t,curobj);}
	 var failure = function(t){loadFailed(t);}
	 var url 	= "ajax/form.php";
	 var pars 	= "op=getprofilepassform&WeddingId="+WeddingId+"&WebUrl="+WebUrl;
	 var myAjax 	= new Ajax.Request(url, {method:'post',postBody:pars, onSuccess:success, onFailure:failure});			
}
function setProfilePasswordFormCompleted(t,curobj){
     strContent = t.responseText;
	 document.getElementById(TransLayerId).style.display="none";
	 document.getElementById(TransLayerId).innerHTML= TransStartcontent +strContent+ TransEndcontent;
	 DivId  = TransLayerId;
	 new Effect.BlindDown(DivId, {duration: 1});
}
function saveprofilePassword(){
	WeddingId = document.setpassfrm.WeddingId.value;
	WebUrl    = document.setpassfrm.WebUrl.value;
	txtPass   = document.setpassfrm.txtpass.value;
	if(!IsValid(txtPass,"Profile Password")){	     
		 document.setpassfrm.txtpass.focus();
		 return false;
	}
	$("profilepassmsgId").className = 'search-profilepass-message';
	$("profilepassmsgId").style.display ='block';
	$("profilepassmsgId").innerHTML ='<img src="images/spinner_grey.gif" align="absmiddle" > validating profile password...';
	
	var success = function(t){saveprofilePasswordCompleted(t,WebUrl);}
	var failure = function(t){loadFailed(t);}
	var url 	= "ajax/wedding.php";
	var pars 	= "op=checkprofilepass&WeddingId="+WeddingId+"&txtPass="+txtPass;
	var myAjax 	= new Ajax.Request(url, {method:'post',postBody:pars, onSuccess:success, onFailure:failure});
}
function saveprofilePasswordCompleted(t,WebUrl){
   strContent = (t.responseText).stripTags();
   if(strContent == "failed"){
	  $("profilepassmsgId").className = 'search-profilepass-errmessage';
	  $("profilepassmsgId").style.display ='block';
	  $("profilepassmsgId").innerHTML ='<img src="images/delete_icon.png" align="absmiddle" > invalid profile password '; 
   }
   if(strContent == "success"){
      window.location.href = 'http://'+WebUrl+'.'+SITEDOMAINNAME+'';
   }
}

function setpassEnter(mox){
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{
		var enterKey	=  mox;
	}
	else if (browserName=="Microsoft Internet Explorer")
	 {
	  var enterKey	=  window.event.keyCode;
	 }
	if(enterKey == 13) {
	
		saveprofilePassword();
		  return false;
	 }
	else
	  return true;
}