function validateLoginForm( eForm, sSiteUrl, sErrorString ) {
	if( !eForm )
		return false;
	
	var sUsername = $('input[name=ID]',       eForm ).val();
	var sPass     = $('input[name=Password]', eForm ).val();
	
	var sUrl = sSiteUrl + 'xml/get_list.php?dataType=login&u=' + encodeURIComponent( sUsername ) + '&p=' + encodeURIComponent( sPass );
	
	$.post( sUrl,
		function(sResponse) {
			if (sResponse == 'success')
				eForm.submit();
			else
				alert(sErrorString);
		}
	);
}
function submitQuestionForm(obj,receiverID,sSiteUrl)
{
			/*var obj=document.getElementsByTagName("textarea");
			var textID=new Array();
			var oRequest=new Array();
			
			for(var i=0;i<obj.length;i++)
			{				
				if(obj[i].id.indexOf("qtext_")!=-1)
				{				
					oRequest['qid'] = (obj[i].id);
					oRequest['val'] = obj[i].value;					 
				}
			}
			
			 
			$.post( 'getgeoid.php?task=sendFillQuestion', oRequest, 
			function(sResult){
				 									   
			} );*/
			
			/*$.ajax({
					url: 'latestMessege.php?task=sendFillQuestion&dataType=CheckNameExist&receiverID='+receiverID,
					type: 'post',
					dataType: 'html',
					data: $('form#fillFormQuestion').submit(),
					success:function(response){
                    
                     $('div#buy_profilefillAnswer').html(response);
					 $('div#buy_profilefillAnswer').animate({bottom: 15},{animation: 'slow'} );
					 setTimeout( "setCloseprofilefillAnswer('buy_profilefillAnswer')", 10000 );   
                },
                error:function (xhr, ajaxOptions, thrownError){
                    alert(xhr.status);
                    alert(thrownError);
                }    
				});*/
			
			var obj=document.getElementsByTagName("textarea");
			var textID=new Array();
			var oRequest = {};
			
			for(var i=0;i<obj.length;i++)
			{				
				if(obj[i].id.indexOf("qtext_")!=-1)
				{				
					oRequest[obj[i].id] = obj[i].value;
					//oRequest['val_'+i] = obj[i].value;					 
				}
			}
			
			
			sUrl = sSiteUrl +'latestMessege.php?task=sendFillQuestion&dataType=CheckNameExist&receiverID='+receiverID;
			
			$.post( sUrl,oRequest,
		function(sResponse) {
			if (sResponse)
			{  
				 	 $('div#buy_profilefillAnswer').html(sResponse);
					 $('div#buy_profilefillAnswer').animate({bottom: 15},{animation: 'slow'} );
					 setTimeout( "setCloseprofilefillAnswer('buy_profilefillAnswer')", 10000 );  
					 
			}
			 
		}
	);

			

}
function setClosebuy_profilefillAnswer(task)
{   	
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  0);		
}
function setCloseprofilefillAnswer(task)
{
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  1000);		 
	 
}



function profileSendQuestion(value,txt) { 
		
		var val = value;		
		var oData = getDefaultActions();    
		oData['task'] = 'profilesendQuestion'; 
		oData['val'] = val;
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		  if(s)
		  {
			$('div#buy_profilesendQuestion').html(s);
			$('div#buy_profilesendQuestion').animate({bottom: 15},{animation: 'slow'} );
			setTimeout( "setCloseprofilesendQuestion('buy_profilesendQuestion')", 10000 );   
		  }
        }
      ); 	
}
function closeprofilesendQuestion(task)
{   	
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  0);		
}
function setCloseprofilesendQuestion(task)
{
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  1000);		 
	 
}

function fakeuser()
{
	 	
			var oData = getDefaultActions();   
			jQuery.get (
			'gmap.php', oData,
			function (s) 
			{ 	 
			 //alert(s); 
			}
		  ); 	
			
		
	}
