var JS_addUrl =''; var JS_inbmodule=''; var JS_getdname=''; var Js_MsgCnt =''; var Js_appMsgId='';
var Js_CLick ='';var Js_ShowIcon ='';var Js_Modulename ='';

/* IE - 6 */
var str=navigator.userAgent; 
var patt1=/MSIE 6.0/gi;
/* IE - 6 */
var result_obj=null; 
var valtext;
var imgpath=DOMAINARRAY['domainnameimgs'];
function ashtaopacity(divid, dwidth, url, method){	
	$(divid).style.display="block";
	if ((str.match(patt1)=="MSIE 6.0")&&($('ie6pagecontainer'))) {
		$(divid).style.width = $('ie6pagecontainer').scrollHeight+'px';		
		$(divid).style.height = $('ie6pagecontainer').scrollWidth+'px';
		var newdiv2= document.createElement('div');
		newdiv2.setAttribute("id",'fadediv2');
		newdiv2.className="fadediv";
		newdiv2.style.display='block';
		newdiv2.style.left=0+'px';			
		newdiv2.style.height=29+'px';			
		newdiv2.style.width=$('ie6pagecontainer').scrollWidth+'px';								
		$('footer-wrap').appendChild(newdiv2);
	} else{		
		$(divid).style.width = document.body.clientWidth+'px';		
		$(divid).style.height = document.body.scrollHeight+'px';
	}
	if ($("zedobanner")) {$("zedobanner").style.display = "none";}
	var divtag=document.createElement("div");
	divtag.id = "dispopcN";	
	divtag.className ='dispdiv';		
	divtag.style.top=findPosY($('loadcontent'))+20+'px';	
	divtag.style.width=dwidth+'px';		
	divtag.style.left=(findPosX($('loadcontent'))-15)+'px';		
	divtag.innerHTML ="<div id='contnt' class='smalltxt' style='padding-bottom:10px;text-align:left;'><center><img src='http://imgs.bharatmatrimony.com/bmimages/loading-icon.gif' border='0'></center></div>";
	if ((str.match(patt1)=="MSIE 6.0")&&($('ie6pagecontainer'))) { $('ie6pagecontainer').appendChild(divtag); }else{ document.body.appendChild(divtag); }
	//document.body.appendChild(divtag);
	result_obj=createajax_opac();	
	MakeGetRequest_opac(url,'ashta_respond_result',result_obj);
}
function ashta_respond_result() {
	if (result_obj.readyState == 4) {
		if (result_obj.status == 200) { 
			if(result_obj.responseText!=null && result_obj.responseText!=""){ $('contnt').innerHTML=result_obj.responseText; }
		}
	}
}
function ashtaopacityMatch(url) {		
	$('dispopcN').innerHTML ="<div id='contnt' class='smalltxt' style='padding-bottom:10px;text-align:left;'><center><img src='http://imgs.bharatmatrimony.com/bmimages/loading-icon.gif' border='0'></center></div>";
	result_obj=createajax_opac();	
	MakeGetRequest_opac(url,'ashta_respond_result',result_obj);
}
function ashta_close_div() { 
	if ((str.match(patt1)=="MSIE 6.0")&&($('ie6pagecontainer'))) {
		var fd2=$("fadediv2");
		if (fd2) { fd2.parentNode.removeChild(fd2); }
	}
	$("ashta_opcN").style.display="none"; 
	var e=$("dispopcN");
	if (e) { e.parentNode.removeChild(e); } 	  
	if ($("zedobanner")) {$("zedobanner").style.display = "block";} 
}
function loadTweets(matriid, showid) {
	$("twitterloaddiv").style.display="block";
	$("twitterloaddiv").innerHTML="<center><img src='http://"+DOMAINARRAY['domainnameimgs']+"/bmimages/loading-icon.gif' border='0'></center>";
	$("twitterdiv").style.display="none";
	twit_request = createajax();
	var url="http://profile."+DOMAINARRAY['domainnameshort']+"matrimony.com/profiledetail/twitterupdates.php?matriid="+matriid+"&showid="+showid;
	twit_request.onreadystatechange = fnloadtweets;
	twit_request.open('GET', url, true);
	twit_request.send(null);	
}
function fnloadtweets() {
	if (twit_request.readyState == 4) {
		if (twit_request.status == 200) {
			$("twitterloaddiv").style.display="none";
			$("twitterloaddiv").innerHTML="";
			$("twitterdiv").style.display="block";
			$("twitterdiv").innerHTML=twit_request.responseText;
		}
	}
}
function viewProfilePage (getdname ,JS_memId,inbmodule,JS_viewed,navigation,JS_Lpage,MsgID,MsgCnt,appentMsgId,ShowIcon,Modulename) {
 	JS_inbmodule = inbmodule;JS_getdname=getdname;Js_MsgCnt=MsgCnt;Js_appMsgId=appentMsgId;Js_CLick=navigation;
	Js_ShowIcon =ShowIcon; Js_Modulename =Modulename;
	
	if(Js_CLick == 0)
		JS_viewed = (parseInt(JS_viewed)-1);
	else
		JS_viewed = (parseInt(JS_viewed)+1);

	if(JS_viewed >= 10){
		JS_Calculate = JS_viewed%10;
		JS_Calculate1 = JS_viewed/10;
		if(JS_Calculate == 0){  
  			var addUrl = '&loadPage='+(parseInt(JS_Calculate1)+parseInt(JS_Lpage))+'&viewed='+JS_Calculate;
		}else {
			var addUrl = '&loadPage='+(parseInt(Math.round(JS_Calculate1))+parseInt(JS_Lpage))+'&viewed='+JS_Calculate;
		}
	}else if(JS_viewed == -1){
		    JS_Lpage = (parseInt(JS_Lpage)-1);
			var addUrl = '&loadPage='+JS_Lpage+'&viewed=9';
	}else{
		var addUrl = '&loadPage='+JS_Lpage+'&viewed='+JS_viewed;
	}
	JS_addUrl = addUrl;	//alert(JS_addUrl);  //alert(JS_viewed);

	url = 'http://'+JS_getdname+'/profiledetail/viewprofile_page.php';
	var parameters = 'msgId='+MsgID+'&rq='+JS_inbmodule+'&memberid='+JS_memId+'&movedon='+Js_CLick+JS_addUrl+"&appMsgID="+Js_appMsgId+"&Show="+Js_ShowIcon+"&Module="+Js_Modulename;
	//alert(url+"?"+parameters);
	ajobj=createajax_opac();
	MakePostRequest_opac(url,parameters,'showOutput',ajobj);
	 
}

