/** 
	@desc This function cares for updating the category box (by the help of AJAX)
	@param startDate 
	@param endDate
	
	$Log: neuemissionen.js,v $
	Revision 1.3  2010/11/24 07:52:59  cvsosir
	*** empty log message ***
	
	Revision 1.2  2009/01/12 10:01:22  cvsosir
	Fixed the Neuemissionen back error
	Fogbugz 406
	
**/

var storedNumOfDays = 0;

function neuEmiUpdateCatBox(startDate,endDate)
{
	gl.log('== neuEmiUpdateCatBox(' + startDate+ ',' + endDate +') ==','i');
	var numDays=endDate-startDate;
	//var url='!NeuEmiCatBoxParser';
	var url='!ProcessPage';
	gl.log('days:' + numDays);
	
 	filterValue='0';
	try {
		if($('SWXListed').checked==true) filterValue='1';
	} catch (e) {}
	
	var params= 'sessionId='+ GLOBALSESSIONID +'&sDays='+numDays + '&sSWXListedOnly=' + filterValue + '&CallType=NeuEmiCatBox';
	var contentId='categoryBox';

	var filter=startDate + ',' + endDate;
	updateStorage('TimeSpan',filter);
	storedNumOfDays = numDays;
	
	//updating the Kategorie box
	var ajaxHelper=new AjaxHelper();
	ajaxHelper.publicSend(url,params,contentId);
	
	gl.log('== THE END neuEmiUpdateCatBox(' + startDate+ ',' + endDate +') ==','i');
}

function neuEmiUpdateSWXFilter() {

 	try {
	 	var swxlisted=$('SWXListed').checked;
	
	 	filterKey='SWXListed';
	 	filterValue='0';
	 	
	 	if(swxlisted==true) {
	 		filterValue='1';
	 	}
 		updateStorage(filterKey,filterValue);
		
 	} catch (e) {
 		gl.log(e);
 	}

	var numDays = storedNumOfDays;
	var url='!ProcessPage';
	var params= 'sessionId='+ GLOBALSESSIONID + '&sSWXListedOnly=' + filterValue + '&CallType=NeuEmiCatBox&sDays='+numDays;
	var contentId='categoryBox';
	
    //updating the Kategorie box
	var ajaxHelper=new AjaxHelper();
	ajaxHelper.publicSend(url,params,contentId);
	
}

/** This function updates the kursliste with the new filter
@param category A valid category like RevCon, PlainOs,...
@Remark The time span to retreive the data for is already set within the storage by the timeSpanbox 
**/
function neuEmiUpdateTableBox(category)
{
	//concating the filter to rhe right format
	var filter='PageName=NeuEmissionen°Categories='+ category;
	//false cause the history is already handled
	GetKursliste(filter);
}
