﻿// JScript File
 function centerscreen()
        {
            var size = (screen.width / 2) - 473
            document.getElementById("bgPanel").style.left = size + 'px';
            document.getElementById("bgPanel").style.visibility = 'visible'
            //document.getElementById("homeLabel").style.visibility = 'visible'
            /*document.getElementById("news2Label").style.visibility = 'visible'
            document.getElementById("events2Label").style.visibility = 'visible'
            document.getElementById("linksLabel").style.visibility = 'visible'
            document.getElementById("lineLabel").style.visibility = 'visible'*/
        }
        function openWindow(url)
        {
        newWindow = window.open(url,"windowname","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=410,height=560,top=200,left=200");
        	
        }
        function showInfo(text)
        {
            InfoWindow=window.open("", "", "width=300,height=400","screenX=300","screenY=400");
            InfoWindow.document.open();
            InfoWindow.document.write("<html><head>");
            InfoWindow.document.write("<title>Info</title>");
            InfoWindow.document.write("</head>");
            InfoWindow.document.write("<body marginheight='0' topmargin='0' leftmargin='0' rightmargin='0' marginwidth='0'>");
            InfoWindow.document.write("<table cellpadding='0' cellspacing='0' border='0'><tr><td>"+text+"</td></tr></table>");
            InfoWindow.document.write("</body></html>");
            InfoWindow.document.close();
        } 
        function donation(project, money, cur)
        {
            var reg = new RegExp(/\d+/);
            
            if(reg.test(money) && money > 0)
                parent.location.href = "donations.aspx?project="+project+"&money="+money+"&cur="+cur;
            else
                alert("Please state the amount of money you wish to donate!");
        }  
        function addEntry(me)
	{
		var targt = document.getElementById('add_entry');
		var nextStatus = (targt.style.display == 'none') ? 'block' : 'none';
		targt.style.display = nextStatus;
		if (nextStatus == 'block')
			me.style.visibility = 'hidden';
		else
			me.style.visibility = 'visible';
		document.getElementById('AddNameBox').focus();
	}
	function validateTxtArea(object)
        {           
            var maxLength = 255;
            var lengthLeft = maxLength - object.value.length;
            if(lengthLeft <= 0)
            {
                object.value = object.value.substring(0, maxLength);
                lengthLeft = 0;
            }
            document.getElementById("numberOfCharsLeft").innerHTML = '<b>Message (Optional)</b>  Characters left : '+ lengthLeft;
        }
        function extraValidation(object)
        {
            var maxLength = 255;
            var lengthLeft = maxLength - object.value.length;
            if(lengthLeft <= 0)
            {
                object.value = object.value.substring(0, maxLength);
                lengthLeft = 0;
            }
        }     
