function nu_e_nud(){
	var x=document.getElementById('comment');
	if (x.value == 0){
		return false;

	}
	else {
				document.commform.submit();
		
		}
}
var arenaP = null;
var arenaPop = null;

function play_ext() {
	var url = "/playext.php?type=ext"
open_pop(url,4);

}


var to_be_played = '';

function handleResponse(msg) {
var to_be_played = msg;
playinindex(to_be_played);

}


function changeOpac(opacity, id) {
var object = document.getElementById(id).style;object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 
function opacity(id, opacStart, opacEnd, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}


function descr_alerte(n, nr) {
	for(i=0;i<nr;i++){
		var	mcm = document.getElementById('img_sign'+i+'').src;	
		var e_goo=mcm.indexOf('sign_minus');
		if ((i == n) && (e_goo==-1) ) {
			document.getElementById('dalert'+i+'').style.display="block";	
			document.getElementById('img_sign'+i+'').src="images/sign_minus.gif";	
		}
		else {
			document.getElementById('dalert'+i+'').style.display="none";
			document.getElementById('img_sign'+i+'').src="images/sign_plus.gif";		
		}	
	}	
}

function principal(url) {
	if(!opener || opener.closed) {
		opener = window.open( url, "opener", "toolbar=1,scrollbars=1,location=1,statusbar=1, menubar=1,resizable=1,width=900px, height=700px" );
		opener.focus();
	} 
	else {opener.location.href = url;
		opener.focus();
	}
}

function principal_pr(url) {
	if(!parent.opener || parent.opener.closed) {
		parent.opener = window.open( url, "opener", "toolbar=1,scrollbars=1,location=1,statusbar=1, menubar=1,resizable=1,width=900px, height=700px" );
		parent.opener.focus();
	} 
	else {parent.opener.location.href = url;
		parent.opener.focus();
	}
}

var recompop_w = null;
var programpop_w = null;
var chatpop_w = null;
var printpop_w = null;

function open_pop(url,type) {
	if(type==1) {
		lungim = 437;
		inalt = 350;
		numepop = 'recompop';
		arenaP = recompop_w;
	}
	else if (type==2) {
		lungim = 975;
		inalt = 700;
		numepop = 'programpop';
		arenaP = programpop_w;
}
	else if (type==3) {
		lungim = 925;
		inalt = 640;
		numepop = 'chatpop';
		arenaP = chatpop_w;
	}
	else if (type==4) {
		lungim = 570;
		inalt = 610;
		numepop = 'arenaP';
		arenaP = arenaPop;
	}
	else {
		lungim = 700;
		inalt = 450;
		numepop = 'printpop';
		arenaP = printpop_w;
	}
/* centru*/
	if( !arenaP || arenaP.closed ) {
		if(numepop == 'printpop') {
			pnt_n = 1;			
		}
		else {
			pnt_n = 0;
		}
		
		arenaP = window.open( url, ''+numepop+'', 'toolbar=0,scrollbars='+pnt_n+',location=0,statusbar=1,menubar=0,resizable=0,width='+lungim+',height='+inalt+',left = 40,top = 62' );
		arenaP.focus();
	} else arenaP.focus();
	
/* miscarea inversa */
	if(type==1) {
		recompop_w = arenaP;
	}
	else if (type==2) {
		programpop_w = arenaP;
	}
	else if (type==3) {
		chatpop_w = arenaP;
	}
	else if (type==4) {
		arenaPop = arenaP;
	}
	else {
		printpop_w = arenaP;
	}
	
	
}

function close_popa() {
	if(self.arenaPop) {
		arenaPop.close();
		
	}
	
}


function getIEv()
{
  var bvexp = -1; 
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var uagent = navigator.userAgent;
    var regceva  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (regceva.exec(uagent) != null)
      bvexp = parseFloat( RegExp.$1 );
  }
  return bvexp;
}


function mesajbrowser() {
  var msg_brw = "Va recomandam sa treceti pe IE 6 sau 7";
  var ver = getIEv();

  if ( ver > -1 )  {
    if ( ver >= 6.0 ) 
      msg_brw = "Aveti IE 6 sau 7"
    else
      msg_brw = "Nu mai folositi IE mai mic de 6";
  }
}
 
function submitform() {
  document.login.submit();
}

function submitpoll() {
	ales ='nimickq';
	for (i=0;i<document.pollform.vote.length;i++) {
		if (document.pollform.vote[i].checked) {
			ales = document.pollform.submit();

		}
	}

}

function submitsignup() {
  document.signup.submit();
}

function submitsave() {
  document.save_playl.submit();
}

function submitisp() {
  document.ispchange.submit();
}

function submitalert() {
  document.alerta.submit();
}
function submitz() {
  document.z.submit();
}

function submiti(n) {
  document.n.submit();
}


