function submitFavModal(){  	
    // validate and process form here 

//loop through checked inputs
var checkedInputs = $jPriam("#favMenuForm input:checked");
var dataString ="";
                      var test = [];
                      var chkNo ="";
                      $jPriam.each(checkedInputs, function(i, val) {                      	
                      	test[i]= val.value;
                      	chkNo = parseInt(i,10);                               
                      });                      

//exit on too many checkboxes
/* 
if(chkNo>4){
	alert("You can select up to a maxium of 5 favourites!");
	return false;
 }
 */                       
//post the form
var dataString = '';
for(var i=0;i<test.length;i++) {
	dataString += '&test[' + i + ']=' + test[i];
}
if(dataString == '') dataString = '&test[0]=null';
//var dataString = test;
$jPriam.ajax({  
	type: "POST",  
	url: "cmsFavouritesManage.php",
	beforeSend: function(){
		document.getElementById('TB_window').style.zIndex = 99;		
		$jPriam("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$jPriam('#TB_load').show();//show loader
	},
	data: dataString,
	success: function(data){
		
		//refresh parent page to show updated menu		
		parent.location.href = parent.location.href ;
		window.location.reload();
		//close modal window                        
		tb_remove();
	}
});  	                        
	
	
  };  

