// JavaScript Document
		
function CheckEmail(Email)
{
	var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(Email)) 
	{
		return false;
	}
	else
	{
		return true;
	}
}

function ToggleShow(ElID)
{
	if(document.getElementById(ElID).style.display=='none')
	{
		document.getElementById(ElID).style.display='block';
	}
	else
	{
		document.getElementById(ElID).style.display='none';
	}
}


function ShowStatus(StatusHTML)
{
	document.getElementById('statustext').innerHTML=StatusHTML;
}

function CheckFileExt(aFile) 
{ 
    var type = "";
    //create an array of acceptable files
    var validExtensions = new Array(".jpg", ".jpeg", ".gif", ".mp3", ".flv",".swf",".txt",".doc", ".docx",".zip",".rar",".xls", ".csv", ".ppt", ".pdf", ".png", ".wav", ".mpg", ".mpeg", ".mov", ".avi", ".wmv");
    var allowSubmit = false;
    //if our control contains no file then alert the user

        //get the file type
        type = aFile.slice(aFile.indexOf("\\") + 1);
        var ext = aFile.slice(aFile.lastIndexOf(".")).toLowerCase();
        //loop through our array of extensions
        for (var i = 0; i < validExtensions.length; i++) 
        {
            //check to see if it's the proper extension
            if (validExtensions[i] == ext) 
            { 
                //it's the proper extension
                allowSubmit = true; 
            }
        }
    return allowSubmit;
	return true;
}

function GetFileExtension(aFile)
{
	 type = aFile.slice(aFile.indexOf("\\") + 1);
        var ext = aFile.slice(aFile.lastIndexOf(".")).toLowerCase();
	return ext.toLowerCase();
}



