$(document).ready(function()
{
    $("#showOpt").click(function()
    {
        $("#options").toggle(1000,function()
        {
            if($("#showOpt").text() == "Show Options")
            {
                $("#showOpt").html("Hide Options");
            }
            else 
            {
                $("#showOpt").html("Show Options");
            }
             
        });
         
    });
    //end showOpt
     
    $("#file").change(function()
    {
        $("#dispPath").val($("#file").val());
     
    });
    
    
    
  $("input#pwd").click(function()
  {
  	if($("input#pwd").val() == "Enter Password")
  	{
  		$("input#pwd").val("");
  		$("input#pwd").css("color", "#000");
  	};
  }); 
    
  
  $("input#pwd").focusout(function()
  {
  	if($("input#pwd").val().length == 0)
  	{
  		$("input#pwd").css("color", "#ccc");
  		$("input#pwd").val("Enter Password");
  	};
  }); 	
  
  
  $("#ifPwd").change(function()
  {
  	if($("#ifPwd").attr('checked'))
	  {
	  	$("#pwd").css("display", "inline");
	  }
	  else
	  {
	  	$("#pwd").css("display", "none");
	  	$("input#pwd").css("color", "#ccc");
	  	$("input#pwd").val("Enter Password");
	  }
  });
  
  
  $("#pass").click(function()
  {
  	$("#pass").val("");
  	$("#pass").css("color", "#000");
  });
  
    	
});


function checkUpload()
{
	if($("#dispPath").val().length > 0)
	{
		return true;
	}
	else
	{
		$(".errorMsg").html("Please click the browse button and specify a file to be uploaded.");
		$(".errorMsg").css("display", "block");
		return false;
	};
	
	if($("#pwd").val() == "Enter Password" && $("#ifPwd").attr('checked'))
	{
		$(".errorMsg").html("Please enter a valid password (A-Z._-) or uncheck the password checkbox.");
		$(".errorMsg").css("display", "block");
		return false;
	};
}

