function openVideoWindows(num) {
	var option = num;
    var page;
	
	if(option == 1) {
        page = "/popups/uko-akpan.php";
    } else if(option == 2){
        page = "/popups/sir-wilker-jackson.php";
    } else if(option == 3){
		page = "/popups/aiwa.php";
    } else if(option == 4){
		page = "/popups/child-witches.php";
    } else if(option == 5){
		page = "/popups/christiana-essien-igbokwe.php";   
	} else if(option == 6){
		page = "/popups/plane-landing-at-ibom-airport.php";
    } else if(option == 7){
		page = "/popups/akisan-2009-convention-dvd-trailer.php";
    } else if(option == 8){
		page = "/popups/uwem-akpan-on-cnn.php";
    }
	
    var w = window.open(page,'chart','width=500,height=540,scrollbars=no,resizable=no');
    w.focus();
}

 function myDateFormat(dt){
  var  dayno    =  dt.getDate() ;
  var  monthno  =  dt.getMonth() ;
  var  yearno   =  dt.getFullYear() ;
  
  var  daystr ;
  if       ((dayno == 1) 
            || 
            (dayno == 21)     
            || 
            (dayno == 31)
            )
            {daystr  =  dayno + "st"}
  else  if  ((dayno == 2)
             ||
             (dayno == 22)
            )
            {daystr  =  dayno + "nd"}  
  else  if  ((dayno == 3)
             ||
             (dayno == 23)
            )
            {daystr  =  dayno + "rd"}
  else      {daystr  =  dayno + "th"}
  
  if        (monthno ==  0)  {monthstr  =  "January"}
  else  if  (monthno ==  1)  {monthstr  =  "February"}
  else  if  (monthno ==  2)  {monthstr  =  "March"}
  else  if  (monthno ==  3)  {monthstr  =  "April"}
  else  if  (monthno ==  4)  {monthstr  =  "May"}
  else  if  (monthno ==  5)  {monthstr  =  "June"}
  else  if  (monthno ==  6)  {monthstr  =  "July"}
  else  if  (monthno ==  7)  {monthstr  =  "August"}
  else  if  (monthno ==  8)  {monthstr  =  "September"}
  else  if  (monthno ==  9)  {monthstr  =  "October"}
  else  if  (monthno == 10)  {monthstr  =  "November"}
  else  if  (monthno == 11)  {monthstr  =  "December"}    

  var dtstr  =  daystr + " " + monthstr + " " + yearno
  
  return  dtstr
}

function resetFields() {
	for(i=0; i<document.contact.elements.length; i++) {
		document.contact.elements[i].value = "";
		if(document.contact.elements[i].type=="select") {
			document.contact.field.selectedIndex = 0;

		}
	}
	return false;
}

function clearContents() {
	var box = document.getElementById("subscribeTextBox");
	box.value = " ";
}

function populateContents() {
	var box = document.getElementById("subscribeTextBox");
	box.value = "Enter Email Address Here to Subscribe...";
}

