var myI;

this.tooltip = function(){	
	xOffset = 10;
	yOffset = 20;				
	$("a.tooltip").hover(function(e){
		if(	this.rel != ''){ this.t = $('#'+this.rel).html(); } else { this.t = this.title; }
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip").css("top",(e.pageY - xOffset+25) + "px");
		$("#tooltip").css("left",(e.pageX + yOffset+10) + "px");
		$("#tooltip").fadeIn('fast');
    },
	function(){
		//this.title = this.t;
		$("#tooltip").html('');
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip").css("top",(e.pageY - xOffset) + "px");
		$("#tooltip").css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){
tooltip();
});

function getFlexApp(appName){
  if (navigator.appName.indexOf ("Microsoft") !=-1){
    return window[appName];
  } else {
    return document[appName];
  }
}

function setCookie(xObj,xVal){
var options = { path: '/', expires: 10 };
$.cookie(xObj, xVal, options);
}
function getCookie(xObj){
var xVal = $.cookie(xObj);	
$('#'+xObj).val(xVal);
}


function checkLogin(){
var frx = document.frmLogin;	
if(frx.email_login.value.length < 3 || frx.email_login.value.indexOf('@') < 1 ||  frx.email_login.value.indexOf('.') < 1){ frx.email_login.focus(); return false; }
if(frx.parola_login.value.length < 3 ){ frx.parola_login.focus(); return false; }
$.post('scripts/toolbar_login_client.php',{xU:frx.email_login.value,xP:frx.parola_login.value},function(data){
eval(data);																						
});
}

function isNumberKey(evt){
var charCode = ((evt.which) ? evt.which : event.keyCode);
if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 32 || charCode != 45)) { return false; } else { return true; }
}

function go2URL(theURL){
try{clearInterval(myI);}catch(err){}
window.location.href=theURL;
}

function reloadPage(){
try{clearInterval(myI);}catch(err){}
window.location.reload();
}

function setMCHeight(){
  var fMC=document.getElementById("ModulClient");
  if (document.getElementById){
      if (fMC) {
          if (fMC.contentDocument && fMC.contentDocument.body.offsetHeight)
              fMC.height = fMC.contentDocument.body.offsetHeight+30;
          else if(fMC.Document && fMC.Document.body.scrollHeight)
              fMC.height = fMC.Document.body.scrollHeight+30;
      }
  }
  window.scroll(0,0);
}

function setFH(xDiv){
  var fMC=document.getElementById(xDiv);
  if (document.getElementById){
      if (fMC) {
          if (fMC.contentDocument && fMC.contentDocument.body.offsetHeight)
              fMC.height = fMC.contentDocument.body.offsetHeight+30;
          else if(fMC.Document && fMC.Document.body.scrollHeight)
              fMC.height = fMC.Document.body.scrollHeight+30;
      }
  }
  window.scroll(0,0);
}

function ppRadioOnline(){
  var xW = 990;
  var xH = 550;
  var extra = 'resizable=0,scrollbars=0,status=0,toolbar=0';
  var xL = (screen.width-xW)/2;
  var xT = (screen.height-xH)/2;
  xL = (xL < 0 ? 0 : xL);
  xT = (xT < 0 ? 0 : xT);
  var settings = 'height=' + xH + ',';
  settings += 'width=' + xW + ',';
  settings += 'top=' + xT + ',';
  settings += 'left=' + xL + ',';
  settings += extra;
  win = window.open('radio-online.php','Radio Online - Ghidul Aradean',settings);
  win.window.focus();	
}