function addQuestionnaries(task,memberID,getID,qid) { 
	 
		var memberID = memberID;
		var task = task;
		var getID = getID;
		var oData = getDefaultActions();
		oData['memberID'] = memberID;
		oData['task'] = task;
		oData['getID'] = getID;
		
	   if(task=='addQuestion')	
	   {		
		if ( document.getElementById("qText").value=="" )
		{
			alert("Please enter question title");
			document.getElementById("qText").focus();
			return false;
		}
		else if (document.getElementById("qText").value!="" )
		{
				var qText = document.getElementById("qText").value;
				oData['qText'] = qText;
				
				jQuery.get (
				'getgeoid.php',
				oData,
				function (s) 
				{			
					showQueLoadingImage(getID);	
					$('div#questionList').html(s);
									
				}
			  ); 
			 
		}
	   }
	   else if(task=='editQuestion')
	   {
		 	if ( document.getElementById("qText").value=="" )
			{
				alert("Please enter question title");
				document.getElementById("qText").focus();
				return false;
			}
			else if (document.getElementById("qText").value!="" )
			{
					var qText = document.getElementById("qText").value;
					var qid = qid;
					oData['qText'] = qText;
					oData['qid'] = qid;
					
					jQuery.get (
					'getgeoid.php',
					oData,
					function (s) 
					{			
						showQueLoadingImage(getID);	
						$('div#questionList').html(s);
										
					}
				  ); 
				 
			} 
	   }
	   else if(task=='addAdminQuestion')	
	   {	 
				oData['qid'] = qid; 
				jQuery.get (
				'getgeoid.php',
				oData,
				function (s) 
				{			
					showQueLoadingImage(getID);	
					$('div#questionList').html(s);
									
				}
			  );  
	   }
	   else if(task=='delQuestion')	
	   {	 
				oData['qid'] = qid; 
				jQuery.get (
				'getgeoid.php',
				oData,
				function (s) 
				{			
					showQueLoadingImage(getID);	
					$('div#questionList').html(s);
									
				}
			  );  
	   }
}
function showQueLoadingImage(val) { 
		
		var p1 = "loading_box";
		document.getElementById("loading_box").style.display='';
		document.getElementById(val).style.display='none';
		var p2 = val;
		var el = document.getElementById("loading_box");	
		if (el) {        
			el.innerHTML = '<div align="center"><img src="images/loading.gif" style="padding-top:15px;background:#fff;"   ></div>'; 		
			  window.setTimeout('stopLoadingQuestion(\''+p1+'\',\''+p2+'\')', 400);
			
		}
}
function stopLoadingQuestion(p1,p2) {  	 
		document.getElementById(p1).style.display='none';    
	 	document.getElementById(p2).style.display='';
  } 
