// JavaScript Document
function delRecord(page,uid){
	
//	alert("page is "+page+"  uid"+uid);
	var answer = confirm("Are you sure to delete?");
	aurl=page+"?action=delete&id="+uid;
      if(answer){
        if(navigator.appName == "Microsoft Internet Explorer"){	
            SideBar_RedirectUrl = aurl;
			setTimeout( "window.location.href = SideBar_RedirectUrl", 0 );
        }else{
            window.location = aurl;
        }
     }
}

//var baseurl = "ajax/";


function calculateAdsPrice(id,type)
{
	$.post(baseurl+'ajax_calculateAdsPrice.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#'+type).html(data);
				
			   }
			
          });
	
}

function getAdvertisementWeek(id,type)
{
	$.post(baseurl+'ajax_advertisementWeek.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
				  $('#'+type).html(data);
				  
				  var splitResult = id.split("_");
				
				  if(splitResult[1]==1)
					  $('#imageSize').html("Appropriate image size for Top Panel is width=430 pixel and height=54 pixel");
				  else if(splitResult[1]==2)
					  $('#imageSize').html("Appropriate image size for Bottom Panel is width=186 pixel and height=96 pixel");
				  else if(splitResult[1]==3)
					  $('#imageSize').html("Appropriate image size for Side Panel is width=278 pixel and height=54 pixel");
				  else
				  	  $('#imageSize').html("");

				
			   }
			
          });
	
}

function getAdvertisementSlot(id,type)
{
	$.post(baseurl+'ajax_advertisementSlot.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
				  $('#'+type).html(data);
				
			   }
			
          });
	
}


function getModelImage(id,type)
{

	$('#'+type).html('<div style="float:left; text-align:center; width:280px; padding-top:150px;"><img src="'+path+'images/loading.gif" /></div>');
	$.post(baseurl+'getModelImage.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#'+type).html(data);
		
			   }
			
          });
	
}

function getCategoryBreadCum(id,type)
{

	$.post(baseurl+'getCategoryBreadCum.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#'+type).html(data);
		
			   }
			
          });
	
}

function showSubCategory(id,type)
{

	//$('#disp').html('<div align="center"><img src="images/loader.gif" /><div>');
	$.post(baseurl+'showSubCategory.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
				  $('#'+type).html(data);
				  
				  $('#disp').html('');
				
			   }
			
          });	
}

function makeLess(id,type)
{

	//$('#disp').html('<div align="center"><img src="images/loader.gif" /><div>');
	$.post(baseurl+'showLessText.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#'+type).html(data);
				
			   }
			
          });
	
}

function readMore(id,type)
{

	//$('#disp').html('<div align="center"><img src="images/loader.gif" /><div>');
	$.post(baseurl+'showFullText.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#'+type).html(data);
				
			   }
			
          });
	
}


/*function showCity(id,type)
{

	$('#disp').html('<div align="center"><img src="images/loader.gif" /><div>');
	$.post(baseurl+'showCity.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#'+type).html(data);
				
			   }
			
          });
	
}
*/
function showCityForClassified(id,type)
{
	$.post(baseurl+'showCityForClassified.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
				  $('#'+type).html(data);
				
			   }
			
          });
	
}

function showSubCategoryForClassified(id,type)
{
	$.post(baseurl+'showSubCategoryForClassified.php?id='+id+'&type='+type, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
				  $('#'+type).html(data);
				
			   }
			
          });
	
}

function searchKeywordChangeStatus(id,status)
{

	$('#disp').html('<div style="padding-left:40px; padding-top:20px; padding-bottom:20px; width:500px;" align="center"><img src="images/loader.gif" width="16" height="16" /><div>');
	$.post(baseurl+'searchKeywordChangeStatus.php?id='+id+'&status='+status, {ID: id} , function(data)

		{		
			   if (data != '' || data != undefined || data != null) 
			   {	
			   
			  
				  $('#div_status_'+id).html(data);
				
			   }
			
          });
	
}