function showOutput(){
	var showmatriid ='';
	if(ajobj.readyState==4){ 
		if(ajobj.status==200) {
 			showmatriid = ajobj.responseText; //alert(showmatriid);
 			if(showmatriid != '####0'){
				callviewprofilepage(showmatriid);
			}
			 else{ 
				if(Js_CLick == 0){ //alert("Sorry ! No More Record");
					if(document.getElementById("seperate")){
						document.getElementById("seperate").innerHTML= '';
					}
					document.getElementById("PrevOn").innerHTML= '';
				}
				if(Js_CLick == 1){//alert("Sorry ! No More Record");
					if(document.getElementById("seperate")){
						document.getElementById("seperate").innerHTML= '';
					}
					document.getElementById("NextOn").innerHTML= '';
				}
			  }
			}
	  }
}
 
function callviewprofilepage(showmatriid){ //alert(showmatriid);
	var splitVar =  showmatriid.split('##'); 
  	url = 'http://'+JS_getdname+'/profiledetail/viewprofile.php'; 
	
	if(splitVar[2] == '0'){
		if(Js_CLick == 1){
			var appMsgId='&appMsgId='+Js_appMsgId+"~"+splitVar[0]+"|##|"+splitVar[1]; 
		}
		else{
			var appMsgId='&appMsgId='+splitVar[0]+"|##|"+splitVar[1]+"~"+Js_appMsgId; 
		}
	}else{
		var appMsgId='&appMsgId='+Js_appMsgId;
	}

 //For New Message
	var parameters = 'rand='+genNumbers()+'&id='+splitVar[1]+'&msgId='+splitVar[0]+'&rq='+JS_inbmodule+'&TotCnt='+Js_MsgCnt+JS_addUrl+appMsgId+"&Show="+Js_ShowIcon+"&Module="+Js_Modulename;

 	var redirectval = url+'?rand='+genNumbers()+'&id='+splitVar[1]+'&msgId='+splitVar[0]+'&rq='+JS_inbmodule+'&TotCnt='+Js_MsgCnt+'&appMsgId='+Js_appMsgId+JS_addUrl+"&Show="+Js_ShowIcon+"&Module="+Js_Modulename;

	if(JS_inbmodule == 'N' || JS_inbmodule =='F')
		viewProfileFormSubmit(parameters,splitVar[1],splitVar[0],splitVar[2]);
	else{
		//alert(redirectval);
		//document.submit();
		window.location=redirectval;
	}
	//MakeGetRequest_opac(url+'?rand='+genNumbers()+'&id='+matriidsplit[1]+'&from='+JS_from+'&rq='+JS_inbmodule+'&totalinb='+JS_inbcnt+'&viewed='+JS_viewed,'showviewprofileOutput',ajobj1);
}


