jQuery(document).ready(function() {
    jQuery(".hideit").click(function() {	
		jQuery(this).fadeOut(700);
	});
});

$(function() {
$(".vote").click(function() {
var id = $(this).attr("id");
var name = $(this).attr("name");
var user = $(this).attr("rel");
var dataString = 'id='+ id +'&user='+ user;
var parent = $(this);
if(name=='add'){
$(this).fadeIn(2000).html('<img src="./templates/default/images/working.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "favorite.php?do=add",
   data: dataString,
   cache: false,
   success: function(html)
   {
    parent.html(html); 
	$.ctNotify('تم إضافة الإعلان إلى المفضلة', 'message') ;
  }  });  
} else {
$(this).fadeIn(2000).html('<img src="./templates/default/images/working.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "favorite.php?do=remove",
   data: dataString,
   cache: false,
   success: function(html)
   {
       parent.html(html);
	   $.ctNotify('تم إزالة الإعلان من المفضلة', 'error') ;
  }   
 });
}
return false;
});
});

$(function() {
$(".report").click(function() {
var id = $(this).attr("id");
var name = $(this).attr("name");
var user = $(this).attr("rel");
var dataString = 'id='+ id +'&user='+ user +'&name='+ name;
var parent = $(this);
$(this).fadeIn(2000).html('<img src="./images/working.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "report.php?do=add",
   data: dataString,
   cache: false,
   success: function(html)
   {
    parent.html(html); 
	$.ctNotify('تم استلام التبليغ', 'message') ;
  }  });  
return false;
});
});

function changePage(newLoc)
 {
   nextPage = newLoc.options[newLoc.selectedIndex].value
		
   if (nextPage != "")
   {
      document.location.href = nextPage
   }
 }
