/*
	By ivi
	Email: ivi.viktor@gmail.com
	ICQ# 4405730
*/

function Popup(page,largeur,hauteur) 
{
	var options = "toolbar=no, menubar=no, directories=no, location=no, scrollbars=yes, status=no, resizable=yes, fullscreen=no";
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	return window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}	


function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}




function trim(sInString)
{
	sInString = sInString.replace(/ /g,'');
	return sInString.replace(/(^\s+)|(\s+$)/g, '');
} 

function loadSimpleEditor()
{
	
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,undo,redo",
		theme_advanced_buttons2 : "",
		theme_advanced_toolbar_location : "top"
		
	});
}



function showBOX(url,id)
{
	if(id == undefined || id == null)
	{
		id  =  "#mainContent";
	}
	$().ready(function() 
	{
//  				$('#ex2').jqm({ajax: 'show.html', trigger: 'a.ex2trigger'});
			$(id).jqm({ajax: url, modal:true}).jqmShow();
			
	});
}


function redirect(url)
{
	location.href =  url;
}
