// This is for rating
// vote.php is not attached.... so there may be an ajax error
//

//$(document).ready(function(){ alert(appUrl); });

function rateMe(id,rating){
	ajaxPost(id,rating);
	return false;	
}


/*
$(document).ready(function(){
	$("a.one").click(function() {
		one = this.title;
		alert($("a.one"));
		ajaxPost(one);
	});
});
*/

/*
$(document).ready(function(){$("a.two").click(function() 	{two = this.title;ajaxPost(two);});});
$(document).ready(function(){$("a.three").click(function() 	{three = this.title;ajaxPost(three);});});
$(document).ready(function(){$("a.four").click(function() 	{four = this.title;ajaxPost(four);});});
$(document).ready(function(){$("a.five").click(function() 	{five = this.title;ajaxPost(five);});});
*/

function ajaxPost(id,rate){
$.ajax({
    url: appUrl+"/app/modules/create/coursePCRating.ajx.php?id="+id+"&pcRate="+rate,
    type: "GET",
 	dataType: "html",
    complete: myAjaxDone,
 	success: function(msg){
		$("li.courseRating"+id).width(msg*1);
		$("li.ratingStar"+id).html("");
    } ,
    error: myAjaxError
  });
  return false;
}
function myAjaxDone(){
//	alert('Ajax done');
}
function myAjaxError(){
//	alert('Ajax error');
}
/*$(document).ready(function(){
	var toggleChkId;
		alert(toggleChkId);
});
*/