<!--
function startWin(TheWindow,scrollBar,theWidth,theHeight)
{
var desktop=window.open(TheWindow,"_blank","toolbar=no,location=no,status=yes,menubar=no,scrollbars="+scrollBar+",width="+theWidth+",height="+theHeight+",resizable");
var screenwidth=screen.width
var screenheight=screen.height
var leftcoord=(screen.width-theWidth)/2
var topcoord=(screen.height-theHeight)/2
desktop.moveTo(leftcoord,topcoord);
}

function startCalendarWin(TheWindow,scrollBar,theWidth,theHeight)
{
var desktop=window.open(TheWindow,"_blank","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,width=600,height=400,resizable");
var screenwidth=screen.width
var screenheight=screen.height
var leftcoord=(screen.width-theWidth)/2
var topcoord=(screen.height-theHeight)/2
desktop.moveTo(leftcoord,topcoord);
}

function startWinGallery(TheWindow,scrollBar,theWidth,theHeight)
{
var desktop=window.open(TheWindow,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars="+scrollBar+",width="+theWidth+",height="+theHeight+",noresize");
var screenwidth=screen.width
var screenheight=screen.height
var leftcoord=(screen.width-theWidth)/2
var topcoord=(screen.height-theHeight)/2
desktop.moveTo(leftcoord,topcoord);
}

function setFocus(theID,theOnColor)
{
eval("document.getElementById('"+theID+"').style.backgroundColor='" + theOnColor + "';");
}

function releaseFocus(theID,theOffColor)
{
eval("document.getElementById('"+theID+"').style.backgroundColor='" + theOffColor + "';");
}

function isGreaterThan(argInput, argMin)

{ if (argInput.length >= argMin)
        {return true;}
  else
        {return false;} 
}

// ##############################################################

function isEmail(s)

{
invalidCharsList = " /:,;~#";

if (s.indexOf('@',0)==-1 || s.indexOf('@',0)== 0 || s.indexOf('.',0)==-1)
        {
    document.theForm.email.select();
    document.theForm.email.focus();
    return (false);
     }
    for (i = 0; i < invalidCharsList.length; i++) {
    errorChar = invalidCharsList.charAt(i);
    if (s.indexOf(errorChar,0) != -1) {
    document.theForm.email.select();
    document.theForm.email.focus();
    return (false);
    }
}
    return (true);
}

// ##############################################################

function isEmailFriend()

{
invalidCharsList = " /:,;~#";

if (document.theForm.friend_email.value.indexOf('@',0)==-1 || document.theForm.friend_email.value.indexOf('@',0)== 0 || document.theForm.friend_email.value.indexOf('.',0)==-1) 
        {
    document.theForm.friend_email.select();
    document.theForm.friend_email.focus();
    return (false);
     }
    for (i = 0; i < invalidCharsList.length; i++) {
    errorChar = invalidCharsList.charAt(i);
    if (document.theForm.friend_email.value.indexOf(errorChar,0) != -1) {
    document.theForm.friend_email.select();
    document.theForm.friend_email.focus();
    return (false);
    }
}
    return (true);
}

// ##############################################################

function isEmpty(s)
{       
        if ((s == null) || (s.length == 0) || (s == '' ))
                { return true;
                }
        else
                { return false;
                }
} 

// ##############################################################

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

// ##############################################################

function isTelephoneDigit (c)
{   return (((c >= "0") && (c <= "9")) || (c == " ") || (c == "(") || (c == ")") || (c == "-"))
}

// ##############################################################

function isMoneyDigit (c)
{   return (((c >= "0") && (c <= "9")) || (c == "R") || (c == " ") || (c == ",") || (c == "."))}

// ##############################################################

function isNumeric (argInput)

{   var i;
    for (i = 0; i < argInput.length; i++)
    {   
        var c = argInput.charAt(i);
        if (!isDigit(c)) return false;
    }
    return true;
}

// ##############################################################

function isID(argInput)

{   var i;
    for (i = 0; i < argInput.length; i++)
    {   
        var c = argInput.charAt(i);
        if (!isDigit(c)) return false;
    }
    return true;
}

// ##############################################################

function isMoney (argInput)

{   var i;
    for (i = 0; i < argInput.length; i++)
    {   
        var c = argInput.charAt(i);
        if (!isMoneyDigit(c)) return false;
    }
    return true;
}

// ##############################################################

function isTelephone (argInput)

{   var i;
    for (i = 0; i < argInput.length; i++)
    {   
        var c = argInput.charAt(i);
        if (!isTelephoneDigit(c)) return false;
    }
    return true;
}

// ##############################################################

function isCellphone (argInput)

{   var i;
    for (i = 0; i < argInput.length; i++)
    {   
        var c = argInput.charAt(i);
        if (!isDigit(c)) return false;
    }

    return true;
}

// ##############################################################
// ##############################################################

function addMember()
{
if (isEmpty(document.theForm.firstname.value))
        { alert('Please specify your first name.');
        document.theForm.firstname.focus();
        return false;}
 
else if (isEmpty(document.theForm.surname.value))
        { alert('Please specify your surname.');
        document.theForm.surname.focus();
        return false;}
 
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.');
        document.theForm.email.focus();
        return false;}
 
else if ((!isEmpty(document.theForm.cellphone.value)) && ((!isNumeric(document.theForm.cellphone.value)) || (document.theForm.cellphone.value.length!==10)))
        { alert('Please specify a valid cellphone number.');
        document.theForm.cellphone.focus();
        return false;}
 
else if ((isEmpty(document.theForm.telephone.value)) && (isEmpty(document.theForm.cellphone.value)))
        { alert('Please specify either a contact telephone number or cellphone number.');
        document.theForm.cellphone.focus();
        return false;}
 
else if (document.theForm.residence.selectedIndex==0)
        { alert('Please specify your city of residence.');
        document.theForm.residence.focus();
        return false;}
 
else if (isEmpty(document.theForm.username.value))
        { alert('Please specify a username. We recommend using your a-mail address as your username.');
        document.theForm.username.focus();
        return false;}
 
else if (isEmpty(document.theForm.password.value))
        { alert('Please specify a password.');
        document.theForm.password.focus();
        return false;}
 
else if (isEmpty(document.theForm.password1.value))
        { alert('Please confirm your password.');
        document.theForm.password1.focus();
        return false;}

else if (document.theForm.password.value !== document.theForm.password1.value)
        { alert('Your password confirmation does not match your password. Please try again.');
        document.theForm.password1.focus();
        return false;}
 
else
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function updateMember()
{
if (isEmpty(document.theForm.firstname.value))
        { alert('Please specify your first name.');
        document.theForm.firstname.focus();
        return false;}
 
else if (isEmpty(document.theForm.surname.value))
        { alert('Please specify your surname.');
        document.theForm.surname.focus();
        return false;}
 
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.');
        document.theForm.email.focus();
        return false;}
 
else if ((!isEmpty(document.theForm.cellphone.value)) && ((!isNumeric(document.theForm.cellphone.value)) || (document.theForm.cellphone.value.length!==10)))
        { alert('Please specify a valid cellphone number.');
        document.theForm.cellphone.focus();
        return false;}
 
else if ((isEmpty(document.theForm.telephone.value)) && (isEmpty(document.theForm.cellphone.value)))
        { alert('Please specify either a contact telephone number or cellphone number.');
        document.theForm.cellphone.focus(); 
        return false;}          
        
else if (document.theForm.residence.selectedIndex==0)
        { alert('Please specify your city of residence.'); 
        document.theForm.residence.focus(); 
        return false;}          
        
else if (isEmpty(document.theForm.password.value))
        { alert('Please specify your new password.');
        document.theForm.password.focus();
        return false;}
 
else if (isEmpty(document.theForm.password1.value))
        { alert('Please confirm your new password.');
        document.theForm.password1.focus();
        return false;}

else if (document.theForm.password.value !== document.theForm.password1.value)
        { alert('Your password confirmation does not match your password. Please try again.');
        document.theForm.password1.focus();
        return false;}
 
else 
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function updatePassword()
{
if (isEmpty(document.theForm.password.value))
        { alert('Please specify your new password.');
        document.theForm.password.focus();
        return false;}
 
else if (isEmpty(document.theForm.password1.value))
        { alert('Please confirm your new password.');
        document.theForm.password1.focus();
        return false;}

else if (document.theForm.password.value !== document.theForm.password1.value)
        { alert('Your password confirmation does not match your password. Please try again.');
        document.theForm.password1.focus();
        return false;}
 
else 
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function sendReminder()
{
if (isEmpty(document.theForm.username.value))
        { alert('Please specify your username.'); 
        document.theForm.username.focus(); 
        return false;}
        
else 
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function sendFeedback()
{
if (isEmpty(document.theForm.fullname.value))
        { alert('Please specify your full name.');
        document.theForm.fullname.focus();
        return false;}
 
else if ((!isNumeric(document.theForm.cellphone.value)) || (isEmpty(document.theForm.cellphone.value) || (document.theForm.cellphone.value.length!==10)))
        { alert('Please specify your cellphone number.');
        document.theForm.cellphone.focus();
        return false;}
 
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.');
        document.theForm.email.focus();
        return false;}
 
else if (document.theForm.province.selectedIndex==0)
        { alert('Please specify your province.');
        document.theForm.province.focus();
        return false;}
 
else if (document.theForm.formtype.selectedIndex==0)
        { alert('Please specify your contact type.');
        document.theForm.formtype.focus();
        return false;}
 
else if (isEmpty(document.theForm.comments.value))
        { alert('Please specify your comments.');
        document.theForm.comments.focus();
        return false;}
 
else
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function sendGuestbook()
{
if (isEmpty(document.theForm.name.value))
        { alert('Please specify your name.');
        document.theForm.name.focus();
        return false;}
 
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.');
        document.theForm.email.focus();
        return false;}
 
else if (isEmpty(document.theForm.comments.value))
        { alert('Please specify your comments.');
        document.theForm.comments.focus();
        return false;}
 
else
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function sendCallMe()
{
if (isEmpty(document.theForm.fullname.value))
        { alert('Please specify your full name.'); 
        document.theForm.fullname.focus(); 
        return false;}
        
else if (isEmpty(document.theForm.telephone.value))
        { alert('Please specify your contact telephone number.'); 
        document.theForm.telephone.focus(); 
        return false;}
        
else if (isEmpty(document.theForm.comments.value))
        { alert('Please specify your comments.'); 
        document.theForm.comments.focus(); 
        return false;}  
        
else 
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function bookStudio()
{
if (isEmpty(document.theForm.firstname.value))
        { alert('Please specify your first name.'); 
        document.theForm.firstname.focus(); 
        return false;}
        
else if (isEmpty(document.theForm.surname.value))
        { alert('Please specify your surname.'); 
        document.theForm.surname.focus(); 
        return false;}  
        
else if ((!isNumeric(document.theForm.telephone.value)) || (isEmpty(document.theForm.telephone.value) || (document.theForm.telephone.value.length!==10)))
        { alert('Please specify your cellphone number.'); 
        document.theForm.telephone.focus(); 
        return false;}          
        
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.'); 
        document.theForm.email.focus(); 
        return false;}                                  
        
else 
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function bookTraining()
{
if (isEmpty(document.theForm.firstname.value))
        { alert('Please specify your first name.'); 
        document.theForm.firstname.focus(); 
        return false;}
        
else if (isEmpty(document.theForm.surname.value))
        { alert('Please specify your surname.'); 
        document.theForm.surname.focus(); 
        return false;}  
        
else if ((!isNumeric(document.theForm.telephone.value)) || (isEmpty(document.theForm.telephone.value) || (document.theForm.telephone.value.length!==10)))
        { alert('Please specify your cellphone number.'); 
        document.theForm.telephone.focus(); 
        return false;}          
 
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.'); 
        document.theForm.email.focus(); 
        return false;}                                  
        
else 
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function addPress()
{
if (isEmpty(document.theForm.fullname.value))
        { alert('Please specify your fullname');
        document.theForm.fullname.focus();
        return false;}

else if (isEmpty(document.theForm.publication.value))
        { alert('Please specify your publication / station / network');
        document.theForm.publication.focus();
        return false;}
 
else if (isEmpty(document.theForm.position.value))
        { alert('Please specify your position');
        document.theForm.position.focus();
        return false;}
 
else if ((!isEmail(document.theForm.email.value)) && (!isEmpty(document.theForm.email.value)))
        { alert('Please specify a valid e-mail address.');
        document.theForm.email.focus();
        return false;}
 
else if ((isEmpty(document.theForm.email.value)) && (isEmpty(document.theForm.telephone.value)) && (isEmpty(document.theForm.cellphone.value)) && (isEmpty(document.theForm.fax.value)))
        { alert('Please specify at least one method of contact.');
        document.theForm.email.focus();
        return false;}
 
else if (isEmpty(document.theForm.submitter.value))
        { alert('Please specify who submitted this request');
        document.theForm.submitter.focus();
        return false;}
 
else if (isEmpty(document.theForm.title.value))
        { alert('Please specify title of who submitted this request');
        document.theForm.title.focus();
        return false;}
 
else
        {
        return true;
        }
}

// ##############################################################
// ##############################################################

function sendEmailTofriend()
{
if (isEmpty(document.theForm.friend_name.value))
        { alert('Please specify your friends name.');
        document.theForm.friend_name.focus();
        return false;}
 
else if ((isEmpty(document.theForm.friend_email.value)) || (!isEmailFriend(document.theForm.friend_email.value)))
        { alert('Please specify your friends e-mail address.');
        document.theForm.friend_email.focus();
        return false;}
 
else if (isEmpty(document.theForm.sender.value))
        { alert('Please specify your name.');
        document.theForm.sender.focus();
        return false;}
 
else if ((isEmpty(document.theForm.email.value)) || (!isEmail(document.theForm.email.value)))
        { alert('Please specify your e-mail address.');
        document.theForm.email.focus();
        return false;}
 
else
        {
        return true;
        }
}

//-->
