
function view_gallery_pic(id,check) {
  window.open('index.php?page=23833&im_id='+id+'&im_check='+check+'&disp_top=0','viewpic','STATUS,RESIZABLE,scrollbars=no,width=600,height=400,LEFT=100,TOP=100');
} 

function view_pic(id,check,popup) {
  window.open('index.php?page=23933&im_id='+id+'&im_check='+check+'&im_taille='+popup+'&disp_top=0','viewpic','STATUS,RESIZABLE,scrollbars=no,width=600,height=400,LEFT=100,TOP=100');
} 

function page_email(page_querystring) {
  window.open('http://www.enseignement.be/agers4/site/index.php?page=24911&parm='+page_querystring,'','STATUS,RESIZABLE,scrollbars=yes,width=700,height=700,LEFT=100,TOP=100');
} 

function gourl(u) {
  window.open('http://www.enseignement.be/agers4/index.php?m=redirect_url&top=no&url='+u,'','STATUS,RESIZABLE,scrollbars=yes,width=600,height=400,LEFT=100,TOP=100');
} 

function printthispage(URL) {
  w=window.open('http://www.enseignement.be/index.php?'+URL+'&disp_top=0','printthispage','STATUS,RESIZABLE,scrollbars=yes,width=400,height=400,LEFT=100,TOP=100');
  w.focus();
  t=window.setTimeout("printthispage2(w);",3000);
  
} 

function printthispage2(w) {
  w.print();
  w.close();
} 

function str_replace (search, replace, subject){
  var result = '';
  var oldi = 0;
  for (ii = subject.indexOf (search); ii > -1; ii = subject.indexOf (search, ii))
  {
       result += subject.substring (oldi, ii);
       result += replace;
       ii += search.length;
       oldi = ii;
  }
  return result + subject.substring (oldi, subject.length);
}

function trim (myString){
  return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
}

function go_overlib(titre,texte) {
overlib('<b>'+titre+'</b><br>' + texte, TEXTCOLOR, '#ffffff', TEXTSIZE, 2, WIDTH, 250, BACKGROUND,'img/localinfo_bg.gif',PADX, 10, 10, PADY, 10, 10);
} 

function is_email(emailAddressString) {	
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; // valid
	var sendTo = emailAddressString;
	if (!sendTo.match(reg1) && sendTo.match(reg2)) {
		return true;
	}	else {
		return false;
	}
}

function form_select_option_on_value(e,v){
  l=e.length;
  i=0;
  while (i<l)  {
    if (e.options[i].value==v){
      e.selectedIndex=i;
      i=l;
    }
    i=i+1;
  }
}
function form_radio_option_on_value(e,v){
  l=e.length;
  i=0;
  while (i<l)  {
    if (e[i].value==v){
      e[i].checked=true;
      i=l;
    }
    i=i+1;
  }
}
function is_numeric(s){                                                  
  return (s - 0) == s && s.length > 0;
}
function is_integer(s) {
return (s.toString().search(/^-?[0-9]+$/) == 0);
}
