
// .....................Lightbox main coding...................

function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

//.................... Ajax main code....................

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


//............... forgetpassword coding...................

function showmain(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	var url="forgetPassword.php";
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=userChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userChanged() 
{ 

if (xmlHttp.readyState==4)
{
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("cpass").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("cpass").innerHTML = xmlHttp.responseText;	
		}
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignpwd');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 115 - objLoadingImage.offsetHeight) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("cpass").style.display='';

}
}

// .........................Needpage coding.....................

function showmed(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
  var windowHeight = document.body.offsetHeight;
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
  
  if(str==1)
  {
   document.getElementById('need1').style.top='16em';
	var url="need/medical_lightbox.php";	
  }
  else if(str==2)
  {
	var url="need/education_lightbox.php";  
  }
  else if(str==3)
  { 
	var url="need/Artificial_lightbox.php";  
  }
  else if(str==4)
  {
	var url="need/food_lightbox.php";  
  }
  else if(str==5)
  {
	var url="need/surgery_lightbox.php";  
  }
  else if(str==6)
  {
	var url="need/vehicle_lightbox.php";  
  }
  else if(str==7)
  {
	var url="need/employment_lightbox.php";  
  }
  else if(str==8)
  {
	var url="need/property_lightbox.php";  
  }
  else if(str==9)
  {
	var url="need/funds_lightbox.php";  
  }
  else if(str==10)
  {
	var url="need/things_lightbox.php";  
  }
  else if(str==11)
  {
	var url="need/medical_camp_lightbox.php";  
  }
  else if(str==12)
  {
	var url="need/cloths_lightbox.php";  
  }
  else if(str==13)
  {
	var url="need/blood_lightbox.php";  
  }
 /*else if(str==14)
  {
	var url="need/eye_lightbox.php";  
  }
  else if(str==15)
  {
	var url="need/human_lightbox.php";  
  } */
  else if(str==16)
  {
	var url="need/sports_lightbox.php";  
  }
  else if(str==17)
  {
	var url="need/marriage_lightbox.php";  
  }
   else if(str==18)
  {
	var url="need/Heiring_aid_lightbox.php";  
  }
  else if(str==19)
  {
	var url="need/sponsor_lightbox.php";  
  }
  else if(str==20)
  {
	var url="need/talents_oriended_lightbox.php";  
  }
    
url=url+"?userverificationid="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=userChanged100;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function userChanged100() 
{

if (xmlHttp.readyState==4)
{
			var objOverlay = document.getElementById('fade');
			var objLoadingImage = document.getElementById('alignNeed');
			var arrayPageSize = getPageSize();
			var arrayPageScroll = getPageScroll();
			if (objLoadingImage) 
			{
			objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 320 - objLoadingImage.offsetHeight) / 2) + 'px');
			}
			objOverlay.style.height = (arrayPageSize[1] + 'px');

	 document.getElementById("need1").style.display='';
		
		if(xmlHttp.responseText=="")
		{
			//sleep(2000);
        document.getElementById("need1").innerHTML ="<center><img src='../images/preload_send.gif'  width=30 height=30></center>";	
		}
		else
		{
           document.getElementById("need1").innerHTML=xmlHttp.responseText;	
		}

							if(document.getElementById('needType1000').value=='education')
							{
									if(document.getElementById('educheck').value=="")
									{
										document.getElementById('educheck').value='O';
									}	
									else
									{
										if(document.getElementById('educheck').value=='Y')
										{
											load('edu',2,1,3);	
											document.getElementById('but2').style.display='';
										}
										else if(document.getElementById('educheck').value=='N')
										{
											load('edu',3,2,1);	
											document.getElementById('educheck').value='N';
											document.getElementById('but3').style.display='';
										}
										else if(document.getElementById('educheck').value=='O')
										{
											load('edu',1,2,3);	
											document.getElementById('educheck').value='O';
											document.getElementById('but1').style.display='';
										}
									}
							}
							
						else if(document.getElementById('needType1000').value=='medical')
							{			
								if(document.getElementById('medicheck').value=="")
								{
								document.getElementById('medicheck').value='O';
								}		
									else
									{
									if(document.getElementById('medicheck').value=='Y')
									{
									load('med',2,1,3);	
									document.getElementById('but2').style.display='';
									}
									else if(document.getElementById('medicheck').value=='N')
									{
									load('med',3,2,1);	
									document.getElementById('medicheck').value='N';
									document.getElementById('but3').style.display='';
									}
									else if(document.getElementById('medicheck').value=='O')
									{
									load('med',1,2,3);	
									document.getElementById('medicheck').value='O';
									document.getElementById('but1').style.display='';
									}
								}
							}
							
						else if(document.getElementById('needType1000').value=='surgery')
							{			
								if(document.getElementById('surgcheck').value=="")
								{
								document.getElementById('surgcheck').value='O';
								}		
									else
									{
									if(document.getElementById('surgcheck').value=='Y')
									{
									load('sur',2,1,3);	
									document.getElementById('but2').style.display='';
									}
									else if(document.getElementById('surgcheck').value=='N')
									{
									load('sur',3,2,1);	
									document.getElementById('surgcheck').value='N';
									document.getElementById('but3').style.display='';
									}
									else if(document.getElementById('surgcheck').value=='O')
									{
									load('sur',1,2,3);	
									document.getElementById('surgcheck').value='O';
									document.getElementById('but1').style.display='';
									}
								}
							}	
				 // for edu
				 
}

}



