
function show_login_error(redirect)
{
	if (redirect)
	{
	
		jQuery.fn.colorbox({inline:true, href:"#login_message",overlayClose:false,onClosed: function(){
			location.href="/";
		}});
	} else {
		jQuery.fn.colorbox({inline:true, href:"#login_message",overlayClose:false});
	}
}

function loading()
{
	jQuery.fn.colorbox({html:"Loading...",overlayClose:false});
}

function show_fp_error()
{

		jQuery.fn.colorbox({inline:true, href:"#fp_message",overlayClose:false});

}

$(document).ready(function(){
	jQuery("a[rel='forgot']").colorbox({inline:true, href:"#forgot_password",overlayClose:false});
	jQuery("a[rel='terms']").colorbox({width:"90%"});
	jQuery("a[rel='privacy']").colorbox({width:"90%"});
	
});

function TrimString(sInString){
	sInString = sInString.replace(/ /g," ");
	return sInString.replace(/(^\s+)|(\s+$)/g, "");
}

function check_password(value)
{
	div_id="#my_confirmation_div";
	if (value!=jQuery("#my_password").val())
	{
		jQuery(div_id+"> img").attr("src","/images/error.gif");
	} else 
	{
		jQuery(div_id+"> img").attr("src","/images/pic.gif")
	}
	jQuery(div_id).show();
}
function check_empty(element,value)
{
	id="#"+element[0].id
	div_id=id+"_div"

	if (TrimString(value)=="")
	{
		jQuery(div_id+"> img").attr("src","/images/error.gif");
	} else 
	{
		jQuery(div_id+"> img").attr("src","/images/pic.gif")
	}
	jQuery(div_id).show();
}