/*function writeComment(vid,task)
{
	 
	if(task == "add" && vid!=0)
	{
	 		$('.vComment').css( 'display', 'none' );
			document.getElementById('addComment').style.display='';
		
	}
	else if(task == "save")
	{
	 		 
			
			var comment = document.getElementById('comment').value;			
			var vid = vid;
			var oData = getDefaultActions();    
			oData['task'] = 'saveComment';
			oData['vid'] = vid;
			oData['comment'] = comment;
			jQuery.get (
			'showVideo.php', oData,
			function (s) 
			{ 
				 
					$('.vComment').css( 'display', 'none' );
					document.getElementById('commentLink').style.display='';
					document.getElementById('showComment').style.display='';
					$('div#divcomment').html('<div style="border:1px solid #ccc;padding:5px;width:225px;" >'+comment+'</div>');
					 
				 
			}
		  ); 	
			
		
	}
	else if(task == "cancle")
	{
	 		$('.vComment').css( 'display', 'none' );
			document.getElementById('commentLink').style.display='';
			document.getElementById('showComment').style.display='';
		
	}
}*/
function writeComment(vid,task)
{
	 
	if(task == "add" && vid!=0)
	{
	 		$('.vComment_'+vid).css( 'display', 'none' );
			document.getElementById('addComment_'+vid).style.display='';
		
	}
	else if(task == "save")
	{
	 		/*$('.vComment').css( 'display', 'none' );
			document.getElementById('commentLink').style.display='';*/ 
			
			var comment = document.getElementById('comment_'+vid).value;	 
			var vid = vid;
			var oData = getDefaultActions();    
			oData['task'] = 'saveComment';
			oData['vid'] = vid;
			oData['comment'] = comment;
			jQuery.get (
			'showVideo.php', oData,
			function (s) 
			{ 
				 
					$('.vComment_'+vid).css( 'display', 'none' );
					document.getElementById('commentLink_'+vid).style.display='';
					document.getElementById('showComment_'+vid).style.display='';
					$('div#divcomment_'+vid).html('<div style="border:1px solid #ccc;padding:5px;width:125px;" >'+comment+'</div>');
					 
				 
			}
		  ); 	
			
		
	}
	else if(task == "cancle")
	{
	 		$('.vComment_'+vid).css( 'display', 'none' );
			document.getElementById('commentLink_'+vid).style.display='';
			document.getElementById('showComment_'+vid).style.display='';
		
	}
}
function writeCommentMusic(mid,task)
{
	 
	if(task == "add" && mid!=0)
	{
	 		$('.vComment_'+mid).css( 'display', 'none' );
			document.getElementById('addComment_'+mid).style.display='';
		
	}
	else if(task == "save")
	{
	 		/*$('.vComment').css( 'display', 'none' );
			document.getElementById('commentLink').style.display='';*/
			var comment = document.getElementById('comment_'+mid).value;			
			var mid = mid;
			var oData = getDefaultActions();    
			oData['task'] = 'saveComment';
			oData['mid'] = mid;
			oData['comment'] = comment;
			jQuery.get (
			'showMusic.php', oData,
			function (s) 
			{ 
				
					$('.vComment_'+mid).css( 'display', 'none' );
					document.getElementById('commentLink_'+mid).style.display='';
					document.getElementById('showComment_'+mid).style.display='';
					$('div#divcomment_'+mid).html('<div style="border:1px solid #ccc;padding:5px;width:190px;" >'+comment+'</div>');
				
			}
		  ); 	
			
		
	}
	else if(task == "cancle")
	{
	 		$('.vComment_'+mid).css( 'display', 'none' );
			document.getElementById('commentLink_'+mid).style.display='';
			document.getElementById('showComment_'+mid).style.display='';
		
	}
}
/*function writeCommentMusic(mid,task)
{
	 
	if(task == "add" && mid!=0)
	{
	 		$('.vComment').css( 'display', 'none' );
			document.getElementById('addComment').style.display='';
		
	}
	else if(task == "save")
	{
	 		 
			var comment = document.getElementById('comment').value;			
			var mid = mid;
			var oData = getDefaultActions();    
			oData['task'] = 'saveComment';
			oData['mid'] = mid;
			oData['comment'] = comment;
			jQuery.get (
			'showMusic.php', oData,
			function (s) 
			{ 
				
					$('.vComment').css( 'display', 'none' );
					document.getElementById('commentLink').style.display='';
					document.getElementById('showComment').style.display='';
					$('div#divcomment').html('<div style="border:1px solid #ccc;padding:5px;width:225px;" >'+comment+'</div>');
				
			}
		  ); 	
			
		
	}
	else if(task == "cancle")
	{
	 		$('.vComment').css( 'display', 'none' );
			document.getElementById('commentLink').style.display='';
			document.getElementById('showComment').style.display='';
		
	}
}
*/
function myVideo(vid,profile,task,total)
{
    	var vid = vid;
		var profile = profile;
		
		if(task==0)
		{
			total = total -1;		
		}
		else
		{
			total = total +1;	
		}
		
		var oData = getDefaultActions();    
		oData['task'] = 'video';
		oData['vid'] = vid;
		oData['profile'] = profile;
		oData['total'] = total;
		
		jQuery.get (
        'showVideo.php', oData,
        function (s) 
        { 
			if(s)
		  	{
				$('div#myVideo').html(s);
				//$('div#myVideo').animate({left: -148},{animation: 'slow'},{duration: 400});
				//setTimeout( "setCloseMessage('buy_flash')", 10000 );  
			}
        }
      ); 	

}
function largeVideo(value,id) {		
					
				 
				if(id==5)
				{
					$('.videoTab').css( 'display', 'none' );
					document.getElementById('5').className='MenuTab';
					document.getElementById('6').className='';
					document.getElementById(value).style.display='';
				}
				if(id==6)
				{
					$('.videoTab').css( 'display', 'none' );
					document.getElementById('6').className='MenuTab';
					document.getElementById('5').className='';
					//$( 'div.caption_item 3' ).removeClass( 'MenuTab' )
					document.getElementById(value).style.display='';	
				}
}
function profileFavorites(value,txt) { 
		
	/*if(txt =='add')
	{*/
		var val = value;	
		var txt = txt;
		var oData = getDefaultActions();    
		oData['task'] = 'profileFavorites'; 
		oData['val'] = val;
		oData['txt'] = txt;
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		  if(s)
		  {
			
			var addfav = document.getElementById('addfav').value;
			var delfav = document.getElementById('delfav').value;
			if(txt=='add')
			{
				 
				$('div#favid').html('<a class="optionlink" onclick="profileFavorites('+val+',\'del\');" title="'+delfav+'" href="javascript:void(0);">'+delfav+'</a>'); 
				$('div#buy_profileFavorites').html(s);
				$('div#buy_profileFavorites').animate({bottom: 15},{animation: 'slow'} );
				setTimeout( "setCloseprofileFavorites('buy_profileFavorites')", 10000 );   	
			}
			else
			{
				 
				$('div#favid').html('<a class="optionlink" onclick="profileFavorites('+val+',\'add\');" title="'+addfav+'" href="javascript:void(0);">'+addfav+'</a>'); 
				
				$('div#buy_profileFavorites').html(s);
				$('div#buy_profileFavorites').animate({bottom: 15},{animation: 'slow'} );
				setTimeout( "setCloseprofileFavorites('buy_profileFavorites')", 10000 );   	
			} 
			
		  }
        }
      ); 	
	/*}
	else
	{
		var val = value;
		var txt = txt;
		var oData = getDefaultActions();    
		oData['task'] = 'profileFavorites'; 
		oData['val'] = val;
		oData['txt'] = txt;
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		  if(s)
		  {
			$('div#buy_profileFavorites').html(s);
			$('div#buy_profileFavorites').animate({bottom: 50},{animation: 'slow'} );
			setTimeout( "setCloseprofileFavorites('buy_profileFavorites')", 10000 );   
		  }
        }
      ); 	
		
	}*/
		
}
function closeprofileFavorites(task)
{   	
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  0);		
}
function setCloseprofileFavorites(task)
{
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  1000);		 
	 
}



