// JavaScript Document
function addHit(reference){
    $.ajax({
        url: '/mijnsexprofiel.nl/ajax/addHit.php',
        data: {
            reference: reference,
        },
        type: 'POST',
        dataType: 'json',
    });
}
$(window).load(function(){
    $('#advzoek').click(function(){
        var show = $('#zoekwrap').attr('class');
        if(show === "altSearchWrap"){
            $('.altSearchContent :input').attr('disabled',true);
            $('.altSearchContent').fadeOut('fast');
            $('#zoekwrap').removeClass('altSearchWrap');
            $('#zoekwrap').addClass('searchWrap');
            $('.searchContent :input').removeAttr('disabled');
            $('.searchContent').fadeIn('slow');
            $('#zoektype').val('uitgebreid');
        }
    });
    $('#zoeknaam').click(function(){
        var show = $('#zoekwrap').attr('class');
        if(show === "searchWrap"){
            $('.searchContent').fadeOut('fast');
            $('.searchContent :input').attr('disabled',true);
            $('#zoekwrap').removeClass('searchWrap');
            $('#zoekwrap').addClass('altSearchWrap');
            $('.altSearchContent :input').removeAttr('disabled');
            $('.altSearchContent').fadeIn('slow');
            $('#zoektype').val('naam');
        }
    });
    $('.hoverAction').hover(function(){
        var srcNew = $(this).attr('src').replace('.png','_hover.png');
        $(this).attr('src',srcNew);
    },function(){
        var srcNew = $(this).attr('src').replace('_hover','');
        $(this).attr('src',srcNew);
    });
    $('#showSms').click(function(){
        $('#smsVerify').fadeOut('fast');
        $('#smsPhone').val('');
        setTimeout(function(){
            $('#smsEntry').fadeIn('slow');
        },35);
    });
    $('.thumbFoto img').hover(function(){
        var srcNew = $(this).attr('src').replace('/fotos/thumbs/','/fotos/');
        $('.bigFoto img').attr('src',srcNew);
        $(this).animate({
            'width' : '68',
            'height' : '68'
        },'fast');
    },function(){
        $(this).animate({
            'width' : '65',
            'height' : '65'
        },'fast');
    });                
    $(".openHistory").click(function(){
        var id = $(this).attr("id");
        $('.history').hide();
        $('#'+id+'-history').fadeIn("slow");
        $('#inline').trigger('click');
    });                                                    
    $('div.fullsizeContent .msItem img').hoverIntent({
        over: function(){
            $(this).css('z-index',1004);
            $(this).animate({
                height: 135,
                width: 135
            },350);
        },
        out: function(){

            $(this).animate({
                height: 85,
                width: 85
            },400,function(){
                $(this).css('z-index',1);
            });
        }
    });
});
function bookmarksite(title,url){
    if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print){ // opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
    } 
    else if(document.all)// ie
        window.external.AddFavorite(url, title);
}
if(document.images){
    preload_image = new Image();
    var img_url = new Array();
    img_url[0] = "http://www.mijnsexprofiel.nl/images/btn_aanmelden_hover.png";
    img_url[1] = "http://www.mijnsexprofiel.nl/images/btn_bericht_hover.png";
    img_url[2] = "http://www.mijnsexprofiel.nl/images/btn_buzzer_hover.png";
    img_url[3] = "http://www.mijnsexprofiel.nl/images/btn_cadeau_hover.png";
    img_url[4] = "http://www.mijnsexprofiel.nl/images/btn_contact_hover.png";
    img_url[5] = "http://www.mijnsexprofiel.nl/images/btn_faker_hover.png";
    img_url[6] = "http://www.mijnsexprofiel.nl/images/btn_favorieten_hover.png";
    img_url[7] = "http://www.mijnsexprofiel.nl/images/btn_fullsize_aanmelden_hover.png";
    img_url[8] = "http://www.mijnsexprofiel.nl/images/btn_fupload_hover.png";
    img_url[9] = "http://www.mijnsexprofiel.nl/images/btn_home_hover.png";
    img_url[10] = "http://www.mijnsexprofiel.nl/images/btn_login_hover.png";
    img_url[11] = "http://www.mijnsexprofiel.nl/images/btn_midsize_aanmelden_hover.png";
    img_url[12] = "http://www.mijnsexprofiel.nl/images/btn_overons_hover.png";
    img_url[13] = "http://www.mijnsexprofiel.nl/images/btn_punten_hover.png";
    img_url[14] = "http://www.mijnsexprofiel.nl/images/btn_regels_hover.png";
    img_url[15] = "http://www.mijnsexprofiel.nl/images/btn_vsbericht_hover.png";
    img_url[16] = "http://www.mijnsexprofiel.nl/images/btn_vscadeau_hover.png";
    img_url[17] = "http://www.mijnsexprofiel.nl/images/btn_wprofiel_hover.png";
    img_url[18] = "http://www.mijnsexprofiel.nl/images/btn_zoek_hover.png";
    img_url[19] = "http://www.mijnsexprofiel.nl/images/btn_user_search_hover.png";
    img_url[20] = "http://www.mijnsexprofiel.nl/images/btn_profiel_mini_hover.png";
    img_url[21] = "http://www.mijnsexprofiel.nl/images/btn_profiel_search_hover.png";
    img_url[22] = "http://www.mijnsexprofiel.nl/images/btn_geschiedenis_mini_hover.png";
    img_url[23] = "http://www.mijnsexprofiel.nl/images/btn_favoriet_mini_hover.png";
    img_url[24] = "http://www.mijnsexprofiel.nl/images/btn_cadeau_mini_hover.png";
    img_url[25] = "http://www.mijnsexprofiel.nl/images/btn_buzzer_mini_hover.png";
    img_url[26] = "http://www.mijnsexprofiel.nl/images/btn_uitgb_zoeken_hover.png";
    img_url[27] = "http://www.mijnsexprofiel.nl/images/btn_uitgb_zoeken_naam_hover.png";
    img_url[28] = "http://www.mijnsexprofiel.nl/images/content_search_small_bg.png";
    for(var i in img_url){
        preload_image.src = img_url[i];
    }
}
