var is_default = false;

//clear textbox upon clicking the textbox so that the user won't have to delete the text themselves
function clearTextbox(ori_text, div_name) {
	if ($(div_name).value == ori_text) {
		$(div_name).value = "";
	}
}

//get all meal_plans
function getInitialResult_mp() {
	var tmpReq = new Ajax.Updater ( 'result', 'mp_getList.php' );
}

//submit form to search for the ads
function runRequest() {
	is_default = false;
	var tmpReq = new Ajax.Updater('result', 'mp_add_getList.php', { method:'post', onComplete:function() { $('result').show(); }, asynchronous:true, parameters: $('searchform').serialize(true)	}	);
}

function mp_pageChange(page) {
	gotoPage = 'mp_getList.php?page='+page;
	if (is_default === true) gotoPage = 'mp_getList.php?page='+ page + '&mode=default'; //untuk page yg load automatically (so that page 2 dia x screw up)
	
	$('loading').style.display='block';
	var tmpReq = new Ajax.Updater('result', gotoPage, { method:'post', onComplete:function() { var tmpReq2 = new Effect.Fade('loading'); }, asynchronous:true });
}