function addFavorites(value) { 
		
		var val = value;		
		var oData = getDefaultActions();    
		oData['task'] = 'addFavorites'; 
		oData['val'] = val;
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		  if(s)
		  {
			$('div#buy_addFavorites').html(s);
			$('div#buy_addFavorites').animate({bottom: 15},{animation: 'slow'} );
			setTimeout( "setCloseaddFavorites('buy_addFavorites')", 10000 );   
		  }
        }
      ); 	
}
function closeaddFavorites(task)
{   	
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  0);		
}
function setCloseaddFavorites(task)
{
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400} ) },  1000);		 
	 
}




 function sendGreet(value) { 
	var val = value; 
	var oData = getDefaultActions();    
		oData['task'] = 'greet'; 
		oData['val'] = val;
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		  if(s)
		  {
			$('div#buy_greets').html(s);
			$('div#buy_greets').animate({bottom: 15},{animation: 'slow'},{duration: 400});
			setTimeout( "setCloseGreets('buy_greets')", 10000 );   
		  }
        }
      ); 	
}
function closeGreets(task)
{   	
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400}) },  0);		
}
function setCloseGreets(task)
{
		setTimeout(function(){ $('div#'+task).animate({bottom: -200},{animation: 'slow'},{duration: 400}) },  1000);
}