//..................Toolspage coding.......................................

function showneed(str)
{
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
//	document.getElementById('fade').className='black_overlay1';	
//	document.getElementById('fade').style.height=windowHeight + 'px';
	//document.getElementById('need').style.top='26em';
  if(str==1)
  {
	
	var subcat=document.getElementById('subcat').value;
	var preval=document.getElementById('preval').value;
	var help=document.getElementById('help').value;
	
	
	if(preval=="y")
	{

		if((help=="Individuals")&&(subcat==""))
		{
		var url="tools/templates/normal_lightbox.php";
 
		}
			else if((help=="Individuals")&&(subcat!=""))
			{
				if(subcat=="Physically Challenged" )
				{  
				var url="tools/templates/physically_lightbox.php";	
				}
						else if(subcat=="Mentally Challenged" )
				{
				var url="tools/templates/mentally_lightbox.php";	
				}
							else if(subcat=="Visually Challenged")
				{
				var url="tools/templates/blind_lightbox.php"; 
				}
								else if(subcat=="Deaf & Mute")
				{
				var url="tools/templates/deaf_lightbox.php"; 
				}
									else if(subcat=="Old Aged")
				{
				var url="tools/templates/old-aged_lightbox.php"; 
				}
							else if(subcat=="Rehabilation")
				{
				var url="tools/templates/rehabilation_lightbox.php"; 
				}
								else if(subcat=="Child Labour")
				{
				var url="tools/templates/child_labour_lightbox.php"; 
				}
									else if(subcat=="Refugees")
				{
				var url="tools/templates/refugees_lightbox.php"; 
				}
									else if(subcat=="Cross Gender")
				{
				var url="tools/templates/cross_gender_lightbox.php"; 
				}
									else if(subcat=="Street Children")
				{
				var url="tools/templates/street_children_lightbox.php";  
				}
									else if((subcat=="Normal") ||(subcat=="General"))
				{
				var url="tools/templates/normal_lightbox.php";  
				}
			}
				else if((help=='Volunteer'))
				{
						var url="tools/templates/normal_lightbox.php";  
				}
					else if((help!='Individuals'))
					{
						var url="tools/templates/found_lightbox.php";
					}
	}
	else
	{
		// check here
		document.getElementById('fade').style.display='block';
		showalert('lightbox_need.php','','','all','Category');
		return false;
	}
	
  }
 
  else if(str==2)
  {
	      var prevalfam=document.getElementById('prevalfam').value;	
	
	if(prevalfam=="y")
	{
		var url="tools/templates/family_lightbox.php"; 
	}
	else
	{
		//check here
		document.getElementById('fade').style.display='block';
		showalert('lightbox_need.php','','','all','Family');
		//alert("Family Details Already Inserted");
		//document.getElementById('fade').style.display='none';
		return false;
	}
  }
  else if(str==3)
  {
	var url="tools/templates/photo_lightbox.php";  
  }
  	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userChanged300;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

//function for restrict the aboutus form access
function about_check(value)
{
	if(value>=1)
	{
		document.getElementById('fade').style.display='block';
		showalert('lightbox_need.php','','','all','about_check');
		//alert('can`t access');
		//document.getElementById('fade').style.display='';
		return false;
	}
	else
	{
		showneed('1');
		return true;
	}
}

function userChanged300() 
{ 

if (xmlHttp.readyState==4)
{
				

		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('aligntool');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();

		//alert(arrayPageScroll[1]);
		//alert(arrayPageSize[3]);


				if (objLoadingImage) 
				{
			//objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 225 - objLoadingImage.offsetHeight) / 2) + 'px');
				//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
				}

		document.getElementById("need").style.display='';
		//objOverlay.style.height = (arrayPageSize[1] + 'px');
		objLoadingImage.style.top =arrayPageScroll[1] + 100 + 'px';
		
		if(xmlHttp.responseText=="")
				{
				 document.getElementById("need").innerHTML ="<center><img src='../images/preload_send.gif' width=30 height=30></center>";	
				}
				else
				{
				document.getElementById("need").innerHTML=xmlHttp.responseText;
				if(document.getElementById('TotalImage').value<2)
				{
				document.getElementById('div_priority').style.display='none';
				}
				else
				{
					document.getElementById('div_priority').style.display='block';
				}
				}
}
}


// ....................Mymatches coding..............................

function showmatch(pro_id,arr_id,url,pagename)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 	
  	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
	url=url+"?sid="+Math.random();
	url=url+"&pro_id="+pro_id+"&arr_id="+arr_id+"&pagename="+pagename;
	//alert(url);
	xmlHttp.onreadystatechange=light_userChanged400;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function light_userChanged400()
{ 
				if (xmlHttp.readyState==4)
				{	
					if(xmlHttp.responseText=="")
				{
				 document.getElementById("fri").innerHTML ="<center><img src='../images/preload_send.gif'  width=30 height=30></center>";	
				}
				else
				{
				document.getElementById("fri").innerHTML=xmlHttp.responseText;	
				}
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignfri');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
				if (objLoadingImage) 
				{
				objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
				//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
				}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("fri").style.display='';
	}
}

function showvol(pro_id,url,pagename)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
	url=url+"?sid="+Math.random();
	url=url+"&pro_id="+pro_id+"&arrId="+arrId+"&pagename="+pagename;
	//alert(url);
	xmlHttp.onreadystatechange=light_vol;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function light_vol()
{ 
	if (xmlHttp.readyState==4)
	{	
			if(xmlHttp.responseText=="")
			{
			 document.getElementById("fri").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
			}
			else
			{
			document.getElementById("fri").innerHTML=xmlHttp.responseText;	
			}
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignfri');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("fri").style.display='';
	}
}

// .................................Changemode coding..................................

function showmode(str,url,sescat,pagename)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 	
	
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
  	url=url+"?userverificationid="+str+"&sescat="+sescat+"&pagename="+pagename;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange = response_mode;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function response_mode() 
{ 
	//alert(xmlHttp.responseText);
	if (xmlHttp.readyState==4) // 2 => request sent  4 => request complete
	{		
			if(xmlHttp.responseText=="")
			{
			 document.getElementById("cmode").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
			}
			else
			{
			document.getElementById("cmode").innerHTML=xmlHttp.responseText;	
			}
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignmode');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
				if (objLoadingImage) 
				{
				objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
				//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
				}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("cmode").style.display='';
	}
}



function dbdonate(loginid,pid,messages,reason,cattype,fname,url)
{		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		  alert ("Your browser does not support AJAX!");
		  return;
	}	
	url=url+"?loginid="+loginid+"&pid="+pid+"&messages="+messages+"&reason="+reason+"&cattype="+cattype+"&fname="+fname;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=thanksdb;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function thanksdb()
{
	
			//alert (xmlHttp.responseText);	
	if (xmlHttp.readyState==4)	
	{			
		document.getElementById('dbdonate').style.display = 'none';	
		document.getElementById('thanks').style.height = '90px';
		document.getElementById('thanks').innerHTML = xmlHttp.responseText;			
	}
}

function showdon(url,pid,cattype,fname)
{

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 	
  	var windowHeight = document.body.offsetHeight;
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	url=url+"?pid="+pid+"&cattype="+cattype+"&fname="+fname;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=donate_change;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}

function donate_change() 
{   
	if (xmlHttp.readyState==4)
	{
		
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("donate").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("donate").innerHTML=xmlHttp.responseText;	
		}
		var objOverlay = document.getElementById('fade');

		var objLoadingImage = document.getElementById('aligndonate');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("donate").style.display='';

}
}
// ...............................Change category.......................................

