// JavaScript Document
	$(document).ready(function(){
			
			$('#a1').click(function()
			{
				$('#a1-1').slideToggle('slow');
			});
			$('#a2').click(function()
			{
				$('#a2-2').slideToggle('slow');
			});
			$('#a3').click(function()
			{
				$('#a3-3').slideToggle('slow');
			});			
			
			//Call All Divs
			/*
				$('#a1-1').slideToggle('slow');
				$('#a2-2').slideToggle('slow');
				$('#a3-3').slideToggle('slow');		
			*/
		
		/*
		$('#Dialog').dialog({autoOpen : false , modal : true});
		$('#Dialog').dialog('option', 'hide', 'slide');
		$('#Dialog').dialog('option', 'show', 'slide');
		$('#Dialog').dialog('option','width','550px');
		$('#Dialog').dialog('option','hight','550px');		
		*/
		
		//Agentsearch.php
		$('#a_name').keyup(function()
		{
			var pos = $('#a_name').offset();
			$('#agent').css({left : (pos.left) , top : (pos.top + 20)});
			$('#LayerBody').css({position:'absolute', overflow:'scroll'});
			var name = $.trim($('#a_name').val());
			if(name != "")
			{
				$.get('../PropertyAdmin/agentsearch.php', {AgentName : name} , function(data)
				{
					$('#agent').html('');
					$('#agent').html(data);
	
			   });
			}
			else
			{
				$('#agent').html('');
			}
		});

		
		$('#dialog_link, ul#icons li').hover(
			function() { $(this).addClass('ui-state-hover'); }, 
			function() { $(this).removeClass('ui-state-hover'); }
		);		
		
		
		$('#country').change(function()
		{
			cid = document.getElementById("country").value;
			if(cid > 0)
			{
				$('#cityDiv').html('<img src="../images/snake_transparent.gif" border="0" />');
				$.get('../PropertyAdmin/getcity.php', {countryID : cid} , function(data)
				{
					$('#cityDiv').html('');
					$('#cityDiv').html(data);
				});
			}
			
		});
		
		/*
		$("#txt_fromdate").datepicker();
		$("#txt_fromdate").change(function() { $('#txt_fromdate').datepicker('option', {dateFormat: 'yy-mm-dd'}); });

		$("#txt_todate").datepicker();
		$("#txt_todate").change(function() { $('#txt_todate').datepicker('option', {dateFormat: 'yy-mm-dd'}); });
		*/

		$('#save').hover(
			function() { $(this).addClass('ui-state-hover'); }, 
			function() { $(this).removeClass('ui-state-hover'); }
		);	

	});
	
	function FillCityArea()
	{
		cid = document.getElementById("city").value;
		$('#areaDiv').html('<img src="../images/snake_transparent.gif" border="0" />');
		$.get('../PropertyAdmin/getcityarea.php', {cityID : cid} , function(data)
		{
			$('#areaDiv').html('');
			$('#areaDiv').html(data);
		});
	}

		
	//Agent Search
	function PlaceAgent(name)
	{
		$('#a_name').val(name);
		$('#agent').html('');
		$('#agent').hide();
	}
		
	function CheckUser()
	{
		return true;
	}

	function ShowImage(path,title)
	{
		var filename = '<img src="'+path+'" width="500px" height="500px" />';
		$('#Dialog').html(filename);
		$('#Dialog').dialog('option','title',title);
		$('#Dialog').dialog('open');
	}