function setTooltipOverflow()
{  		
		$('.boxContent').css( 'overflow', 'visible' ); 
		$('.page_column').css( 'overflow', 'visible' ); 
		
}
function updateMessage()
{
    	 
		var oData = getDefaultActions();    
		oData['task'] = 'message'; 
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		  if(s)
		  {
			$('div#buy_message').html(s);
			$('div#buy_message').animate({bottom: 30},{animation: 'slow'},{duration: 400});
			setTimeout( "setCloseMessage('buy_message')", 10000 );   
		  }
        }
      ); 	

}
function updateFlash()
{
    	var oData = getDefaultActions();    
		oData['task'] = 'flash'; 
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
			if(s)
		  	{
				$('div#buy_flash').html(s);
				$('div#buy_flash').animate({bottom: 28},{animation: 'slow'},{duration: 400});
				setTimeout( "setCloseMessage('buy_flash')", 10000 );  
			}
        }
      ); 	

}
function updateFriends()
{
    	var oData = getDefaultActions();    
		oData['task'] = 'friends'; 
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        {
		  if(s)
		  {	
		 	$('div#buy_friends').html(s);
			$('div#buy_friends').animate({bottom: 26},{animation: 'slow'},{duration: 400});
			setTimeout( "setCloseMessage('buy_friends')", 10000 );  
		  }
        }
      ); 	

}
function updateVisit()
{
    	var oData = getDefaultActions();    
		oData['task'] = 'visit'; 
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		   if(s)
		   {	
			$('div#buy_visit').html(s);
			$('div#buy_visit').animate({bottom: 24},{animation: 'slow'},{duration: 400});
			setTimeout( "setCloseMessage('buy_visit')", 10000 ); 
		   }
        }
      ); 	

}
function updateConfirmFlash()
{
    	var oData = getDefaultActions();    
		oData['task'] = 'confirmflash'; 
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 			
		   if(s)
		   {			
			$('div#buy_confirmflash').html(s);
			$('div#buy_confirmflash').animate({bottom: 22},{animation: 'slow'},{duration: 400});
			 setTimeout( "setCloseMessage('buy_confirmflash')", 10000 );
		  }
        }
      ); 	

}
function updateOnline()
{
    	var oData = getDefaultActions();    
		oData['task'] = 'online'; 
		
		jQuery.get (
        'latestMessege.php', oData,
        function (s) 
        { 
		   if(s)
		   {
		    $('div#buy_online').html(s);
			$('div#buy_online').animate({bottom: 24},{animation: 'slow'},{duration: 400});
			setTimeout( "setCloseMessage('buy_online')", 10000 ); 
		   }
        }
      ); 	

} 
function setCloseMessage(task)
{
    	
		//$('div#buy_notice').html(s);		 
		/*$('div#'+task).animate({bottom: -100},{animation: 'slow'},{duration: 400}) ; 
		setInterval( "closeM('"+task+"')", 300 );*/
		setTimeout(function(){ $('div#'+task).animate({bottom: -150},{speed: 50000},{animation: 'slow'}) },  1000);		 
		//openM(task);
		
}
function closeMessage(task)
{
    	
		//$('div#buy_notice').html(s);		 
		/*$('div#'+task).animate({bottom: -100},{animation: 'slow'},{duration: 400}) ; 
		setInterval( "closeM('"+task+"')", 300 );*/
		setTimeout(function(){ $('div#'+task).animate({bottom: -150},{speed: 50000},{animation: 'slow'}) },  0);		 
		//openM(task);
		
}
function openM(task)
{	 
	//$('div#'+task).show();
	//  document.getElementById(task).style.display='block';
	// $('div#'+task).show();	
	 
	 setTimeout(function(){  $('div#'+task).show() },  1000);		 
	 
}
function closeM(task)
{	 
	$('div#'+task).hide();	
}
function getactive(value,sID) { 
	var val = value; 
	if(val=='male')
	{
		document.getElementById('Sex[0]_female').className='female';
		document.getElementById(sID).className='male active';	
		document.getElementById('ProfileType[0]').value='8';
	}
	else
	{
		document.getElementById('Sex[0]_male').className='male'; 
		document.getElementById(sID).className='female active';	
		document.getElementById('ProfileType[0]').value='1';
	}
	 
}
function fadeInOut(value)
{
	$(document).ready(function(){

	$(".menuLink").click(function(){
	 /* $("#videochat").slideToggle("slow");
	  $("#videochat").fadeTo("slow", 1.0);*/
	});

	});
	
}


