function findPosX(obj)
{var curleft = 0;
 if (document.getElementById || document.all)
	{while (obj.offsetParent)
		{curleft += obj.offsetLeft;
		 obj = obj.offsetParent;}
	}
	else if (document.layers)
		curleft += obj.x;
	return curleft;
}
function findPosY(obj)
{var curtop = 0;
 if (document.getElementById || document.all)
	{while (obj.offsetParent)
		{curtop += obj.offsetTop;
		 obj = obj.offsetParent;
		}
	}
	else if (document.layers)
		curtop += obj.y;
	return curtop;
}
var ie=(document.all && document.getElementById);
var ns=(!document.all && document.getElementById);
function loadSource(id,url) {
    if(document.getElementById) {
	document.getElementById('bufferFrame').src = url;
	txt.style.top = 10 + "px";
	mss.style.visibility = "visible";
	txt.style.visibility = "hidden";}}
function loadSF(id) {
    if(document.getElementById) { 
	txt.style.top = 10 + "px"; 
	document.getElementById(id).innerHTML = window.frames['bufferFrame'].document.getElementById('bdy').innerHTML;
	setTimeout("txt.style.visibility = 'visible';mss.style.visibility = 'hidden';",100);
	
	}}
var currentPanel;
var lastPanel=1;
function showPanel(panelNum, o){
var a;
var b;
if (currentPanel != null)
{hidePanel();}
document.getElementById('p'+panelNum).style.visibility = 'visible';
currentPanel = panelNum;
	if (o==1) {	a='#40ffb2'; b='#4F6D9C'; document.getElementById('a'+currentPanel).className="on"; document.getElementById('ta'+currentPanel).className="ontbl"; 
				if(currentPanel!=lastPanel) {document.getElementById('p'+currentPanel).style.color = "#4F6D9C";}}
	else if (o==0) {a='#40ffb2'; b='#4F6D9C'; document.getElementById('a'+lastPanel).className="off"; document.getElementById('ta'+lastPanel).className="offtbl"; lastPanel=panelNum;
					document.getElementById('p'+currentPanel).style.color = "#4F6E9C";}
	 else if (o==2) {a='#40ffb2'; b='#FF408C'; showPanel(lastPanel,0); document.getElementById('ta'+currentPanel).className="offtbl"; document.getElementById('a'+currentPanel).className="off";
	 				document.getElementById('p'+currentPanel).style.color = "#4F6E9C";
	 }
document.getElementById('a'+lastPanel).className="in"; document.getElementById('ta'+lastPanel).className="intbl";
document.getElementById('p'+currentPanel).style.backgroundColor = "";

}

function hidePanel(){
document.getElementById('p'+currentPanel).style.visibility = 'hidden';}
/************/

function BwindowWidth(){
 if (window.innerWidth) return (window.innerWidth);
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;}
function BwindowHeight(){
 if (window.innerHeight) return window.innerHeight;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;}
function recal(){
 //if (Width != BwindowWidth() || Height != BwindowHeight())
 {window.location.reload(true);
}
 }


var message = new Array();
var delay = new Array();
var speed = new Array();
var step = new Array();

function initfade(){
MM_preloadImages('images/index72_01.jpg','images/index72_02.jpg','images/index72_03.jpg','images/index72_04.jpg','images/index72_05.jpg','images/index72_06.jpg','images/index72_07.jpg','images/index72_08.jpg')
 txt1 = document.getElementById("t1");
 txt2 = document.getElementById("t2");
     if(document.getElementById) { 
        cnt = document.getElementById("cont");
        txt = document.getElementById("text");
		mss = document.getElementById("msg");
        txt.style.top = 0;
	loadSource('text','page6.html');}
 replay();
}

function changetext(){
 stub++;
 if (stub == message.length) stub=1;
 if (action == 0)
 {action = 1;
  txt1.innerHTML = message[stub];
  stai=delay[stub];
  viteza=speed[stub];
  pas=step[stub];
  fade(1,0);}
 else
 {action = 0;
  txt2.innerHTML = message[stub];
  stai=delay[stub];
  viteza=speed[stub];
  pas=step[stub];
  fade(0,1);}
}
function replay(){
  if (timerIDo != "") clearTimeout(timerID);
  fadeA[0][0] = 0;
  fadeA[1][0] = 100;
  stub = 0;
  changetext();}
function fade(inc,outc){
if (fadeA[outc][0] < 100)
 {fadeA[outc][0]=fadeA[outc][0]+pas;
  fadeA[inc][0]=fadeA[inc][0]-pas;
  opacity = fadeA[outc][0];
  opacity2 = fadeA[inc][0];
  if(inc == 1)
  {obj = txt1;
   obj2 = txt2;}
  else
  {obj = txt2;
   obj2 = txt1;} 
  if(ie){ 
	obj.style.filter="alpha(opacity="+fadeA[outc][0]+")";
	obj2.style.filter="alpha(opacity="+fadeA[inc][0]+")";}
  if(ns){ 
   	obj.style.MozOpacity = fadeA[outc][0] + '%';
   	obj2.style.MozOpacity = fadeA[inc][0] + '%';}
  timerIDo = setTimeout("fade("+inc+","+outc+")",viteza);
 }
else
 {timerIDo = setTimeout("changetext()",stai);}
}

function debuteDate1() {
  var adate, date, amonth;
  adate = new Date();
  date = adate.getDate();
  amonth = adate.getMonth(); 
  if (adate.getDate()<15){date=(2 * amonth) % 3;}
  else {date=12+((3 * amonth) % 10);}
   if (amonth == 1) date += " Ianuarie";
  else if (amonth == 2) date += " Februarie";
  else if (amonth == 3) date += " Martie";
  else if (amonth == 4) date += " Aprilie";
  else if (amonth == 5) date += " Mai";
  else if (amonth == 6) date += " Iunie";
  else if (amonth == 7) date += " Iulie";
  else if (amonth == 8) date += " August";
  else if (amonth == 9) date += " Septembrie";
  else if (amonth == 10) date += " Octombrie";
  else if (amonth == 11) date += " Noiembrie";
  else if (amonth == 12) date += " Decembrie";

  if (adate.getYear() > 1999)
    date += " " + adate.getYear();
  else date += "  " + (1900 + adate.getYear());
  date = "  " + date;
  return date;
}
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];}}
}
