/*
 * SRS Dev: Rahul - 03-May-2011
 * This is a custom javascript file and will be available on all pages within the website.
 * I am going to include this in the header.php 
 *
 */



/**** Begin Star rating js ****/

	$(function(){
	 $('.auto-submit-star').rating({
	  callback: function(value, link){
	   // 'this' is the hidden form element holding the current value
	   // 'value' is the value selected
	   // 'element' points to the link element that received the click.
	  // alert("The value selected was '" + value + "'\n\nWith this callback function I can automatically submit the form with this code:\nthis.form.submit();");
	   
	   if(value != undefined)
	   {
			//alert(value);
			if(document.getElementById('star_rating_value'))
			{
				document.getElementById('star_rating_value').value = value;
			}
			
	   }
	
	   
	   // To submit the form automatically:
	   //this.form.submit();
	   
	   // To submit the form via ajax:
	   //$(this.form).ajaxSubmit();
	  }
	 });
	});
	
/**** End Star rating js ****/