function changeClass(myElementID) {
	 
if(document.getElementById(myElementID).className == "MenuTab") {
	document.getElementById(myElementID).className = "";
}
else {
document.getElementById(myElementID).className = "MenuTab";
}
}

function showImageFlow(value) { 	 
	if(value != "")
	{
	 		$('.imageFlow').css( 'display', 'none' );
			document.getElementById(value).style.display='';
		
	 }
	if(value=='lastvisit')
	{ 
			 
			var val = value;
			var oData = getDefaultActions();
			oData['Cmt'] = val;
		
			//this._loading (e, true);
		
			jQuery.get (
				'imageflow.php',
				oData,
				function (s) 
				{ 
					$("#visitImage").html(s);
				}
			); 
	}
	else if(value=='lastflash')
	{
			 
			var val = value;
			var oData = getDefaultActions();
			oData['Cmt'] = val;  
			jQuery.get (
				'imageflow.php',
				oData,
				function (s) 
				{					 
					$("#flashImage").html(s);
				}
			);

	}
	else if(value=='new')
	{
			var val = value; 
			var oData = getDefaultActions();
			oData['Cmt'] = val;  
			jQuery.get (
				'imageflow.php',
				oData,
				function (s) 
				{ 
					 $("#new").html(s);
				}
			);

	}
}


function addNote(value,memid,profid) { 	 
	
	if(document.getElementById('textareaid').value !='')
	{
		var val = document.getElementById('textareaid').value;
		var memid = memid;	
		var profid = profid;
		var oData = getDefaultActions(); 
		oData['memid'] = memid;
		oData['profid'] = profid;
		oData['val'] = val;
		oData['task'] = 'addnote';	
	 
    	jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	document.getElementById('textareaid').className='textareaclass';
        }
      );
	}	 
}
function delStuff(value,memid) { 
	var val = value;
	var memid = memid
	 
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'del';
	
	if(document.getElementById('id'+val))
	{
    	var loadingimg;
		loadingimg = $('div#id'+val).html(' <img src="images/loading.gif" align="absmiddle" style="margin-top:45px;margin-left:30px;"> '); 
		jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	//showLoadingImage();
			document.getElementById('id'+val).style.display='none';
			//$('div#id'+val).html('');
        }
      ); 
	}
}

function addplaceProfile(value,memid,url) { 
	var val = value;
	var memid = memid;	
	var url = url;
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'add';	
	 
	if(document.getElementById('addPlacebtn'))
	{
    	var loadingimg;
		loadingimg = $('div#addPlacebtn').html(' <img src="'+url+'images/loading.gif" align="absmiddle" style="margin-right:30px;"> ');
		
		jQuery.get (
        url + 'getgeoid.php',
        oData,
        function (s) 
        {   
			// showLoadingImage(val);
        	document.getElementById('addPlacebtn').style.display='none';				
        }
      ); 
	}
}

