$(document).ready(function() {
	$('.viewdetails').click(function() { 
	  var detail = "#Detail" + $(this).attr("id");
	  if ($(this).attr("src") == "images/view.jpg") { 
		$(detail).html("Loading...");
		$(this).attr("src", "images/hide.jpg");
		$.post("ajax/jobdetail.php", {id: $(this).attr("id")},   
		function (data) { 
			$(this).attr("src", "images/hide.jpg");
			$(detail).html(data);
			$(detail).show();
		});
	  } else { 
            $(detail).hide();	
	    $(this).attr("src", "images/view.jpg");
 	  }
	});

	// View company profile
	$(".companyprofile").popupwindow(profiles);

});

var profiles = {
	companyprofile:
       	{
       		width: 350,
               	height: 200,
               	status:1,
               	center:1,
               	resizable:0,
               	scrollbars:0,
               	toolbar:0
  	}
};