function viewProfileFormSubmit(vals,id,msgId,Chkvar) { 
	var curDomain=document.domain; 
	var clrSplitTxt=vals.split("&"); 
	var form = document.createElement("form");
	var url ='http://'+curDomain+'/profiledetail/viewprofile.php?id='+id+'&msgid='+msgId+'&chk='+Chkvar;
	form.setAttribute("method", "post"); 
	form.setAttribute("action", url);
 	for(var i=0; i<clrSplitTxt.length; i++){
			var innerSplitTxt = clrSplitTxt[i].split("="); 
 	   		var clientIDField = document.createElement("input");
 			clientIDField.setAttribute("type", "hidden");
			clientIDField.setAttribute("name", innerSplitTxt[0]);
			clientIDField.setAttribute("value", innerSplitTxt[1]);
			clientIDField.setAttribute("id", innerSplitTxt[0]);
			form.appendChild(clientIDField);
		}

//alert(form);
	document.body.appendChild(form); 
	form.submit();
}


function blocking(tag){if(dv){var state=dv(tag).style.display;}else if(document.all){var state=document.all[tag].style.display;}var newState="";if(state=="block"){newState="none";}else{newState="block";}if(dv){dv(tag).style.display=newState;}else if(document.all){document.all[tag].style.display=newState;}}function generatebill(){window.print();location.reload();}function loadsettings(url,divid){var dom=dv('dom').value;for(i=1;i<=5;i++){if(i==divid){dv('tab'+i+'div1').className="fleft tabclrleft";dv('tab'+i+'div2').className="fleft tabclrright";dv('tab'+i+'div3').className="mediumtxt1 boldtxt clr4";}else{dv('tab'+i+'div1').className="fleft tableft";dv('tab'+i+'div2').className="fleft tabright";dv('tab'+i+'div3').className="mediumtxt1 boldtxt clr3";}}MakeGetRequest(url,alertContentsPass);}function loadsettingsedit(url,divid){for(i=1;i<=4;i++){if(i==2){dv('tab'+i+'div1').className="fleft tabclrleft";dv('tab'+i+'div2').className="fleft tabclrright";dv('tab'+i+'div3').className="mediumtxt1 boldtxt clr4";}else{dv('tab'+i+'div1').className="fleft tableft";dv('tab'+i+'div2').className="fleft tabright";dv('tab'+i+'div3').className="mediumtxt1 boldtxt clr3";}}var poststr="view=1";MakePostRequest(url,poststr,alertContentsPass);}function loadprofile(url,id){var poststr="BMID="+id;MakePostRequest(url,poststr,alertContentsPass);}function alertContentsPass(){if(ajobj.readyState==4){if(ajobj.status==200){dv('loadcontent').innerHTML='';dv('loadcontent').innerHTML=ajobj.responseText;}else{alert('There was a problem with the request.');}}}function viewprofinbexpfunc(){var dom=dv('dom').value;var viewid=dv('viewid_hidden').value;var viewgenderid=dv('viewgenderid_hidden').value;MakeGetRequest('http://'+dom+'/profiledetail/viewprofileinboxview.php?viewid='+viewid+'&viewgender='+viewgenderid,dismsg_express);}function dismsg_express(){if(ajobj.readyState==4){if(ajobj.status==200){content=ajobj.responseText;dv('viewprofinbexp').innerHTML=content;dv('subdiv').innerHTML=content;}else{alert('There was a problem with the request.');}}}function loadhide(opt,val){var dom=dv('dom').value;url="http://"+dom+"/modify/modifyprofilehide.php?action="+opt+"&hide="+val;if(val==1){MakeGetRequest(url,alertContentsPartner);}else if(val==2){MakeGetRequest(url,alertContentsHobbies);}else if(val==3){MakeGetRequest(url,alertContentsFamily);}}function alertContentsPartner(){if(ajobj.readyState==4){if(ajobj.status==200){if(ajobj.responseText=="HI"){dv('PU').style.display="block";dv('PH').style.display="none";}else{dv('PU').style.display="none";dv('PH').style.display="block";}}else{alert('There was a problem with the request.');}}}function alertContentsHobbies(){if(ajobj.readyState==4){if(ajobj.status==200){if(ajobj.responseText=="HI"){dv('HU').style.display="block";dv('HH').style.display="none";}else{dv('HU').style.display="none";dv('HH').style.display="block";}}else{alert('There was a problem with the request.');}}}function alertContentsFamily(){if(ajobj.readyState==4){if(ajobj.status==200){if(ajobj.responseText=="HI"){dv('FU').style.display="block";dv('FH').style.display="none";}else{dv('FU').style.display="none";dv('FH').style.display="block";}}else{alert('There was a problem with the request.');}}}function addRefList(argMatriId,argDomain){argUrl='http://'+argDomain+'/profiledetail/profilestatistics.php';delObj=MakeGetRequest(argUrl,'delDiv');}function delDiv(){if(delObj.readyState==4){if(delObj.status==200){dv('sectab_content_1').style.display="block";dv('sectab_content_1').innerHTML=delObj.responseText;}else{alert('There was a problem with the request.');}}}function slide(c,svcount){if(c=="nxt"){if(dv("mprofslide1").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}if(svcount<=6){for(var i=4;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="none";dv("prv").style.display="block";dv("nxt").style.display="none";dv("hnxt").style.display="block";}else{for(var i=4;i<=6;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="none";dv("prv").style.display="block";}return false;}if(dv("mprofslide4").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}if(svcount>6){for(var i=7;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("nxt").style.display="none";dv("hnxt").style.display="block";}return false;}}if(c=="prv"){if(dv("mprofslide4").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}for(var i=1;i<=3;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="block";dv("prv").style.display="none";dv("nxt").style.display="block";dv("hnxt").style.display="none";}if(dv("mprofslide7")){if(dv("mprofslide7").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}for(var i=4;i<=6;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="none";dv("prv").style.display="block";dv("nxt").style.display="block";dv("hnxt").style.display="none";}}}}function slide(c,svcount){if(c=="nxt"){if(dv("mprofslide1").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}if(svcount<=6){for(var i=4;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="none";dv("prv").style.display="block";dv("nxt").style.display="none";dv("hnxt").style.display="block";}else{for(var i=4;i<=6;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="none";dv("prv").style.display="block";}return false;}if(dv("mprofslide4").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}if(svcount>6){for(var i=7;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("nxt").style.display="none";dv("hnxt").style.display="block";}return false;}}if(c=="prv"){if(dv("mprofslide4").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}for(var i=1;i<=3;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="block";dv("prv").style.display="none";dv("nxt").style.display="block";dv("hnxt").style.display="none";}if(dv("mprofslide7")){if(dv("mprofslide7").style.display=="block"){for(var i=1;i<=svcount;i++){var divid="mprofslide"+i;dv(divid).style.display="none";}for(var i=4;i<=6;i++){var divid="mprofslide"+i;dv(divid).style.display="block";}dv("hprv").style.display="none";dv("prv").style.display="block";dv("nxt").style.display="block";dv("hnxt").style.display="none";}}}}function show_focus(){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){window.location.href="#"+"showahref1";}else if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){window.location.href="#"+"showdiv1";}else{window.location.href="#"+"showdiv1";}}


