 var curDomain=document.domain;
 var HoroPoints = ''; var HoroPercentage =''; var HoroContent='';
function ajaxRequestForHoro(loginid,partnerid){
 	//MakeGetRequest('http://'+curDomain+'/horoscope/bulkhoroscopes.php?loginid='+loginid+'&partnerid='+partnerid,replacehorodiv);
 	//MakeGetRequest('http://'+curDomain+'/horoscope/horoscopematch.php?loginid='+loginid+'&partnerid='+partnerid+'&htype='+htype,replacehorodiv);

}

 function ajaxRequestForHoro_inbox(loginid,partnerid){
 	//MakeGetRequest('http://'+curDomain+'/horoscope/bulkhoroscopes.php?loginid='+loginid+'&partnerid='+partnerid,replacehorodiv_inbox);
 	//MakeGetRequest('http://'+curDomain+'/horoscope/horoscopematch.php?loginid='+loginid+'&partnerid='+partnerid+'&htype='+htype,replacehorodiv_inbox);


 //MakeGetRequest('http://'+curDomain+'/memberlist/horocheck.php?rand='+genNumbers(),replacehorodiv);
}

function replacehorodiv(){    
  if(ajobj.readyState==4){ 
 	 if(ajobj.status==200){ 
		var horotxt=ajobj.responseText;
		var horosplittxt = new Array();

		if(htype == 1) var PercentVal = "/36";
		else var PercentVal = "/44";

 		var horosplittxt=horotxt.split("|");  
 		for(var i=0; i <horosplittxt.length; i++){
			var horodivreplace=horosplittxt[i].split("~");  
			for(var j=0; j <=10; j++){ 
  			   if(dv(loginid+'_'+trim(horodivreplace[0])+'_'+j+'_content') && horodivreplace[2] != '') { 
  				   if(dv('pmm').innerHTML == ''){
						dv(loginid+'_'+trim(horodivreplace[0])+'_'+j+'_content').innerHTML=' Horoscope Match- ';
				   }else {
					   dv(loginid+'_'+trim(horodivreplace[0])+'_'+j+'_content').innerHTML=' Horoscope Match- ';
				   } 
						dv(loginid+'_'+trim(horodivreplace[0])+'_'+j+'_percentage').innerHTML=horodivreplace[3]+' ('+horodivreplace[1]+PercentVal+ ')'; 
						
 						dv(loginid+'_'+trim(horodivreplace[0])+'_'+j).innerHTML= horodivreplace[3];

						HoroPercentage = horodivreplace[1];
						HoroPoints=horodivreplace[2];
						HoroContent=horodivreplace[3];
				}
			 }
		  }
	   }
    }
 }
 

// Removes leading whitespaces
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}




function replacehorodiv_inbox(){  
  if(ajobj.readyState==4){ 
   if(ajobj.status==200){ 
	var horotxt=ajobj.responseText;
 	var horosplittxt = new Array();
	var getcurrentdiv = new Array(); 

	var horosplittxt=horotxt.split("|"); 
 	var getcurrentdiv=dv("inbhorodiv").innerHTML.split("|^^|"); 
	if(htype == 1) var PercentVal = "/36";
	else var PercentVal = "/44";
 	for(m=0;m<horosplittxt.length;m++){  
		 var getfromhoro=horosplittxt[m].split("~");  

		for(j=0;j<getcurrentdiv.length;j++){
 			var getmatriid=getcurrentdiv[j].split("_"); 
 			  	if(trim(getfromhoro[0]) == trim(getmatriid[0])){ 
	  				if(dv(loginid+'_'+trim(getcurrentdiv[j])+'_content')){
	 	 				dv(loginid+'_'+trim(getcurrentdiv[j])+'_content').innerHTML=' Horoscope Match- ' ;

   						dv(loginid+'_'+trim(getcurrentdiv[j])+'_percentage').innerHTML=getfromhoro[3]+' ('+getfromhoro[1]+PercentVal+ ')'; 
						HoroPercentage = getfromhoro[1];
						HoroPoints=getfromhoro[2];
 						dv(loginid+'_'+trim(getcurrentdiv[j])).innerHTML= getfromhoro[3];
						HoroContent=getfromhoro[3];
						
					}
 				}	
			}
	    }
	 }
   }
} 


function gethoro(divname,divvalues,userid,name,pid){
	var replaceval = dv(divvalues+'_percentage').innerHTML; 
	
fade(divname,'fadediv','dispdiv','480','','','/horoscope/horoscopecompatibilitystatus.php?ID='+userid+'&N='+name+'&points='+HoroPoints +'&pid='+pid+'&s='+HoroPercentage+'&htype='+htype+'&frm=srch&txtres='+HoroContent,'','dispcontent','','');
}