function rewind(elem)
{
 window.location=elem;
 return false;
}
function gonextcontacts(elem)
{      alert(0)
 window.location=elem;
 return false;
}

function trimLeft(str) {
  return str.replace(/^\s+/, '');
}

function trimRight(str) {
  return str.replace(/\s+$/, '');
}

function trimBoth(str) {
  return trimRight(trimLeft(str));
}

function trimSpaces(str) {
  return str.replace(/\s{2,}/g, ' ');
}

function isValidEmail(email)
{
 return (/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i).test(email);
}
function  create_event(){
//alert('temporary unvailable') ;
}
function  insert_into_event(){
//alert('temporary unvailable') ;
}

function change_lang(lang){

var req = new JsHttpRequest();
   req.onreadystatechange = function(){
                            if (req.readyState == 4){   //alert(req.responseText)
                                    if(req.responseText==1){
                                    window.location.reload();

                                    }
      						    }
      				        }
req.open(null, "../scripts/change_lang.php", true);
req.send( { lang:lang } );
}



