var temp;
function openpopup (myfile, myname, breite, hoehe,scrolls)
{
  if(!scrolls) { scrolls = 0 }
  if((navigator.appName.indexOf("Explorer")!=-1)&&(parseInt(navigator.appVersion.substring(0,1))<4))
    {
      params = "width=" + breite + ",height=" + hoehe + ",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=" + breite + ",height=" + hoehe + ",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 openPrintPopup(pageok, width, height) {
		params = "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes";
    x=window.open(pageok,"print",params);
    x.focus();
}

function openresource (myfile, myname, breite, hoehe,scrolls)
{
  if(!scrolls) { scrolls = 0 }
  if((navigator.appName.indexOf("Explorer")!=-1)&&(parseInt(navigator.appVersion.substring(0,1))<4))
    {
      params = "width=" + breite + ",height=" + hoehe + ",resizable=1,status=0,scrollbars="+scrolls+",toolbar=0,location=0,directories=0,menubar=0";
      newwin = window.open( myfile , myname , params);
    }
    else
    {
      if(temp)
      {
        if(!temp.closed)
        {
          temp.close();temp="";
        }
      }
      params = "width=" + breite + ",height=" + hoehe + ",resizable=1,status=0,scrollbars="+scrolls+",toolbar=0,location=0,directories=0,menubar=0";
      newwin = window.open( myfile , myname , params);
      temp = newwin;
      temp.name = "temp";
      newwin="";
    }
}

function showConfirmation(message, linkOK, linkCancel){
	OK = confirm(message);
  if( OK == true){
  	return linkOK;
  } else {
    return linkCancel;
  }
}


function toggleCheckboxes(fObj,chkList){

     var chkLength = chkList.length;
     if (chkLength > 0)
     {
	     for (var i=0; i<chkLength; i++){
		     if(fObj.checked == true){
		          chkList[i].checked = true;
		     }
		     else {
		          chkList[i].checked = false;
		     }
	     }
     }

}

function checkBrowser(nextURL){
  var Netscape = navigator.appName == "Netscape";
  var MSIE = navigator.appName == "Microsoft Internet Explorer";
  var Opera = navigator.userAgent.indexOf("Opera") > -1;
  var Unknown = !(Netscape || MSIE || Opera);
  var BrowserVer=0;

  if(Netscape) {
    BrowserVer = parseFloat(navigator.appVersion);
  }
  else if(MSIE) {
    var n = navigator.userAgent;
    var MSIEVer = n.substr(n.indexOf("MSIE ")+("MSIE ").length, 4);
    BrowserVer = parseFloat(MSIEVer);
    // converts it into a floatint point number

    if(Opera) {
      var OperaVer = n.substr(n.indexOf("Opera ")+("Opera ").length, 4);
      BrowserVer = parseFloat(OperaVer);
    }
  }

	if (MSIE && !Opera && BrowserVer>=6){
		window.location=nextURL;
		return true;
	} else {
	  alert("You must use Microsoft Internet Explorer 6 to insert/update articles.");
	  return false;
	}
}

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);
					       
					       }