// JavaScript Document
function changeSelect(sl)
{
	new Request.HTML({
	url: '/ajaxoption',
	method: 'post',
	data:{'category_id':sl},
	update: 'sltExercices', 
	evalScripts: true, /* this is the default */
	onComplete: function(rs){
		
	}
	}).send();
	
}; 
function fncFilterByCat(cat_id){
    if($('streamVal').value!=''){	
        $('hid_sub_cat').value=$('sub_category_val_'+cat_id).value;  
        return true;
    }	
    return false;
} 


window.addEvent("load", function() {
	var link = $("setHomePageLink");
	if (!link) {
		return;
	}
	
	if (Browser.Engine.presto) {
		link.rel = "sidebar";
	}
	var ua=navigator.userAgent.toLowerCase();
	var isKonq=(ua.indexOf('konqueror')!=-1);
    var isSafari=(ua.indexOf('webkit')!=-1);
    var isMac=(ua.indexOf('mac')!=-1);
    var buttonStr=isMac?'Command/Cmd':'CTRL';

	
	link.addEvent("click", function(e) {
		new Event(e).stop();
		var homepage = link.href;
		if (document.all) {
			document.body.style.behavior='url(#default#homepage)';
			document.body.setHomePage(homepage); 
		} else if (isSafari){
			alert('You need to press '+buttonStr+' + D to bookmark our site.');
		} else if (isKonq) {
		  alert('You need to press CTRL + B to bookmark our site.');
		}
		else {
			window.sidebar.addPanel("Multimediacms Libcast", homepage, "");	
		}
	});
});
