// photojojo bag store
// @author Jamie Wilkinson <http://tramchase.com>

String.prototype.trim=function(){
    return this.replace(/^\s*|\s*$/g,'');
}

String.prototype.ltrim=function(){
    return this.replace(/^\s*/g,'');
}

String.prototype.rtrim=function(){
    return this.replace(/\s*$/g,'');
}


$(document).ready(function(){
  
  // flashing
  $('#flash').hide();
  if($('#flash').html().trim().length > 0)
    $('#flash').show('fast');
  setTimeout("$('#flash').fadeOut();", 4000);
  
  // jq file uploadatron
  
});


function enableNext(enable) {
  if(enable) {
    console.log("ENABLING next");
    $("input:submit",$('form')).attr("disabled",false);
  }
  else {
    console.log("disabling next :(");
    $("input:submit",$('form')).attr("disabled",true);
  }
}
