// RANDOM HEADER IMAGE START //
// Set up the image files to be used.
var theImages = new Array()

// To add more image files, continue with the
// pattern below, adding to the array.
theImages[0] = 'HeaderImage1.jpg'


var j = 0
var p = theImages.length;

var preBuffer = new Array()

for (i = 0; i < p; i++){
    preBuffer[i] = new Image()
    preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

// RANDOM HEADER IMAGE END //

function showShops(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}

function countCheckedBrandBoxed()
{
    
}

$(document).ready(function() {
    swapValues = [];
    
    $(".WaterMark").each(function(i){
        swapValues[i] = $(this).val();
            if ($(this).val() == swapValues[i]) {
                $(this).css("color", "#999");
            }
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {
                $(this).val("");
                $(this).css("color", "#FFF");
            }
        }).blur(function(){
            if ($.trim($(this).val()) == "") {
                $(this).val(swapValues[i]);
                $(this).css("color", "#999");
            }
        });
    });
    
    $(".OfferRequestBrandList input").each(function(i){
        
        $(this).click(function(){
            
            if( $(".OfferRequestBrandList input:checkbox:checked").length > 2 )
            {
                alert('Er mogen maximaal 2 merken geselecteerd worden');
                return false;
            }
            
        });
        
    });
    
    $("input:text.ShirtsShotsSocks").each(function(i){
        $(this).change(function () {
            if($(this).val() != "")
            {
                $(".ShirtsShotsSocks input:checkbox").attr('checked', true);
            }
        });
    });
    $("input:text.Shirts").each(function(i){
        $(this).change(function () {
            if($(this).val() != "")
            {
                $(".Shirts input:checkbox").attr('checked', true);
            }
        });
    });
    $("input:text.TrainingSuits").each(function(i){
        $(this).change(function () {
            if($(this).val() != "")
            {
                $(".TrainingSuits input:checkbox").attr('checked', true);
            }
        });
    });
    $("input:text.SportBags").each(function(i){
        $(this).change(function () {
            if($(this).val() != "")
            {
                $(".SportBags input:checkbox").attr('checked', true);
            }
        });
    });
    $("input:text.CoachJacks").each(function(i){
        $(this).change(function () {
            if($(this).val() != "")
            {
                $(".CoachJacks input:checkbox").attr('checked', true);
            }
        });
    });
    
    
});


