function launchwindow(url2,w1,h1){
   var cool=window.open(url2, "cool", "resize=no, status=no,toolbar=yes,scrollbars=yes,menubar=yes,width="+w1+",height="+h1);
   cool.focus();
}


function changeImg(sUrl, sDesc) {
    document.getElementById('mainImage').src = 'http://www.yachtfocus.com/uploads/' + sUrl;
    if (document.getElementById('mainImage').width > 480) {
        document.getElementById('mainImage').width = 480;
    } else {
        document.getElementById('mainImage').width = document.getElementById('mainImage').width;
    }
}


function makeRowLightGrey(elem){
    elem.style.backgroundColor = '#EFEFEF';    
}

function makeRowGrey(elem){
    elem.style.backgroundColor = '#D9D9D9';    
}


function checkContactForm(){
    var requiredFields = new Array("naam*", "email*", "email_controle*", "bericht*");
    var msgBox ="";
    
    for(var i=0; i < requiredFields.length;i++) {
        if(document.getElementById(requiredFields[i]).value == ''){
            document.getElementById(requiredFields[i]).style.border='2px solid #987108';
            msgBox += requiredFields[i] + "\n";
        } else {
            document.getElementById(requiredFields[i]).style.border='1px solid #1C4281';
        }
    }
    
    if(document.getElementById('email*').value != document.getElementById('email_controle*').value){
        msgBox += 'email* \n';
        document.getElementById('email*').style.border='2px solid #987108';
        document.getElementById('email_controle*').style.border='2px solid #987108';
    }
    
    
    if(msgBox != ''){
        return false;
    }
    
    return true;
}

$(document).ready(function() {
	$(".lifeboat_thumb").hover(function(){
		var image = $(this).attr('rel');
		$("#mainImage").attr("src", image); ;
	});
	$(".pilotboat_thumb").hover(function(){
		var image = $(this).attr('rel');
		$("#mainImage").attr("src", image); ;
	});
});
