/*																																*/
/*	<scripts.js>		(31/03/2003)		Le funzioni JavaScript																*/
/*																																*/


 w_priv = new Array(10);
 xp = window.screen.width/2-110;
 yp = window.screen.height/2-150;
 
 Xp = window.screen.width/2-170;
 Yp = window.screen.height/2-150;

 var w_priv = new Array(10);			/*	L'array dei puntatori delle finestre di Chat privata (fino a 10)	*/
 var win = new Array(20);				/*	L'array dei puntatori delle altre finestre della Chat (fino a 20)	*/
 var w_name = new Array( "help",
						 "smiles",
						 "pref",
						 "admin",
						 "newroom",
						 "invroom",
						 "invpvt",
						 "notice",
						 "ulist",
						 "register",
						 "mlist");
 
function Win_Prv(sid,uid,sname,rname,op)
{
	if(typeof(w_priv[rname]) == "undefined" || w_priv[rname].closed == true)
	{
		xp = window.screen.width/2-250;
		yp = window.screen.height/2-60;
		w_priv[rname] = window.open("http://www.investireoggi.it/forum/messenger/main.php?mod=check_pvtchat&s_id="+sid+"&c_user="+sname+"&rcpt_id="+uid+"&rcpt_name="+rname+"&op="+op,'','resizable=1,scrollbars=0,left='+xp+',top='+yp+',width=500,height=120');
	}
	else
	{
		w_priv[rname].focus();
	}

	if(typeof(parent.win['invpvt']) != "undefined" && parent.win['invpvt'].closed != true)
		parent.win['invpvt'].close();
}

 function invite_chat_priv(uid)
 {
	xp = window.screen.width/2-110;
	yp = window.screen.height/2-150;

	if(typeof(inv_chat) == "undefined" || inv_chat.closed == true)
		inv_chat = window.open('http://www.investireoggi.it/forum/messenger/main.php?mod=inv_pvtchat&s_id='+uid,'','resizable=0,scrollbars=1,left='+xp+',top='+yp+',width=220,height=300');
	else
		inv_chat.focus();
 }

function view_Date()		//	Visualizza data e ora
{
 var days = new Array('Domenica', 'Lunedė', 'Martedė', 'Mercoledė', 'Giovedė', 'Venerdė', 'Sabato');
 var months = new Array('Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre');
 var dateObj = new Date();
 var hours = ''; minutes = '';
 var wday = days[dateObj.getDay()];
 var lmonth = months[dateObj.getMonth()];
 var date = dateObj.getDate();
 var year = dateObj.getFullYear();
 if(dateObj.getHours() < 10)
  hours += '0';
 hours += dateObj.getHours();
 if(dateObj.getMinutes() < 10)
  minutes += '0';
 minutes += dateObj.getMinutes();
 document.write(wday + ', ' + date + ' ' + lmonth + ' ' + year + ' ' + 'ore' + ' ' + hours + ':' + minutes);
}

function set_home()			// Setta la home di default
{
 if(document.all)
 {
  document.body.style.behavior = 'url(#default#homepage)';
  document.body.setHomePage('http://www.investireoggi.it');
 }
}

 function send_page(url)
 {
  xp = window.screen.width/2-(400/2);
  yp = window.screen.height/2-(200/2);
  window.open(url,'','resizable=0,scrollbars=0,left='+xp+',top='+yp+',width='+400+',height='+200);
 }
 
 function view_graphic(tid)
 {
  window.open('../../view_graphic.php?TID='+tid+'&PER=66&MAV1=0&MAV2=0&BB=0&GAP=0&RSI=0&MACD=0&STOC=0&SZ=1<YPE=2','','resizable=0,scrollbars=0,left='+(window.screen.width/2-390)+',top='+(window.screen.height/2-225)+',width='+775+',height='+450);
 }

 function NewWin(url,ww,hh)
 {
  xp = window.screen.width/2-(ww/2);
  yp = window.screen.height/2-(hh/2);
  window.open(url,'','resizable=0,scrollbars=1,left='+xp+',top='+yp+',width='+ww+',height='+hh);
 }

 function view_guida(url)
 {
  xp = window.screen.width/2-(380/2);
  yp = window.screen.height/2-(450/2);
  window.open(url,'','resizable=0,scrollbars=1,left='+xp+',top='+yp+',width='+380+',height='+450);
 }
 
 function view_big_chart(url)
 {
  xp = window.screen.width/2-(600/2);
  yp = window.screen.height/2-(650/2);
  window.open(url,'','resizable=0,scrollbars=1,left='+xp+',top='+yp+',width='+600+',height='+650);
 }

 function go_search(cat)
 {
  document.search.cat.value = cat;
  document.search.submit();
 }

 function go_search2(cat)
 {
  document.search2.cat2.value = cat;
  document.search2.submit();
 }

 function view_table(id)
 {
  for(n=1;n<=4;n++)
  {
    document.all['tab_'+n].style.display='none';
    document.all['back_'+n].style.backgroundImage='url(io/images/menu_center_little_off.gif)';
  }
  document.all['back_'+id].style.backgroundImage='url(io/images/menu_center_little_on.gif)';
  document.all['tab_'+id].style.display='';
 }

function show_forum_cat(piazza,strategie,mercati){
	if(piazza!=''){
		document.getElementById('content_piazza').style.display='block';
		document.getElementById('form_piazza').className="on";
		
		document.getElementById('content_strategie').style.display='none';
		document.getElementById('form_strategie').className="off";
		
		document.getElementById('content_mercati').style.display='none';
		document.getElementById('form_mercati').className="off";
		}
	
	if(strategie!=''){
		document.getElementById('content_piazza').style.display='none';
		document.getElementById('form_piazza').className="off";
		
		document.getElementById('content_strategie').style.display='block';
		document.getElementById('form_strategie').className="on";
		
		document.getElementById('content_mercati').style.display='none';
		document.getElementById('form_mercati').className="off";
		}
		
	if(mercati!=''){
		document.getElementById('content_piazza').style.display='none';
		document.getElementById('form_piazza').className="off";
		
		document.getElementById('content_strategie').style.display='none';
		document.getElementById('form_strategie').className="off";
		
		document.getElementById('content_mercati').style.display='block';
		document.getElementById('form_mercati').className="on";
		}
	}