function change_categ(url,nmode,dmode)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
 		return;
 	}
	
	var mode = "";
	if(document.getElementById(nmode).checked == true) 
	{ 
		mode = document.getElementById(nmode).value; 
	} 
	else if(document.getElementById(dmode).checked == true) { mode = document.getElementById(dmode).value; }
	
	url=url+"?action=nd&sid="+Math.random()+"&mode="+mode;	
	//alert(url);
	xmlHttp.onreadystatechange=res_change;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}
function res_change() 
{ 	

	//alert(xmlHttp.responseText);
	if (xmlHttp.readyState==4)
	{	
	
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("pro_mode").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("pro_mode").innerHTML=xmlHttp.responseText;	
		}
		document.getElementById("pro_mode").style.display='';
		
	}
}


// ...................................Show interest...................................

function showinterest(m_id,f_id,t_id,url)
{
	////document.getElementById('rightadd').style.display='none';
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
 		return;
 	} 
	url=url+"?action=send&sid="+Math.random()+"&m_id="+m_id+"&f_id="+f_id+"&t_id="+t_id;	
	//alert(url);
	xmlHttp.onreadystatechange=light_interest;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function light_interest() 
{ 
	if (xmlHttp.readyState==4)
	{	
	
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("inter_msg").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("inter_msg").innerHTML=xmlHttp.responseText;	
		}
		document.getElementById("msg_show").style.display ='none';		
		//document.getElementById("inter_msg").innerHTML=xmlHttp.responseText;		
	}
}

