function tg_tray(tip,act){

	if (act==1){
		document.getElementById('tray_'+tip).style.height='480px';
	}
	else {
		document.getElementById('tray_'+tip).style.height='330px';
	}
} // end tg_tray function

function window_pop ( url, name, width, height ){

	var popup = window.open (url, name, "height=" + height + ", width=" + width + ", resizable=yes, scrollbars=yes");

	// Just in case the window already exists, so the window will appear still!
		popup.focus();

} // end window_pop function

function smiley_bbcode ( form_name, textbox_name, text ){

	if ( document.all ){
		var textbox = document.forms[form_name].elements[textbox_name];
	}
	else {
		var textbox = document.getElementById(textbox_name);
	}

	var caretPos = textbox.caretPos;

	if ( textbox.createTextRange && textbox.caretPos ){
		caretPos.text = ( caretPos.text.charAt(caretPos.text.length - 1) == '' ) ? text + ' ' : text;
	}
	else {
		textbox.value += ' ' + text + ' ';
	}

	Calcul();
	textbox.focus (caretPos);
} // end smiley_bbcode function


function storeCaret ( text ){

	if ( text.createTextRange ) {
		text.caretPos = document.selection.createRange().duplicate();
	}
} // end storeCaret function

// Functie pentru fereastra de livescore, deschide la meciul curent
function livescore(){
	window.open("ls/ls_live.php","","width=800, height=600");
} // end livescore function

// Functie pentru fereastra de livescore; o deschide cu clasamentul la vedere
function clasament_popup(){
	window.open("ls/meciuri.php?section=1","","width=800, height=600");
} // end clasament_popup function

function program_popup(){
	window.open("ls/meciuri.php?section=2","","width=800, height=600");
	//window_pop("ls/meciuri.php?section=2","", 780, 600);
} // end program_popup function

function arhiva_popup() {
	window.open("ls/meciuri.php","","width=800, height=600");
	//window_pop("ls/meciuri.php?section=2","", 780, 600);
}

