// JavaScript Document
//////////// Show date
function showfnfdate() {
	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("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
	document.write(dayarray[day]+", "+daym+" " + montharray[month]+" "+ year)
}
//////////// Printer Friendly Page Pop-up
function Clickheretoprint()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_vlue = document.getElementById("print_content").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>Friedrich Naumann Foundation - Manila</title>'); 
   docprint.document.write('</head><body onLoad="self.print()">');
   docprint.document.write('Friedrich Naumann Foundation - Manila (www.fnf.org.ph)<br><br>');           
   docprint.document.write(content_vlue);          
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}
/////////// E-mail Page to a Friend 
function initMail(form) {
	text = "Check out this page:  " + window.location;
	form.message.value = "Hi " + form.sendto.value + " (" + form.to.value + "):\n\n" + text + "\n\nYour Friend,\n" + form.sendername.value + "(" + form.senderemail.value + ")";
	return (form.to.value != "");
}
/////////// hide and show div
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	{   //NN4+
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	{  //gecko(NN6) + IE 5+
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all){	// IE 4
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function ImagePopup(url, width, height) {
  OpenWin = this.open("/reda/image.phtml?url="+url, "ImageWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width="+width+",height="+height);
}
/* <!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!--  Author: www.cgiscript.net  -->
<!-- Begin
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today =  days[now.getDay()] + ", " +
         months[now.getMonth()] + " " +
         date + ", " +
         (fourdigits(now.getYear())) ;

// Print out the data.
document.write(today);
//  End --> */

<!-- Script Size:  1.30 KB -->

function HideContent(d) {
	document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
	document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
	if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
	else { document.getElementById(d).style.display = "none"; }
}
function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}
/*
function Fnfmap(page) { 

OpenWin = this.open(page, "FNF Arounf the World", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes,width=550,height=250"); 
}

function PopupCenter(pageURL,title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}*/

function MyFNFPopUpWin() {
var iMyWidth;
var iMyHeight;
iMyWidth = (window.screen.width/2) - (450 + 10);
iMyHeight = (window.screen.height/2) - (327 + 50);
var win2 = window.open("http://www.fnf.org.ph/mapnew.htm","Window2","status=no,height=654,width=900,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
win2.focus();
}

