//pt vreme, curs valutar, horoscop, data,etc

function scriedata(){
		var mydate=new Date()
		var year=mydate.getYear()
		if (year < 1000)
		year+=1900
		var day=mydate.getDay()
		var month=mydate.getMonth()
		var daym=mydate.getDate()
		if (daym<10)
		daym="0"+daym
		var dayarray=new Array("Duminica","Luni","Marti","Miercuri","Joi","Vineri","Sambata")
		var montharray=new Array("Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie")
		document.write("<font color='000000' face='Verdana' size='1'><b>"+dayarray[day]+", "+daym+" "+montharray[month]+" "+year+"</b></font>")
}

function ShowDate(){
        this_month = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

        var today = new Date();

        var day   = today.getDate();
        var month = today.getMonth();
        var year  = today.getYear();
        if (year < 1900){
               year += 1900;
        }
          //return(this_month[month]+" "+day+", " +year);
					document.write(month+"/"+day+"/"+year)
}

function ShowDateRo(){
        this_month = new Array("Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie");

        var today = new Date();

        var day   = today.getDate();
        var month = today.getMonth();
        var year  = today.getYear();
        if (year < 1900){
               year += 1900;
        }
          //return(day+" "+this_month[month]+" "+year);
		  document.write(day+" "+this_month[month]+" "+year)
}

function ShowDateHu(){
        this_month = new Array("Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie");

        var today = new Date();

        var day   = today.getDate();
        var month = today.getMonth();
        var year  = today.getYear();
        if (year < 1900){
               year += 1900;
        }
          return(day+" "+this_month[month]+" "+year);
}

// left menu
/*  Script made by Martial Boissonneault ) 2001-2003 http://getElementById.com/ */
function SwitchMenu(obj)
{
	if(document.getElementById)
    {
	    var el = document.getElementById(obj);
	    var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none")
	    {
			for (var i=0; i<ar.length; i++)
			{
				ar[i].style.display = "none";
				
			}
			el.style.display = "block";
	    }
	    else
	    {
			el.style.display = "none";
	    }
    }
}

function Meniu(obj)
{
	if(document.getElementById)
    {
	    var el = document.getElementById(obj);
	    var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none")
	    {
			for (var i=0; i<ar.length; i++)
			{
				ar[i].style.display = "none";
				
			}
			el.style.display = "block";
	    }
	    else
	    {
			el.style.display = "none";
	    }
    }
}

function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.myForm.time.value = ajaxRequest.responseText;
		}
	}
	ajaxRequest.open("GET", "serverTime.php", true);
	ajaxRequest.send(null); 
}

function ajaxManager()
	{
	var args = ajaxManager.arguments;
	switch (args[0])
		{
		case "load_page":
		if (document.getElementById) {
			var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			}
			if (x)
				{
			x.onreadystatechange = function()
					{
				if (x.readyState == 4 && x.status == 200)
						{
						el = document.getElementById(args[2]);
						el.innerHTML = x.responseText;
					}
					}
				x.open("GET", args[1], true);
				
				x.send(null);
				}
			break;
		case "start_up":
			ajaxManager('load_page', 'poezii.xml', 'idcell');
			break;
		case "click":
			ajaxManager('load_page', args[1], 'idcell');
			break;	
		}
	}
	
	//functia pt rollover
function suprafoto(obj,src2) {
	var el = document.getElementById(obj);
	el.src=src2
}

//functii pt Guest Book
function VerificareGuest() {
	var Valoare = window.document.guestbook.nume.value;
	if (Valoare == '') {
	  alert("Este obligatorie completarea numelui!");
		window.document.guestbook.nume.focus();
	  return(false);
	}
	var Valoare = window.document.guestbook.subiect.value;
	if (Valoare == '') {
	  alert("Este obligatorie completarea subiectului!");
		window.document.guestbook.subiect.focus();
	  return(false);
	}
	var Valoare = window.document.guestbook.mesaj.value;
	if (Valoare == '') {
	  alert("Este obligatorie completarea mesajului!");
		window.document.guestbook.mesaj.focus();
	  return(false);
	}
	return(true);
}

function openwindow(url,target) {
	//window.open(url,target,"scrollbars=0,toolbar=0,width=260,height=350,resizable=0")
	window.open(url,target,"scrollbars=0,toolbar=0,width=750,height=560,resizable=0")
	//window.open(url,target,"scrollbars=1,toolbar=0, width=750, height=560, resizable=1")
}
