function getTotalHeight() {
	var height = 0;	
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		height = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
		height = document.body.scrollHeight;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		height = document.body.offsetHeight;
  	}
  	return height;
}

function getInnerHeight() {
	return (window.innerHeight) ? window.innerHeight : document.body.clientHeight;
} 

function getInnerWidth() {
	return (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
}

function heightFix() {
	var leftHeight = document.getElementById("leftDiv").offsetHeight;
	var contentHeight = document.getElementById("contentDiv").offsetHeight;
	var windowHeight = getTotalHeight() - 157;
	var maxHeight = leftHeight;
	
	if (contentHeight>maxHeight) {
		maxHeight = contentHeight;
	}
	if (windowHeight>maxHeight) {
		maxHeight = windowHeight;
	}
	
	document.getElementById("contentDiv").style.height = maxHeight + "px";
	document.getElementById("leftDiv").style.height = maxHeight + "px";
}

var temp;
function openpopup (myfile, myname, width, height, scrolls)
{
	if(!scrolls) { scrolls = 0 }
  	if((navigator.appName.indexOf("Explorer")!=-1)&&(parseInt(navigator.appVersion.substring(0,1))<4)) {
      params = "width=" + width + ",height=" + height + ",resizable=1,status=0,scrollbars="+scrolls+",toolbar=0,location=0,directories=0,menubar=1";
      newwin = window.open( myfile , myname , params);
    } else {
    	if(temp) {
        	if(!temp.closed) {
          		temp.close();temp="";
        	}
      	}
	params = "width=" + width + ",height=" + height + ",resizable=1,status=0,scrollbars="+scrolls+",toolbar=0,location=0,directories=0,menubar=1";
    newwin = window.open( myfile , myname , params);
    temp = newwin;
    temp.name = "temp";
    newwin="";}
}

function no2str(no) {
 if (no<10) {return "0"+no;}
 else {return no;}
}

function getCurrentMonth(lang) {
 var currentMonth = new Date().getMonth();
 if (lang=="ro") {
 if (currentMonth==0) {return "ianuarie"} else
 if (currentMonth==1) {return "februarie"} else
 if (currentMonth==2) {return "martie"} else
 if (currentMonth==3) {return "aprilie"} else
 if (currentMonth==4) {return "mai"} else
 if (currentMonth==5) {return "iunie"} else
 if (currentMonth==6) {return "iulie"} else
 if (currentMonth==7) {return "august"} else
 if (currentMonth==8) {return "septembrie"} else
 if (currentMonth==9) {return "octombrie"} else
 if (currentMonth==10) {return "noiembrie"} else
 if (currentMonth==11) {return "decembrie"}
 }
 else {
 if (currentMonth==0) {return "january"} else
 if (currentMonth==1) {return "february"} else
 if (currentMonth==2) {return "march"} else
 if (currentMonth==3) {return "april"} else
 if (currentMonth==4) {return "mai"} else
 if (currentMonth==5) {return "june"} else
 if (currentMonth==6) {return "july"} else
 if (currentMonth==7) {return "august"} else
 if (currentMonth==8) {return "september"} else
 if (currentMonth==9) {return "octomber"} else
 if (currentMonth==10) {return "november"} else
 if (currentMonth==11) {return "december"}
 }
}

function getCurrentYear() {
 var an=new Date().getYear();
 var an_str=new String(an);
 if (an_str.length==3) {an_str=an_str.substring(1);
 an_str="20"+an_str;}
 return an_str;
}

function ceas(ro) {
 var ceas_div=document.getElementById("ceas");
 var currentTime=new Date();
 var ora=currentTime.getHours();
 var minut=currentTime.getMinutes();
 var secunde=currentTime.getSeconds();

 var zi=currentTime.getDate();
 if (ro) {var luna=getCurrentMonth("ro");}
 else {var luna=getCurrentMonth("en");}
 an_str = getCurrentYear();
 ceas_div.innerHTML=no2str(ora)+":"+no2str(minut)+":"+no2str(secunde)+"&nbsp;&nbsp;&nbsp;"+zi+" "+luna+" "+an_str;
 setTimeout("ceas("+ro+")",1000);
}