// JavaScript Document

var showHotspots = new Array('collage_con','exclusive_con');
var showCollage = new Array('hotspots_con','exclusive_con');
var showExclusive = new Array('hotspots_con','collage_con');

/*var showHeadlines = new Array('snippets_con','sports_con');
var showSnippets = new Array('headlines_con','sports_con');
var showSports = new Array('headlines_con','snippets_con');

var showHeadlines = new Array('snippets_con','sports_con','mayek_con');
*/
var showSnippets = new Array('sports_con','mayek_con');
var showSports = new Array('snippets_con','mayek_con');
var showMayek = new Array('snippets_con','sports_con');


var showHotspotsTab = new Array('collage','exclusive');
var showCollageTab = new Array('hotspots','exclusive');
var showExclusiveTab = new Array('hotspots','collage');

var showSnippetsTab = new Array('sports','mayek');
var showSportsTab = new Array('snippets','mayek');
var showMayekTab = new Array('snippets','sports');

/*
var showHeadlinesTab = new Array('snippets','sports');
var showSnippetsTab = new Array('headlines','sports');
var showSportsTab = new Array('headlines','snippets');
*/
/*
var showHeadlinesTab = new Array('snippets','sports','mayek');
var showSnippetsTab = new Array('headlines','sports','mayek');
var showSportsTab = new Array('headlines','snippets','mayek');
var showMayekTab = new Array('headlines','snippets','sports');
*/
function switchTab(show, hide, tabChange, activeTab)
{
	tabArrHide = hide;
	tabClass = tabChange;

	document.getElementById(show).style.display = "block";
	document.getElementById(activeTab).className = "active"
	
	for (i=0;i<tabClass.length;i++)
	{
		document.getElementById(tabClass[i]).className = "";
	}
	
	for (j=0;j<tabArrHide.length;j++)
	{
		document.getElementById(tabArrHide[j]).style.display = "none";
	}
}
//
var now = new Date();
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number)	
{
	return (number < 1000) ? number + 1900 : number;
}
today =  days[now.getDay()] + ", " +
			  months[now.getMonth()] + " " +
			  date + ", " +
             (fourdigits(now.getYear())) ;
//
function openNewWindow(theURL,winName,features)
 {
  window.open(theURL,winName,features);
}
// External Links
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;
//Mail Form
function submitTouba()
{
	if(document.myForm.loginName.value==""||document.myForm.loginName.length==0)
	{
		alert("Please Enter a login name!!! ");
		document.myForm.loginName.focus();
		return false;
    }
    if(document.myForm.user_pwd.value==""||document.myForm.user_pwd.length==0)
    {
		alert("Please Enter a password!!! ");
		document.myForm.user_pwd.focus();
		return false;
    }
	document.myForm.action="http://e-pao.mail.everyone.net/email/scripts/loginuser.pl?EV1=9648423811769714";
	document.myForm.method="post";
	document.myForm.submit();
	document.myForm.loginName.value = "";
	document.myForm.user_pwd.value=""
}

function EpaoJumpMenu(targ,selObj,restore)
{ //v3.0
	var subMenu = document.getElementById(selObj);
	targ=window.open(subMenu.options[subMenu.selectedIndex].value,'','');
}

function PopVideoSoarHigh()
	{
		window.open("http://e-paolive.net/video/SoarHigh2007Video.html","Video","height=400,width=350,scrollbars=no")

		}

function openBrWindow(theURL,winName,features)
 { //v2.0
  window.open(theURL,winName,features);
}

function PaoYenggeBeta(){
        var arrMnth = new Array("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec");
        // Get the date component values - Marc (added in June 2005)

        // Commented the old value collecting section in to the following ... Marc (June 2005)
        d2 = $('[name=day]').val();
        if(d2.length == 1){
            d2 = '0'+ d2; 
        }
        m2 = $('[name=month]').val();
        //m2 = m2.toLowerCase();
        y2 = $('[name=year]').val();
        var a = new ToFmt(m2);
        mnth = a.fmt00();

        var yr = y2.substring(2,4); // get those 2 last things in the string! - Marc.

        var Selection = "archives/" + m2 + yr + "/A" + d2 + mnth + yr + ".html";

        var SelDate = mnth + d2 + y2;

        // now do the date comparison and redirecting stuff! - Marc.
        if (DatePosition(SelDate,6) < 0)
        {
            location.replace("http://e-pao.net/epPageSelector.asp?src=archive&ch=news_section");
        }
        else
        {
            document.epfrmArchives.action = "http://e-pao.net/epArcDisplay.asp?src=" + d2 + mnth + yr;
            document.epfrmArchives.method="post";
            document.epfrmArchives.submit();
        }
    }

