function gSearch() {
									var searchControl = new google.search.SearchControl();
									
									var drawOptions = new google.search.DrawOptions();
									drawOptions.setSearchFormRoot(document.getElementById("search"));
 
									var siteSearch = new google.search.WebSearch();
									siteSearch.setUserDefinedLabel("restaurace.net");
									siteSearch.setUserDefinedClassSuffix("siteSearch");
									siteSearch.setSiteRestriction("restaurace.net/");
									
									var searcherOptions = new google.search.SearcherOptions();
									searcherOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
 
									searchControl.addSearcher(siteSearch, searcherOptions);
									searchControl.draw(document.getElementById("searchResults"), drawOptions);
								}

function rating(num, setnum) {

	var s = num.id.replace(setnum + "_", '');
	
	for (i = 1; i <= 5; i++ ){		
		if (i <= s) {
			document.getElementById(setnum + "_" + i).className = "on";
		} else {
			document.getElementById(setnum + "_" + i).className = "";
		}
	}
	
}

function rolloff(me, setnum) {

	var current = document.getElementById(setnum + "_rating").value;
	

	for (i = 1; i <= 5; i++) {
		if (i <= current) {
			document.getElementById(setnum + "_" + i).className = "on";
		} else {
			document.getElementById(setnum + "_" + i).className = "";
		}
	}

}

function rateIt(me, setnum){

	var s = me.id.replace(setnum + "_", '');
	document.getElementById(setnum + "_rating").value = s;	
	rolloff(me, setnum);

}

function ajaxFileUpload() {
		var upload_success = false;

		jQuery("#loading")
		.ajaxStart(function(){
			jQuery(this).show();
		})
		.ajaxComplete(function(){
			jQuery(this).hide();
		});

		jQuery.ajaxFileUpload
		(
			{
				url:'/wp-upload/doajaxfileupload.php',
				secureuri:false,
				fileElementId:'uploadmefile',
				dataType: 'json',
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
						}else
						{
							var item_link = data.file + '<!-- <a href="#" onclick="return uploadedme_comment(\'' + data.file + '\')">(Insert)</a>-->';

							jQuery("#uploadedme").html( jQuery("#uploadedme").html() + "<ul><li>" + item_link + "</li></ul>");

							jQuery("#uploadmefile").val('');

							uploadedme_comment(data.path);

						}
					}
				},
				error: function (data, status, e)
				{
					alert('Error: ' + e);
				}
			}
		)

		return false;

	}

function uploadedme_comment(img) {
	jQuery("#uploadme").val( jQuery("#uploadme").val() + img + "|");
	return false;
}

/* added after the fact to upload image upon "Submit Comment" */
function upload_on_submit() {
	if ( jQuery('#uploadmefile').val() != '' ) {
		ajaxFileUpload();
		jQuery('#uploadmefile').bind("change", function(){ upload_on_submit(); });
	}
}

jQuery(document).ready(function() {
	jQuery('#uploadmefile').change(function () {
		upload_on_submit();
	});
/*
	jQuery('#submit').click(function () {
		return upload_on_submit();
	});
*/
});