if(top.frames.length != 0)
{
	top.location = self.document.location;
}
if(top.location != document.location.href)
{
	top.location = document.location.href;
}
if(self != top)
{
	top.location = self.location;
}
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)



/* ----------------------- */


function check_email(this_form)
{
	var email = this_form.email.value;
	var filter = /^([\w-]+(?:\.[\w-_]+)*)@((?:[\w-]+\.)*\w[\w-]{0,100})\.([a-z]{2,8}(?:\.[a-z]{2})?)$/i;
	
	if (!filter.test(email))
	{
		alert('Merci d\'entrer un email valide !');
		return false;
	}


  window.open('/email.php?email=' + email, '', ' directories=yes, resizable=yes, scrollbars=yes, toolbar=ues, location=yes, menubar=yes');

	
}










var interval = 1000;
var blink_ids = new Array();
var texts = new Array();
var mctmr;
var nulltext="";
var text_i = "";
var error_msg = "";

function set_mailerror_msg(msg) {
	error_msg = msg;
}

function doBlink() {
   for (var i in blink_ids) {
		obj = document.getElementById(blink_ids[i]);
		if (obj != undefined) {
			if (obj.type == undefined) {
				obj.style.visibility = obj.style.visibility == "" ? "hidden" : ""
			}
			else if(obj.type == "text") {
				if(texts[i] == nulltext)
				obj.value = (obj.value != "") ? "" : texts[i];
			}
		}
	}
}

function startBlink() {
  mctmr = setInterval("doBlink()",interval)
}

function stopBlink() {
	clearInterval(mctmr);
	for (var i in blink_ids) {
		obj = document.getElementById(blink_ids[i]);
		if (obj != undefined) {
			if (obj.type == undefined) {
				obj.style.visibility = ""
			}
			else if (obj.type == "text") {
				obj.value = texts[i];
			}
		}
	}
}

function changetext(value) {
	texts[text_i] = (value == "") ? nulltext : value;
}

function checkBlink() {
	clearInterval(mctmr);
	//document.getElementById('maindiv').onclick = function() {window.open("http://php.net")};
	if (blink_ids.length > 0) {
		for (var i in blink_ids) {
			obj=document.getElementById(blink_ids[i]);
			if (obj != undefined) {
				if(obj.type == "text") {
					text_i=i;
					nulltext=texts[text_i];
					obj.onfocus = stopBlink;
					obj.onblur = startBlink;
					obj.onkeyup = function() {
						changetext(this.value);
					}
				}
			}
		}
		startBlink();
	}
}

/* ----------------------- */


  window.onload = function() {
    var links = document.getElementsByTagName("a");
    for (var i = 0; i < links.length; i++) {
      var rels = links[i].getAttribute("rel");
      if (rels) {
        var testpattern = new RegExp("external");
        if (testpattern.test(rels)) {
          links[i].onclick = function() {
            return !window.open(this.href);
          }
        }
      }
    }
	checkBlink();

	}