/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function init(){
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
            anchor.target = "_blank";
    }
}

function checkFormFields(form){
    var elements=form.elements;
    for(var i=0; i<elements.length; i++){
        if(elements[i].className=='txt' && (elements[i].value==''|| elements[i].value.toString().toLowerCase().indexOf("http") >= 0)){
            elements[i].focus();
            alert('Please fill in some contents - links not allowed');
            return false;
        }
        if(elements[i].className=='number' && isNaN(elements[i].value)){
            elements[i].focus();
            alert('You have to enter a number');
            return false;
        }
    }
    return true;
}

function checkPasswords(form){
    if(form.password.value == form.password2.value){
        return true
    }
    else{
        alert("Your passwords don't match")
        form.password.focus()
        return false
    }
}