function showvolunteer(m_id,f_id,t_id,url)
{
	////document.getElementById('rightadd').style.display='none';
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
 		return;
 	} 
	
	url=url+"?action=send&sid="+Math.random()+"&m_id="+m_id+"&f_id="+f_id+"&t_id="+t_id;	
	//alert(url);
	xmlHttp.onreadystatechange=light_volunteer;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function light_volunteer() 
{ 
	if (xmlHttp.readyState==4)
	{	
	
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("inter_msg").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("inter_msg").innerHTML=xmlHttp.responseText;	
		}
		document.getElementById("msg_show").style.display ='none';		
		//document.getElementById("inter_msg").innerHTML=xmlHttp.responseText;		
	}
}

function valid()
{
	frm = document.chk;
	tic = frm.elements;
	var flag = 0;
	for (i=0;i<tic.length;i++) 
	 {
		if (tic[i].checked ) 
		{
			flag=1;
		}
	}
	if(flag==0)
	{
		document.getElementById('fade').style.display='block';
		showalert('login/lightbox_need.php','','','search','checkbox_empty_lightbox');
		//alert("Please select any check value");
		return false;
	}
	return true;
}
function valid_chk(fname)
{
	frm = document.chk;
	tic = frm.elements;
	var flag = 0;
	for (i=0;i<tic.length;i++) 
	 {
		if (tic[i].checked ) 
		{
			flag=1;
		}
	}
	if(flag==0)
	{
		
		if(fname == 'search')
		{
			document.getElementById('fade1').style.display='block';
			showalert('login/lightbox_need.php','lightbox_exists','','search','checkbox_empty_lightbox');
		}
		else if(fname == 'myMatches') { 
			document.getElementById('fade1').style.display='block';
			showalert('lightbox_need.php','lightbox_exists','','all','checkbox_empty_lightbox');
		}
		//alert("Please select any check value");
		return false;
	}
	return true;
}