function addStuff(value,memid) { 
	var val = value;
	var memid = memid;	
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'add';	
	 
	if(document.getElementById('id'+val))
	{
    	var loadingimg;
		loadingimg = $('div#id'+val).html(' <img src="images/loading.gif" align="absmiddle" style="margin-top:45px;margin-left:30px;"> '); 
		jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {   
			//showLoadingImage();
        	document.getElementById('id'+val).style.display='none';	 		
			//alert(s);
			//$('div#id'+val).html('');
        }
      ); 
	}
}
function ProfdelStuff(value,memid,txt) { 
	var val = value;
	var memid = memid
	 
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'del';
	
	if(document.getElementById('id'+val))
	{
    	/*var loadingimg;
		loadingimg = $('div#id'+val).html(' <img src="images/loading.gif" align="absmiddle" style="margin-top:45px;margin-left:30px;"> '); */
		jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	  
			  //$('div#favid').html('<a class="optionlink" onclick="profileFavorites('+val+',\'del\');" title="'+delfav+'" href="javascript:void(0);">'+delfav+'</a>'); 
			  showLoadingImage(val);
			  $('div#link'+val).html('<a id="link'+val+'" style="cursor:pointer" onclick="ProfaddStuff('+val+','+memid+',\'plus\');" ><div class="clear_both"></div><div class="image" > </div></a>');
			  
			  
			 //<a  id="link'.$aPlace['pl_id'].'" onclick="ProfaddStuff('.$aPlace['pl_id'].','.$memberID.',"plus");" style="cursor:pointer"> <div class="clear_both"></div>
			 //<div class="image" > </div></a>'
			  
			// document.getElementById('id'+val).style.display='none';
			//$('div#id'+val).html('');
        }
      ); 
	}
}
function ProfaddStuff(value,memid,txt) { 
	var val = value;
	var memid = memid;	
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'add';	
	 
	if(document.getElementById('id'+val))
	{
    	/*var loadingimg;
		loadingimg = $('div#id'+val).html(' <img src="images/loading.gif" align="absmiddle" style="margin-top:45px;margin-left:30px;"> '); */
		jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {   
			  showLoadingImage(val);
        	//document.getElementById('id'+val).style.display='none';	
			 //document.getElementById(myElementID).className == "MenuTab"
			$('div#link'+val).html('<a id="link'+val+'" style="cursor:pointer" onclick="ProfdelStuff('+val+','+memid+',\'del\');" ><div class="clear_both"></div><div class="minus" > </div> </a>');
			//alert(s);
			//$('div#id'+val).html('');
        }
      ); 
	}
}

function PlacedelStuff(value,memid,txt) { 
	var val = value;
	var memid = memid
	 
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'del';
	
	if(document.getElementById('id'+val))
	{
		jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	 showLoadingImage(val);
			  $('div#link'+val).html('<a id="link'+val+'" style="cursor:pointer" onclick="ProfaddStuff('+val+','+memid+',\'plus\');" ><div class="clear_both"></div><div class="image" > </div></a>');
        }
      ); 
	}
}
function PlaceaddStuff(value,memid,txt) { 
	 
	var val = value;
	var memid = memid;	
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'add';	
	 
	if(document.getElementById('id'+val))
	{ 	 
		jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {   
			  showLoadingImage(val); 
			$('div#link'+val).html('<a id="link'+val+'" style="cursor:pointer" onclick="ProfdelStuff('+val+','+memid+',\'del\');" ><div class="clear_both"></div><div class="minus" > </div> </a>'); 
        }
      ); 
	}
}


function showLoadingImage(val) { 		
		var p1 = "loading_box"+val;
		document.getElementById("loading_box"+val).style.display='';
		document.getElementById(val).style.display='none';
		var p2 = val;
		var el = document.getElementById("loading_box"+val);	
		if (el) {        
			el.innerHTML = '<div style="height:84px;width:90px;" align="center"><img src="images/loading.gif" style="padding-top:15px;background:#fff;"></div>';
			  window.setTimeout('stopLoading(\''+p1+'\',\''+p2+'\')', 400);
		}
  }
function stopLoading(p1,p2) {  	 
		document.getElementById(p1).style.display='none';    
	 	document.getElementById(p2).style.display='';
  }


/*function showLoadingImage() { 
		document.getElementById('loading_box').style.display='';
		var el = document.getElementById("loading_box");	
		if (el) {        
			el.innerHTML = '<img src="images/loading.gif">';       
			window.setTimeout('stopLoading()', 500);
		}
  }
function stopLoading() {  
	 document.getElementById('loading_box').style.display='none';     
  }*/