function slidescroll(dvid,wclck,vcount,tcount,hdvid) {	
		if (wclck=="nxt")
		{
			var vc = 1;
			for (var i=1; i<=tcount; i++)
			{
				var tempdiv = dvid + i;							

				if(document.getElementById(tempdiv).style.display == "block")
				{
					document.getElementById(tempdiv).style.display = "none";
					i++;
					for (var j=i; j<=tcount; j++)
					{					
						var disdiv = dvid + j;
						if (vc <= vcount)
						{				
							document.getElementById(disdiv).style.display = "block";
							var shdvid = "h" + hdvid;
							document.getElementById(hdvid).style.display = "block";
							document.getElementById(shdvid).style.display = "none";
							if (j==tcount)
							{
								var hidn = "h" + wclck;								
								document.getElementById(wclck).style.display = "none";
								document.getElementById(hidn).style.display = "block";
								return true;
							}
						}
						else
						{return true;}
						vc++;					
					}
				}					
			}
		}	

		if (wclck=="prv")
		{
			var vc = 1;
			for (var i=tcount; i>=1; i--)
			{
				var tempdiv = dvid + i;							

				if(document.getElementById(tempdiv).style.display == "block")
				{
					document.getElementById(tempdiv).style.display = "none";
					i--;
					for (var j=i; j>=1; j--)
					{												
						var disdiv = dvid + j;
						if (vc <= vcount)
						{				
							document.getElementById(disdiv).style.display = "block";
							var shdvid = "h" + hdvid;
							document.getElementById(hdvid).style.display = "block";
							document.getElementById(shdvid).style.display = "none";
							if (j==1)
							{
								var hidn = "h" + wclck;								
								document.getElementById(wclck).style.display = "none";
								document.getElementById(hidn).style.display = "block";								
								return true;
							}
						}
						else
						{return true;}
						vc++;						
					}	
				}					
			}
		}
	}