﻿function ValidateSendGame(){
    var isValid = true;    
    var name = $(".side .SendGame .name input");
    var url = $(".side .SendGame .url input");
    var desc = $(".side .SendGame .desc input");
    
    if( name.val() == '' )
	{	
		ShowError(name);
		isValid = false;
	}
	
	if( url.val() == '' )
	{
		ShowError(url);
		isValid = false;
	}
    
    return isValid;
}

function ShowError( input ){		
	//The color you want to fade too
	var fadeColor = "#ff4141"; 
	//Fade to the new color11.			
	//input.animate({'borderColor':fadeColor}, 750)
	input.highlightFade({speed:1000,attr:'borderColor',start:'#92e5f3',end:'#ff4141'});

	
	//Hide the error color after 4000ms
	setTimeout( function(){HideError(input);}, 4000 );
}

function HideError( input ){
	var originalColor = "#92e5f3";	
	//input.animate({'borderColor':originalColor},750) 
	input.highlightFade({speed:1000,attr:'borderColor',start:'#ff4141',end:'#92e5f3'});
}