function delContact(table,whomid,whoid,sqlwho,sqlwhom) { 
	
	var table = table;
	var whoid = whoid;
	var whomid = whomid;
	
	var sqlwho = sqlwho;
	var sqlwhom = sqlwhom;
	
	var oData = getDefaultActions();
    oData['table'] = table;
	oData['whoid'] = whoid;
	oData['whomid'] = whomid;
	
	oData['sqlWho'] = sqlwho;
	oData['sqlWhom'] = sqlwhom;
	
	oData['task'] = 'cotactdel';	
	 
	if(document.getElementById(whomid))
	{
    	jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	document.getElementById(whomid).style.display='none';	 		
			//alert(s);
        }
      ); 
	}
}
function addStuffProfile(value,memid) { 
	var val = value;
	var memid = memid;	 
	var oData = getDefaultActions();
    oData['val'] = val;
	oData['memid'] = memid;
	oData['task'] = 'add';	
	 
	 	jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	//document.getElementById('id'+val).style.display='none';			
			alert(s);
        }
      ); 
	 
}
function showPhoto(value) { 					
					
					document.getElementById('1').className='MenuTab';
					document.getElementById('2').className='';
					document.getElementById('3').className='';
					document.getElementById('photo').style.display='';	
					document.getElementById('video').style.display='none';	
					document.getElementById('music').style.display='none';	
}
function showVideo(value) { 					
					
					document.getElementById('2').className='MenuTab';
					document.getElementById('1').className='';
					document.getElementById('3').className='';
					document.getElementById('video').style.display='';
					document.getElementById('photo').style.display='none';
					document.getElementById('music').style.display='none';
}
function showMusic(value) { 					
					
					document.getElementById('3').className='MenuTab';
					document.getElementById('1').className='';
					document.getElementById('2').className='';
					document.getElementById('music').style.display='';
					document.getElementById('photo').style.display='none';
					document.getElementById('video').style.display='none';
}
function showDesc(value) { 	 
					document.getElementById('desc').className='MenuTab withLink';
					document.getElementById('place').className='';
					document.getElementById('descid').style.display='';	
					document.getElementById('placeid').style.display='none';	
}
function showPlace(value) { 	 
	 //alert(value)	;
	if(value != "")
	{
	  /*var divEls = document.getElementsByTagName("div");
      var i = 0;
      for(i=0;i<divEls.length;i++)
      {
       // alert(divEls[i].id);
	   if(divEls[i].id==value)
		{*/
	    	//alert(divEls[i].id);
			// alert(value);
					
			
			//document.getElementById('descid').style.display='none';
			/*document.getElementById('place').style.display='none';
			document.getElementById('echo').style.display='none';*/
			$('.dynaDiv').css( 'display', 'none' );
			document.getElementById(value).style.display='';
		/*}
		else
		{
			document.getElementById(value).className='';					
			document.getElementById(value).style.display='none';
		}*/
	  //}
	  
	}/*
	else
	{
		document.getElementById(value).className='';					
		document.getElementById(value).style.display='none';	
	} 	*/		 
}

function getGeoData(value) { 
	var val = value;
	// alert(val);
    var oData = getDefaultActions();
    oData['Cmt'] = val;

    //this._loading (e, true);

    jQuery.get (
        'getgeoid.php',
        oData,
        function (s) 
        {                	            
        	     if(s==1)
				 {
					
					
					document.form1.pl_cat_id.value=s;
					
					document.getElementById('addLabel').style.display='';
					document.getElementById('zipLabel').style.display='';
					document.getElementById('cityLabel').style.display='';
					document.getElementById('countryLabel').style.display='';					
					document.getElementById('id_address').style.display='';
					document.getElementById('id_zip').style.display='';
					document.getElementById('id_city').style.display='';
					document.getElementById('id_country').style.display='';
					//document.getElementById('id_address1').style.display='block'; 
				 }
				 else
				 {
					
					document.form1.pl_cat_id.value=s;
					document.getElementById('addLabel').style.display='none';
					document.getElementById('zipLabel').style.display='none';
					document.getElementById('cityLabel').style.display='none';
					document.getElementById('countryLabel').style.display='none';					
					document.getElementById('id_address').style.display='none';
					document.getElementById('id_zip').style.display='none';
					document.getElementById('id_city').style.display='none';
					document.getElementById('id_country').style.display='none';
					//document.getElementById('id_address1').style.display='none'; 
				 }
        }
    );

}
function getDefaultActions()
{
    return {     	 
    	};
}
