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

function KMpopup(mylink, windowname)
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
   href=mylink.href;
	window.open(href, windowname, 'width=640,height=470,scrollbars=yes,toolbar=no,resizable=no,menubar=no');
	return false;
	}


function submitProfile()
	{
	document.profile.submit();
	}

function checkRulesForm()
	{	
	
	if (rulesForm.agreement.checked==false)
		{
		alert("Please check I have read, and agree to abide by the SynergemIndia rules.")
		rulesForm.agreement.focus()
		return false
		}
	else
		return true;
	}

function GetPageElement(ElementName)
	{
    var ReturnElement = "";

    if (document.getElementById)
		{
        ReturnElement = "document.getElementById('" + ElementName + "')";
		}
    else if (document.all)
		{
        ReturnElement = "document.all['" + ElementName + "']";
		}
    return eval(ReturnElement);
}
  
    
	function Swapname()
    {
	    var tfname = GetPageElement("name");
	    var tfnamePlace = GetPageElement("namePlace");

        tfnamePlace.style.display = "none";
        tfname.style.display = "";
        tfname.focus();
    }     
    
    function SwapnamePlace()
    {
	    var tfname = GetPageElement("name");
	    var tfnamePlace = GetPageElement("namePlace");
	    
        if (tfname.value == '')
        {
            tfnamePlace.style.display = "";
            tfname.style.display = "none";
        }
    }
	
  function Swapemail()
    {
	    var tfemail = GetPageElement("email");
	    var tfemailPlace = GetPageElement("emailPlace");

        tfemailPlace.style.display = "none";
        tfemail.style.display = "";
        tfemail.focus();
    }     
    
    function SwapemailPlace()
    {
	    var tfemail = GetPageElement("email");
	    var tfemailPlace = GetPageElement("emailPlace");
	    
        if (tfemail.value == '')
        {
            tfemailPlace.style.display = "";
            tfemail.style.display = "none";
        }
    }					


function Swapcomment()
    {
	    var tfcomment = GetPageElement("comment");
	    var tfcommentPlace = GetPageElement("commentPlace");

        tfcommentPlace.style.display = "none";
        tfcomment.style.display = "";
        tfcomment.focus();
    }     
    
    function SwapcommentPlace()
    {
	    var tfcomment = GetPageElement("comment");
	    var tfcommentPlace = GetPageElement("commentPlace");
	    
        if (tfcomment.value == '')
        {
            tfcommentPlace.style.display = "";
            tfcomment.style.display = "none";
        }
    }		


