	function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function () {
            oldonload();
            func();
        }
    }
}

 //liaison popup
function prepareLinks() {
    if (! document.getElementsByTagName ) return false;
    var links = document.getElementsByTagName("a");
    for (var i = 0; i < links.length; i++) {
        if (links[i].className == "popup") {
            links[i].onclick = function () {
                popUp(this .getAttribute("href"));
                return false;
            }
        }
    }
}

function popUp(winURL) {
    window.open(winURL, "popup", "toolbar=0,location=0,directories=0,scrollbars=1");
}


//assurance reconnaissance balise pour IE
function baliseOk(){
document.createElement('header');
document.createElement('nav');
document.createElement('article');
document.createElement('section');
document.createElement('hgroup');
document.createElement('footer');
}


//Attribute supporte pour html5
function elementSupportsAttribute(element,attribute){var testAttribute = document.createElement(element);        if(attribute in testAttribute){return true;}else{return false;}}

//Type supporte pour html5
function inputSupportsType(testType){
var inputTest = document.createElement('input');
inputTest.setAttribute('type',testType);
if(inputTest.type == 'text'){
return false;
}else{
return true;
}
}
/*
//test
function testInputAttribute(){
if(!elementSupportsAttribute('input','autofocus')){
document.getElementById('status').focus();
};
}
*/
/*reconnaissance email type*/
function testInputType(){
if(!inputSupportsType('email')){
alert('no reconnu type');
};

}

function overForm() {
/*permet de dépasser la non reconnaissance de :hover en IE*/
if (!document.getElementsByTagName) return false;
if (!document.getElementById) return false;
var navRoot = document.getElementsByTagName("button") || document.getElementById('send');
for (i=0; i<navRoot.length; i++) {
navRoot[i].onmouseover=function() {
this.className +=" over";
}

navRoot[i].onmouseout=function() {
this.className =this.className.replace(" over", "");

}

}
}
//Chargement
addLoadEvent(overForm);
addLoadEvent(baliseOk);
addLoadEvent(prepareLinks);
addLoadEvent(elementSupportsAttribute);
//addLoadEvent(testInputAttribute);
addLoadEvent(inputSupportsType);
//addLoadEvent(testInputType);


