// JavaScript Document
/************************************************
*		Deschide o fereastra de dimensiuni     	*
*		width, height in centrul ecranului	   	*
*************************************************/
function open_url_center(url,width,height)
{
	xpoz=Math.round((screen.width-width)/2);
	ypoz=Math.round((screen.height-height)/2);
	if (xpoz<0) xpoz=10;
	if (ypoz<0) ypoz=10;
	newWindow=window.open (url ,'pozaWindow','toolbar=no,scrollbars=yes ,width='+width+',height='+height+', left='+xpoz+', top='+ypoz);
	newWindow.focus();
}	

function change_clapeta_relationate(tip,id,hide_rel){
	var url="/?section=relationate_stiri&screen=ajax&ajax=1&tip="+tip+'&hide_rel='+hide_rel+'&id='+id;
	var ajax= new Ajax.Updater("relationate_stiri",url,{method:"get"});
}

function change_clapeta_topuri(tip){
	var url="/?section=top_stiri&screen=ajax&ajax=1&tip="+tip;
	var ajax= new Ajax.Updater("top_stiri",url,{method:"get"});
}		

function change_clapeta_info(tip){
	var url="/?section=info_capital&screen=ajax&ajax=1&tip="+tip;
	var ajax= new Ajax.Updater("info_capital",url,{method:"get"});
}

function change_clapeta_ecommerce(tip,produs_id){
	var url="/?section=ecommerce&screen=ajax&ajax=1&tip="+tip+"&produs_id="+produs_id;
	var ajax= new Ajax.Updater("ecommerce_tabs",url,{method:"get"});
}

var id_img=1;
function change_pic(a){
	id_img++;
	id_img=id_img  % 3 ;
	id_img++;	
	$('capital_img2').src='/plugins/stocks2/stocks/engine/panou.indpreview.chart.php?ind='+id_img;//1

}

var gizmo; 
function stopClock(){
  clearTimeout(gizmo);
}
 
function startClock(){
  var nd = new Date();
  var h, m;
  var s;
  var time = " ";
  h = nd.getHours();
  m = nd.getMinutes();
  s = nd.getSeconds();
  if (h <= 9) h = "0" + h;
  if (m <= 9) m = "0" + m;
  time += h + ":" + m;
  $('div_clock').innerHTML=time;
  gizmo = setTimeout("startClock()", 1000);
}


function	chgind(idindice){
	if(document.getElementById('chart')) {
		document.getElementById('chart').src='panou.indpreview.chart.php?ind=' + idindice;
	}
	if(document.getElementById('chartlink')) {
		document.getElementById('chartlink').href='../indice_detalii.php?idindice=' + idindice;
	}
}

function show_hide_banner(id, flag)
{
if (flag==1)
document.getElementById(id).style.display='block';
else
document.getElementById(id).style.display='none';
}

function resize_banner(id, height)
{
          document.getElementById(id).style.height=height+'px';
}

function overflow_div(id, flag)
{
	if (flag==1)
		document.getElementById(id).style.overflow='hidden';
	else if (flag==0)
		document.getElementById(id).style.overflow='visible';	   
}