function doBlink() {
var blink = document.all.tags("BLINK")
for (var i=0; i<blink.length; i++)
	blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {
if (document.all)
	setInterval("doBlink()",1000)
}
window.onload = startBlink;

function clearError(id) {
	document.getElementById(id).style.visibility = "hidden";
}

function showError(id) {
	document.getElementById(id).style.visibility = "visible";
}
function warn(errors) {
	for (i = 0; i < errors.length; i++) {
		showError(errors[i]);
	}
}

function checkForInvalidCharacters(strInput) {
var invalidChars = "?&=";
for (var i = 0; i < invalidChars.length; i++) {
	strBadChar = invalidChars.charAt(i); //get next invalid character
	if (strInput.indexOf(strBadChar,0) > -1) return strBadChar; //if there is one in Email
}
return "";
}//checkForInvalidCharacters

function checkContactForm() {
var form = document.contact;
var errorCount = 0;
var errors = new Array();


var alerts = '';
var digits = "0123456789";
var digitsandletters = "0123456789abcdefghijklmnopqrstuvwxyz";

var fullNameError = "false";
if (form.full_name.value == ""){
	alerts += "Please fill in your full name.\n";
	fullNameError = "true";
}
if (fullNameError == "true") {
	errors[errorCount] = "fullNameError";
	errorCount++;
}

var emailError = "false";
if (form.email_addr.value == "") {
	alerts += "Please enter your email address.\n";
	emailError = "true";
}
if ( form.email_addr.value.indexOf("@")<1 && form.email_addr.value!="" ) {
	alerts += "Please verify that your email address contains the '@' sign.\n";
	emailError = "true";
}
if ( form.email_addr.value.indexOf(" ")>=0 && form.email_addr.value!="" ) {
	alerts += "Please verify that your email address does not contain any spaces.\n";
	emailError = "true";
}
if ((form.email_addr.value.indexOf ('@',0) == -1 ||
	form.email_addr.value.indexOf ('.',0) == -1) &&
	form.email_addr.value != "") {
	alerts += "Please verify that your email address is valid.\n";
	emailError = "true";
}
strBadChar = checkForInvalidCharacters(form.email_addr.value);
if (strBadChar.length > 0) {
	alerts = alerts + "Email Address cannot include the " + strBadChar + " character.\n";
	emailError = "true";
}
if (emailError == "true") {
	errors[errorCount] = "emailError";
	errorCount++;
}

var subject = form.subject.options[form.subject.selectedIndex].value;
if (subject=="none"){
	alerts += "Please select subject from the drop-down list.\n";
	errors[errorCount] = "subjectError";
	errorCount++;
}

var commentsError = "false";
if (form.comments.value == ""){
	alerts += "Please fill a comment.\n";
	commentsError = "true";
}
if (commentsError == "true") {
	errors[errorCount] = "commentsError";
	errorCount++;
}

if (alerts != ""){
	alert(alerts);
	warn(errors);
	return (false);
} else {
	
	return (true);
}
}//checkContactForm()

function checkEmailFriendForm() {
        var form = document.emailFriend;
        var errorCount = 0;
        var errors = new Array();

        
        var alerts = '';
        var digits = "0123456789";
        var digitsandletters = "0123456789abcdefghijklmnopqrstuvwxyz";
        
        //sender info
        var senderNameError = "false";
        if (form.sender_name.value == ""){
            alerts += "Please fill in your full name.\n";
            senderNameError = "true";
        }
        if (senderNameError == "true") {
            errors[errorCount] = "senderNameError";
            errorCount++;
        }
        
         var senderEmailError = "false";
        if (form.sender_email.value == "") {
            alerts += "Please enter your email address.\n";
            senderEmailError = "true";
        }
        if ( form.sender_email.value.indexOf("@")<1 && form.sender_email.value!="" ) {
            alerts += "Please verify that your email address contains the '@' sign.\n";
            senderEmailError = "true";
        }
        if ( form.sender_email.value.indexOf(" ")>=0 && form.sender_email.value!="" ) {
            alerts += "Please verify that your email address does not contain any spaces.\n";
            senderEmailError = "true";
        }
        if ((form.sender_email.value.indexOf ('@',0) == -1 ||
             form.sender_email.value.indexOf ('.',0) == -1) &&
             form.sender_email.value != "") {
            alerts += "Please verify that your email address is valid.\n";
            senderEmailError = "true";
        }
        strBadChar = checkForInvalidCharacters(form.sender_email.value);
        if (strBadChar.length > 0) {
            alerts = alerts + "Email Address cannot include the " + strBadChar + " character.\n";
            senderEmailError = "true";
        }
        if (senderEmailError == "true") {
            errors[errorCount] = "senderEmailError";
            errorCount++;
        }

        //recipient info
        var recipientNameError = "false";
        if (form.recipient_name.value == ""){
            alerts += "Please fill in your friend's full name.\n";
            recipientNameError = "true";
        }
        if (recipientNameError == "true") {
            errors[errorCount] = "recipientNameError";
            errorCount++;
        }
        
         var recipientEmailError = "false";
        if (form.recipient_email.value == "") {
            alerts += "Please enter your friend's email address.\n";
            recipientEmailError = "true";
        }
        if ( form.recipient_email.value.indexOf("@")<1 && form.recipient_email.value!="" ) {
            alerts += "Please verify that your friend's email address contains the '@' sign.\n";
            recipientEmailError = "true";
        }
        if ( form.recipient_email.value.indexOf(" ")>=0 && form.recipient_email.value!="" ) {
            alerts += "Please verify that your friend's email address does not contain any spaces.\n";
            recipientEmailError = "true";
        }
        if ((form.recipient_email.value.indexOf ('@',0) == -1 ||
             form.recipient_email.value.indexOf ('.',0) == -1) &&
             form.recipient_email.value != "") {
            alerts += "Please verify that your friend's email address is valid.\n";
            recipientEmailError = "true";
        }
        strBadChar = checkForInvalidCharacters(form.recipient_email.value);
        if (strBadChar.length > 0) {
            alerts = alerts + "Email Address cannot include the " + strBadChar + " character.\n";
            recipientEmailError = "true";
        }
        if (recipientEmailError == "true") {
            errors[errorCount] = "recipientEmailError";
            errorCount++;
        }
        
        if (alerts != ""){
            alert(alerts);
            warn(errors);
            return (false);
        } else {
            
            return (true);
        }
    }//checkEmailFriendForm()