 function openContact(){
 	var stringId = 'contatti'
  	window.open("/frontend.php/staticpage/showByStringId?string_id="+stringId,
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=600,height=400");
 
 }
 function openAdvancedSearch(){
	new Ajax.Updater('right_side_panel_body', '/search/index', {asynchronous:true, evalScripts:true, onComplete:function(request, json){frontend_hide('right_side_panel_loader', 'right_side_panel_body');}, onLoading:function(request, json){frontend_show('right_side_panel_loader','right_side_panel_body')}});	
 }
 
 function openInstruction(){
 	var stringId = 'istruzioni';
  	window.open("/frontend.php/staticpage/showByStringId?string_id="+stringId,
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=600,height=400");
 }
 
 function userRegistration()
 {
 	window.open("/frontend.php/frontend_user/create",
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=800,height=600");
 }
 
 function doLogin(username, password)
 {
 	var username  = document.getElementById('username').value;
 	var password  = document.getElementById('password').value;
 	//alert(username.value + ' ' + password.value);
 
	new Ajax.Updater('login', '/frontend.php/frontend_user/login', 
		{ parameters: { username: $F('username'), password: $F('password') }, 
			asynchronous:false, evalScripts:false });
	//return $('loginresponse').innerHTML;
 }
 
 function myProfile()
 {
 	window.open("/frontend.php/frontend_user/myprofile",
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=800,height=600");
 
 }

 function doSearch(s)
 {
 	var temp  = document.getElementById('query');
	s = temp.value;
	//alert(s);
	new Ajax.Updater('videolist1', '/index.php/search/search/keyword/'+s, {asynchronous:true, evalScripts:true, onComplete:function(request, json){frontend_hide('channel_loader', 'videolist1')}, onLoading:function(request, json){frontend_show('channel_loader', 'videolist1')}})
	return true;
 }
 	
 function doRetreivePassword()
 {
 	//alert(username);
 	//alert(password);
 	new Ajax.Updater('right_side_panel', '/frontend_user/recover', {asynchronous:false, evalScripts:false, method:'get'});
 }
 
 function doLogout()
 {
	//alert("logiram");
 	window.location = '/index.php/frontend_user/logout';
 }
 
function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
	return document[movieName];
	}
};

function loadFile(content_id, mediafile_id) {
	var url = '/index.php/content/show/ContentId/'+ content_id;
	if(mediafile_id != null)
		url += '/mediafile_id/' + mediafile_id;

	new Ajax.Updater('player_container', url, {asynchronous:false, evalScripts:true});	    	
};

function openAreaEditori(){
 	var stringId = 'area_editori'
  	window.open("/frontend.php/staticpage/showByStringId?string_id="+stringId,
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=600,height=400");
};

function openAreaStampa(){
 	var stringId = 'area_stampa';
  	window.open("/frontend.php/staticpage/showByStringId?string_id="+stringId,
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=600,height=400");
};





 