function check()
{
	var i;
  	var count = 0;
	frm = document.chk;
	var selectedArray = new Array();
	var tick = frm.elements;
    var selObj=document.getElementById('checkbox');
	for (i=0;i<tick.length;i++) 
	 {
	  	if (tick[i].checked == true) 
		{
			selectedArray[count] = tick[i].value;
      		count++;
		}
		 document.getElementById('chkval').value = selectedArray;
	}
}

// ............................show Messages.......................................

function showmessage(str)
{
	//document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
 if(str==1)
  {
	//document.getElementById('fade').className='black_overlay1';
	var url="messages/ajax/messagemore_show.php";	
  }
  
  	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=userChanged_msg;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userChanged_msg() 
{ 
	if (xmlHttp.readyState==4)
	{
		
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("msglight").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("msglight").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("msglight").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('msglight');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("msglight").style.display='';
}
}


// ............. Tella friend coding............................
function showfriend(str,pid,page)
{
//document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
 if(str==1)
  {
	var url="tellaFriend.php";	
  }
  
  	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
	url=url+"?userverificationid="+str+"&pid="+pid+"&page="+page;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=userChanged600;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userChanged600() 
{ 

if (xmlHttp.readyState==4)
{
				if(xmlHttp.responseText=="")
				{
				 document.getElementById("friend").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
				}
				else
				{
				document.getElementById("friend").innerHTML=xmlHttp.responseText;	
				}
		//document.getElementById("friend").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignfriend');
		var arrayPageSize = getPageSize();
		//alert(arrayPageSize);
		var arrayPageScroll = getPageScroll();
					if (objLoadingImage) 
					{
					objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
					//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
					}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("friend").style.display='';
}
}

function movetoreg()
{
////document.getElementById('rightadd').style.display='none';	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

	var url="moveprofile.php";	
	
	xmlHttp.onreadystatechange=userChangedreg;
	xmlHttp.open("GET",url,true);
	
	xmlHttp.send(null);
}
function userChangedreg() 
{ 

	if (xmlHttp.readyState==4)
	{
		document.getElementById('headerProfile').innerHTML=xmlHttp.responseText;
		window.open("../individuals.html?action=NEED&name=IDLN");

	}
}

function need_ajax(profile_id,page)
{
	////document.getElementById('rightadd').style.display='none';
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
		var url=page;
		url=url+"?id="+profile_id;
		url=url+"&sid="+Math.random(9999);
		//alert(url);
		xmlHttp.onreadystatechange=needTab;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function needTab()
{
	//alert(xmlHttp.responseText);		
	if (xmlHttp.readyState==4)
	{
		
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("need_div").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("need_div").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("need_div").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		

		var objLoadingImage = document.getElementById('need_div');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("need_div").style.display='';
		timedCount(); 
	}
}



function search_ajax(profile_id,page)
{
	//document.getElementById('rightadd').style.display='none';
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
		var url=page;
		url=url+"?id="+profile_id;
		url=url+"&sid="+Math.random(9999);
		alert(url);
		xmlHttp.onreadystatechange=searchTab;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function searchTab()
{

	if (xmlHttp.readyState==4)
	{
		 document.getElementById("search_div4000").innerHTML=xmlHttp.responseText;	
	/*	if(xmlHttp.responseText=="")
		{
		 document.getElementById("search_div").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("search_div").innerHTML=xmlHttp.responseText;	
		}*/
		
	/*	var objOverlay = document.getElementById('fade');
		

		var objLoadingImage = document.getElementById('search_div');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("search_div").style.display='';
		timedCount(); */
	}
}



//function for Need Restriction
function needvalue(one,selected_value,option_value)
{

		var i;
	  	var count = 0;
		var selected_error;
		var yes_var;
	    var selObj=document.getElementById(one);
		if(selObj.options[0].text=='')
		{
			document.getElementById('fade').style.display='block';
			showmed(option_value);
		}
		if(selObj.options.length >=5)
		{
			document.getElementById('fade').style.display='block';
			showalert('lightbox_need.php','','','all','need_limit');
			 yes_var="yes";
		}
		else{
		for (i=0;i<selObj.options.length;i++) 
		{
			if (selObj.options[i].text==selected_value) 
			{
				document.getElementById('fade').style.display='block';
				showalert('lightbox_need.php','needy','donate','all',selected_value);
				 selected_error='yes';
				break;
  				count++;
		    }
		}
		}
		if(selected_error!='yes' && yes_var!='yes' )
		{
				
			document.getElementById('fade').style.display='block';
			showmed(option_value);
		}	    	    
}


// ...........  Light box for Alert coding ............

function showalert(url,pro_cat,sub_cat,basename,fam,needval,needcnt,opt_val)
{
	//document.getElementById('rightadd').style.display='none';
	/*pathArray = window.location.pathname.split( '/' );
	alert(pathArray.length);
newPathname = "";
for ( i = 0; i<pathArray.length; i++ ) {
newPathname += "/";
newPathname += pathArray[i];
}*/
//alert(pathArray[3]);

	
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 	
    var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	//document.getElementById('light_alert').style.top='26em';
	
  url=url+"?pro_cat="+pro_cat+"&sub_cat="+sub_cat+"&basename="+basename+"&fam="+fam+"&needval="+needval+"&needcnt="+needcnt+"&opt_val="+opt_val+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange = response_alert;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}
function response_alert() 
{ 
	//alert(xmlHttp.responseText);
	if (xmlHttp.readyState==4) // 2 => request sent  4 => request complete
	{		
		if(xmlHttp.responseText=="")
	{
	 document.getElementById("light_alert").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
	}
	else
	{
	document.getElementById("light_alert").innerHTML=xmlHttp.responseText;	
	}
		
		var objOverlay = document.getElementById('fade');
		var objLoadingImage = document.getElementById('alignalert');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 3 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("light_alert").style.display='';
		
		//loadShade();
		
	}
}


/*--------  Function for Blog Pagination ---------*/
function blog_page(url,cate,month,dat,year,limit,page,arrow)
{	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	if(arrow == 'pagination') {
		document.getElementById('divpreLoader').style.display = '';
		//document.getElementById('divpreLoader1').style.display = '';
	}
	var url=url+"?cate="+cate+"&month="+month+"&dat="+dat+"&year="+year+"&limit="+limit+"&page="+page+"&arrow="+arrow;
	url=url+"&sid="+Math.random(9999);
	//alert(url);
	xmlHttp.onreadystatechange = result_blog;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function result_blog()  
{ 
	if(xmlHttp.readyState==4)
		{
		var title = xmlHttp.responseText;
		var arr=title;
		for(i=0;i<arr.split("page_split").length;i++)
		{
			number=arr.split("page_split")[i];
			if(i==1)
			{
			//alert(document.getElementById('post_blogs').innerHTML);
			document.getElementById('post_blogs').innerHTML = number;
			}
		}
		
		}	
		
	
}

/*else
{
//alert('Foundation');
return true;
}

return true;*/


//............... Tell a Friend coding...................

function showtellfriend(str)
{
	
//document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	var url="static/TellaFriend/TellaFriend.template.php";
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userfriend;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userfriend() 
{ 

if (xmlHttp.readyState==4)
{
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("afriend").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("afriend").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("main1").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		
		var objLoadingImage = document.getElementById('alignafriend');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 33 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("afriend").style.display='';

}
}


//............... content lightbox coding...................

function showcontent(str)
{
////document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
  if(str==0)
  {
   //document.getElementById('content').style.top='16em';
	var url="home/home_content/medical.php";	
  }
  else if(str==1)
  {
	var url="home/home_content/education.php";  
  }
  else if(str==2)
  {
	var url="home/home_content/artificial.php";  
  }
  else if(str==3)
  {
	var url="home/home_content/food.php";  
  }
  else if(str==4)
  {
	var url="home/home_content/surgery.php";  
  }
  else if(str==5)
  {
	var url="home/home_content/vehicles.php";  
  }
  else if(str==6)
  {
	var url="home/home_content/employment.php";  
  }
  else if(str==7)
  {
	var url="home/home_content/property.php";  
  }
  else if(str==8)
  {
	var url="home/home_content/funds.php";  
  }
  else if(str==9)
  {
	var url="home/home_content/things.php";  
  }
  else if(str==10)
  {
	var url="home/home_content/medical camps.php"; 
  }
  else if(str==11)
  {
	var url="home/home_content/cloths.php";  //
  }
  else if(str==12)
  {
	var url="home/home_content/blood.php";  
  }
  else if(str==13)
  {
	var url="home/home_content/sports.php";  
  }
  else if(str==14)
  {
	var url="home/home_content/marriage.php";  
  }
  else if(str==15)
  {
	var url="home/home_content/hearing_head.php";  
  }
  else if(str==16)
  {
	var url="home/home_content/sponsor.php";  
  }
  else if(str==17)
  {
	var url="home/home_content/talents.php";  
  }
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=usercontent;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function usercontent() 
{ 
	//alert(xmlHttp.responseText);
	if (xmlHttp.readyState==4) // 2 => request sent  4 => request complete
	{		
			if(xmlHttp.responseText=="")
			{
			 document.getElementById("content").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
			}
			else
			{
			document.getElementById("content").innerHTML=xmlHttp.responseText;	
			}
		var objOverlay = document.getElementById('fade');
		
		var objLoadingImage = document.getElementById('aligncont');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 300 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("content").style.display='';
	}
}


//............... tour coding...................

function showtour(str)
{
//document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  	document.getElementById('tour').style.top='40em';
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	var url="static/tour/templates/content_tour.template.php";
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=usertour;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function usertour() 
{ 

if (xmlHttp.readyState==4)
{
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("tour").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("tour").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("main1").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		
		var objLoadingImage = document.getElementById('aligntour');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 300 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("tour").style.display='';

}
}

//tour validation 
function tour_display(t1,t2,t3,t4,t5,t6,t7,t8)
{
to1=document.getElementById(t1);
to2=document.getElementById(t2);
to3=document.getElementById(t3);
to4=document.getElementById(t4);
to5=document.getElementById(t5);
to6=document.getElementById(t6);
to7=document.getElementById(t7);
to8=document.getElementById(t8);
to1.style.display='';
to2.style.display='none';
to3.style.display='none';
to4.style.display='none';
to5.style.display='none';
to6.style.display='none';
to7.style.display='none';
to8.style.display='none';
}



//............... Change Request coding...................

function showrequest(str)
{
	//document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  	//document.getElementById('request').style.top='40em';
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	
  if(str==0)
  {
  
	var url="changeRequest/change_address.php";	
  }
  else if(str==1)
  {
	var url="changeRequest/change_contact_number.php";  
  }
  else if(str==2)
  {
	var url="changeRequest/change_needs.php";  
  }
	
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userrequ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userrequ() 
{ 

if (xmlHttp.readyState==4)
{
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("request").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("request").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("main1").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		
		var objLoadingImage = document.getElementById('alignrequ');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 250 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("request").style.display='';

}
}


//............... blog coding...................

function showblog(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
    document.getElementById('blog').style.top='60em';
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	var url="blogs/templates/blog_login.php";
	//alert(url);
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userblog;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userblog() 
{ 

if (xmlHttp.readyState==4)
{
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("blog").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("blog").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("main1").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		
		var objLoadingImage = document.getElementById('alignblog');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 300 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("blog").style.display='';

}
}

function blog_register(need, don)
{
	
	var mode = "";
	if(document.getElementById(need).checked == true) { 
		mode = "need"; 	 
		window.open('needy.php?blog=n','_self','');
		} else if(document.getElementById(don).checked == true) {
		mode = "donate"; window.open('donator.php?blog=n','_self','');
	}
		
}


//............... Ads coding...................

function showads(str)
{
//document.getElementById('rightadd').style.display='none';
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  	document.getElementById('ads').style.top='40em';
	var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade').className='black_overlay1';	
	document.getElementById('fade').style.height=windowHeight + 'px';
	var url="static/Advertise/templates/content_ads.template.php";
	url=url+"?userverificationid="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=userads;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function userads() 
{ 

if (xmlHttp.readyState==4)
{
		if(xmlHttp.responseText=="")
		{
		 document.getElementById("ads").innerHTML ="<center><img src='images/preload_send.gif'></center>";	
		}
		else
		{
		 document.getElementById("ads").innerHTML=xmlHttp.responseText;	
		}
		//document.getElementById("main1").innerHTML=xmlHttp.responseText;
		var objOverlay = document.getElementById('fade');
		
		var objLoadingImage = document.getElementById('alignads');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 300 - objLoadingImage.offsetHeight) / 2) + 'px');
		//objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("ads").style.display='';

}
}
//-----------------------------------------insert visit count

function viewid(url,idcat)
{
	
	xmlHttp=GetXmlHttpObject();

  if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  var id=idcat;
  url = url+'?id='+id;
  xmlHttp.onreadystatechange=userviews;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  
	
}

function userviews()
{
	if (xmlHttp.readyState==4)
{
	//alert(xmlHttp.responseText);
}
	
}

//-----------------------------------------insert visit count

function getvisit(url,idcat)
{
	
	xmlHttp=GetXmlHttpObject();

  if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
  var id=idcat;
  url = url+'?id='+id;
  xmlHttp.onreadystatechange=setvisit;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  
	
}

function setvisit()
{
	if (xmlHttp.readyState==4)
{
	//alert(xmlHttp.responseText);
	
	document.getElementById('VisitIDC').innerHTML=xmlHttp.responseText;	
}
	
}



function showalert1(url,pro_cat,sub_cat,basename,fam,needval,needcnt,opt_val)
{
	//document.getElementById('rightadd').style.display='none';
	/*pathArray = window.location.pathname.split( '/' );
	alert(pathArray.length);
newPathname = "";
for ( i = 0; i<pathArray.length; i++ ) {
newPathname += "/";
newPathname += pathArray[i];
}*/
//alert(pathArray[3]);

	
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 	
    var windowHeight = document.body.offsetHeight;
	//alert(windowHeight);
	document.getElementById('fade1').className='black_overlay1';	
	document.getElementById('fade1').style.height=windowHeight + 'px';
	//document.getElementById('light_alert').style.top='26em';
	
  url=url+"?pro_cat="+pro_cat+"&sub_cat="+sub_cat+"&basename="+basename+"&fam="+fam+"&needval="+needval+"&needcnt="+needcnt+"&opt_val="+opt_val+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange = response_alert1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}
function response_alert1() 
{ 
	//alert(xmlHttp.responseText);
	if (xmlHttp.readyState==4) // 2 => request sent  4 => request complete
	{		
		if(xmlHttp.responseText=="")
	{
	 document.getElementById("light_alert1").innerHTML ="<center><img src='../images/preload_send.gif'></center>";	
	}
	else
	{
	document.getElementById("light_alert1").innerHTML=xmlHttp.responseText;	
	}
		
		var objOverlay = document.getElementById('fade1');
		var objLoadingImage = document.getElementById('alignalert1');
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		if (objLoadingImage) 
		{
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.offsetHeight) / 2) + 'px');
		}
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById("light_alert1").style.display='';
		
		//loadShade();
		
	}
}