function dosubmit(product_ids) {
    /* commented because it filtered by category_id to get product ids by ajax, now removed ajax and used product id */
	 var options = { 
       // target:        '#reply',   // target element(s) to be updated with server response 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse  // post-submit callback 
    }; 
	$('#charger-range-form').ajaxSubmit(options);
} 
 
// pre-submit callback 
function showRequest(formData, jqForm, options) { 
    // formData is an array; here we use $.param to convert it to a string to display it 
    // but the form plugin does this for you automatically when it submits the data 
    var queryString = $.param(formData); 
    //alert(queryString);
    // jqForm is a jQuery object encapsulating the form element.  To access the 
    // DOM element for the form do this: 
    //var formElement = jqForm[0]; 

    //alert('About to submit: \n\n' + queryString); 
 
    // here we could return false to prevent the form from being submitted; 
    // returning anything other than false will allow the form submit to continue 
    return true; 
} 
 
// post-submit callback 
function showResponse(unhacked_responseText, statusText)  { 
	// hack by Nev Dubash - 15/05/09 
	// use to be - function showResponse(responseText, statusText)  { 
	// hack to get the Solar charger / Mini charger working charger working
	//responseText = unhacked_responseText.replace("14", "9");
	//alert(unhacked_responseText);
	//if(responseText == "14")
	//	responseText = "9";
	getFlashMovie("energiser_carousel").sendTextToFlash(unhacked_responseText);
	getResultsLinks(unhacked_responseText);
} 

function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}
function formSend() {
	var text = document.htmlForm.sendField.value;
	getFlashMovie("energiser_carousel").sendTextToFlash(text);
}
function getTextFromFlash(str) {
	document.htmlForm.receivedField.value = str;
	return str;
}
function getResultsLinks(str){
	$("#results-links").load("results_links", { 'products[]': [ str ] });
}

