function trim(str){
    while (str.substring(0,1) == ' '){
        str = str.substring(1, str.length);
    }
    while (str.substring(str.length-1, str.length) == ' '){
        str = str.substring(0,str.length-1);
    }
    return str;
}


function search(f){
  var form = trim(document.forms[f].elements['masasearcn'].value);
  if(form  == ''){
    return false;
  }
  form = form.replace('://', '');
  form = form.replace(/ /g, '+');
  location.replace('/search/'+encodeURI(form)+'/complete/false');
}

function searchmasa(f,url){
  var form = trim(document.forms[f].elements['masasearcn'].value);
  if(form  == ''){
    return false;
  }
  form = form.replace('://', '');
  form = form.replace(/ /g, '+');
  location.replace(url+'/search/'+encodeURI(form));
}

function contrologin(){
  var email = jQuery("#email").val();
  var pass  = jQuery("#password").val();
  
  if(email == ''){
    jQuery("#email").css('border', '1px solid #f00');
  }
  
  if(pass == ''){
    jQuery("#password").css('border', '1px solid #f00');
  }
  
  if(email == '' || pass == ''){
    return false;
  }
}