function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function teaser_ex_play() {	
	if( arenaP && !arenaP.closed ){ 
		document.getElementById('cont_video').innerHTML=
		' ai playerul xtern deschis, uita-te pe el ' ;
	}

}

function prep_do_it_now(typeplay){
	callToServer('ses','watch',''+typeplay+'');

}


function do_it_now(typeplay){
	var ver = getIEv();
	if ( ver < 6.0) {
		return callToServer('stream','type',typeplay);
	} 
	else {
		playinindex('a');	
	}
}

function teas_play_ext() {
	document.getElementById('mediaplayer_0').innerHTML=
	'<div id="teas_pext" onclick="play_ext();return false" title="Deschide player extern" onmouseout="MM_swapImgRestore()" '
	+ ' onmouseover="MM_swapImage(\'teas_pexx\',\'\',\'images/teas_pext_2_arenatv.jpg\',1)"><img src="images/teas_pext_arenatv.jpg" '
	+ ' alt="Deschide player extern" name="teas_pexx" width="212" height="104" border="0" id="teas_pexx" \/><\/div>';
	document.getElementById('controllere').innerHTML=
	' <div class="negrudiv"><\/div>';
	document.getElementById('no_under').innerHTML=
	'<div id="sub_teas_pext"><a href="#" onclick="prep_do_it_now(\'index\');return false;">Vizioneaza in pagina<\/a><\/div>';
	

}


function titlessifr() {
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:".titlu_sifr", sFlashSrc:"bailey.swf", sColor:"#FFFFFF", nPaddingTop:1, nPaddingBottom:1, sBgColor: "#EAF1FF", sWmode: "transparent"}));
	}
}

function titlessifr_pr() {
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:".titlu_sifr_t", sFlashSrc:"bailey.swf", sColor:"#FFFFFF", nPaddingTop:1, nPaddingBottom:1, sBgColor: "#EAF1FF", sWmode: "transparent"}));
	}
}

function titlestsifr(){
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:".titl_st_nfe", sFlashSrc:"bailey.swf", sColor:"#FFFFFF", nPaddingTop:1, nPaddingBottom:1, sBgColor: "#2D2E26"}));
	}
}



function ResetSelect(mySelect){
	for (i = mySelect.options.length; i >= 0 ; i--) 
		mySelect.options[i] = null; 
}


function handleRS(msg) {
	var opt_array=msg.split("~");
	var select2IDs = new Array('');
	ResetSelect(document.getElementById('ziu'));
	if(document.getElementById('ziu').disabled) return;
	for(i=0;i<opt_array.length;i++){
		select2IDs[i]=opt_array[i].split("*");
		document.getElementById('ziu').options[i] = new Option(select2IDs[i][0], select2IDs[i][1]);
	}
}

function change_zi(ziu){
zi_val = document.getElementById(ziu).value;
window.location = 'program.php?tm='+zi_val+'';
}

macarenezz = '';

function view_detpl(nomb){
	window.clearInterval(macarenezz);
	var ce_eraa = document.getElementById('locdetalii_pl').innerHTML;
	var e_acc=ce_eraa.indexOf('Ultima mod');
	if (e_acc !== -1) {
		document.getElementById('locdetalii_pl').setAttribute('descript', ''+ce_eraa+'');
	}	
	var sursa_str = document.getElementById('hidden_treas').value;
	var clipurii=sursa_str.split("|");
	var un_clipp = clipurii[nomb].split("~");
	var titll = un_clipp[0];
	var dataxx = un_clipp[1];
	var vizitzz = un_clipp[2];
	var ratingii = un_clipp[3];
	
	if (ratingii == 10){
		messagg = 'Recomandare ARENA';
	}
	else {
		messagg = '';
	}

	html_pld = '<span>'+titll+'. Adaugat la: '+dataxx+' <br \/>Vizite: '+vizitzz+' -- '+messagg+'  <\/span>';
	document.getElementById('locdetalii_pl').innerHTML = html_pld;

	macarenezz = window.setInterval(hide_depl, 4000);
		

}

function hide_depl(){
	window.clearInterval(macarenezz);
	lalamac = document.getElementById('locdetalii_pl');
	if(lalamac !== null ) {
		macarenn = lalamac.getAttribute('descript');
		if (macarenn !== null) {
			var e_acc2=macarenn.indexOf('Ultima mod');
			if (e_acc2 !== -1) {
				document.getElementById('locdetalii_pl').innerHTML = macarenn;	
			}
	
		}
	}
}
function replac_play(){
	document.getElementById('btn_replac').src="images/control_play_arenatv.jpg";

}
function back_play(){
	document.getElementById('btn_replac').src="images/control_play2_arenatv.jpg";

}

function replac_stop(){
	document.getElementById('btn_replac2').src="images/control_stop_arenatv.jpg";

}
function back_stop(){
	document.getElementById('btn_replac2').src="images/control_stop2_arenatv.jpg";

}

