/* ************************************************************************** */
/* 	
	Author: Tomek Drazek
	e-mail: tomek@acchsh.com
*/
/* *** Browser detection and setup ****************************************** */

function setToggle(id) {
    $(id).onclick=function() {
        if (this.className=='ToggleOn') {
            this.className='ToggleOff';
            $(this.id+"_content").style.display='none';
        }
        else {
            this.className='ToggleOn';
            $(this.id+"_content").style.display='block';
        }
    }
}

function showProgress(key) {
	/*new Ajax.PeriodicalUpdater('progress_win',
		'up.php?key='+key,{method: 'get', frequency: 1});*/
	$('progress').show();
	new Effect.Appear('progress_popup', { duration: 0.5 }); 
}
function progress(url,key) {
	/*new Ajax.PeriodicalUpdater('progress_win',
		'up.php?key='+key,{method: 'get', frequency: 1});*/
	showProgress();
	req=new Ajax.Request(url,{
		method: 'get',
		onComplete: function(res) {
			window.location=res.responseText;
		},
		onFailure: function(res) {
			alert("Operation failed");
			window.location=url_back;
		}
	})
	
}