/*
ID default into parent page to show boolean representation of filters
Need to mount table, to show parameters criterias
*/
id_table = "table_param";

/* On Load Page(index) run this function */
function OnLoadPage(node, keyword)
{
	Show_oBL();
	if(modify_search == 0) LoadCriteria(); // Load default criterias
	ShowDiv("and_or"); // Show OR AND Radio Options
	dfs.SetAny("and_or","OR"); //Input button
	try
	{
		if(!news_node_default) node_default = 'publication';
		else node_default = news_node_default;
	}
	catch(e) { node_default = 'publication'; }

	// When date range ...
	var _dt_range = dfs.Get_cb('cb_DateRange');
	if( _dt_range[0] == 'other') { ShowDiv('fields_calendar'); }

	/* Now, Load Iframe Page */
	// MZ on load, src var is object, why???
	if(!node || typeof node == "object")
	{
		/* 
		if exist value into HIDDEN 'last_iframe', load this it, when return page
		by back button (in IE)
		*/
		if(dfs.Get('last_iframe') != "") node = dfs.Get('last_iframe');
		else node=node_default; // Default Page
	}
	// Set the last iframe Loaded, Why?, need by IE browser when click back button
	dfs.Set('last_iframe', node);

	// Prepare to load iframe
	var lnk = "search_iframe.php?type="+dfs.Get("type")+"&bd=" + node;	
	if(keyword) lnk = lnk + "&keyword=" + escape(keyword);
	document.getElementById('search_iframe').src = lnk + '&mt='+microtime();
	is_loaded = true;
	ShowSelectedCriteria();
}

/*
On Submit in Search 
*/
function OnSubmitSearch()
{
	OnSubmitSearchAll();
}


function microtime (get_as_float) {
    // http://kevin.vanzonneveld.net
    // +   original by: Paulo Freitas
    // *     example 1: timeStamp = microtime(true);
    // *     results 1: timeStamp > 1000000000 && timeStamp < 2000000000

    var now = new Date().getTime() / 1000;
    var s = parseInt(now, 10);

    return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
}

