jQuery(document).ready(function() {
    jQuery('#slider-news').append(jQuery('.region-highlighted'));
    
    // admin toolbar hack
    if(jQuery('#toolbar').length == 1){
        jQuery('#main-wrapper').css('top','-63px');
        jQuery('#menu-shadow').css('top','143px');
    }
    // admin toolbar hack
    
    var imgHover = Drupal.settings.basePath + "sites/fc-eindhoven.nl/themes/blue/img/slider-hover.png";
    var activeDt = jQuery('dl#rotator-list').find('dd.r-active').next().find('.rotator-hover');
    jQuery(activeDt).css('background-image','url('+imgHover+')');

    //------------------------

    jQuery('dt').mouseenter(function(e){
        
        Fb.log(this);
        
        jQuery('span.rotator-hover').css('background-image','url()');
        jQuery(jQuery(this).find('.rotator-hover')).css('background-image','url('+imgHover+')');
        var img = jQuery(jQuery(this).next()).find('img').clone();
        
        jQuery('#rotator-content').html(img.removeClass('rotator-img').css('display','block'));
        jQuery('#rotator-content').hide();
        jQuery('#rotator-content').fadeIn(500);
    });
    //------------------------
    

    
    
});;
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Fb logging namespace
 */
Fb = {}
Fb.log = function(msg)
{
    window.console && console.log && console.log( msg );
}

BN = {
    j : jQuery,
    arrImages : [],
    images : []
}

BN.run = function(){
    //Fb.log('hi therrrr.');
    BN.removeImages();
    BN.getImageList();
    //BN.rotateImages();
    setTimeout("BN.rotateImages()", 4*1000);
}

BN.removeImages = function(){
    j = this.j;
    this.images = j('#partner-banner a');
    j('#partner-banner').hide();
}

BN.getImageList = function(){
    //Fb.log(this.images);
}


var newBanner = 0;
BN.rotateImages = function(){
    j = this.j;
    newBanner = newBanner + 1;
    if (newBanner >= this.images.length) {
        newBanner = 0;
    }
    //Fb.log(newBanner);
    //Fb.log(j(this.images[i]).attr('src'));
    j('#banner-container').html(this.images[newBanner]);
    //Fb.log(this.images[newBanner]);
    setTimeout("BN.rotateImages()", 2*1000);
}
/*
 * Document ready what to do without
 */
jQuery(document).ready(function() {
    (function(j) {  
        BN.run();    
    })(jQuery)
});



var images = jQuery('#partner-banner a');
//Fb.log(images);
jQuery('#partner-banner').hide();

//Fb.log(images);
//for(i=0;i<=images.length;i++){
    //Fb.log(images[i]);
//}

var bannerImg = new Array();
// Enter the names of the images below
bannerImg[0]="image_jss.gif";
bannerImg[1]="image_js.gif";
bannerImg[2]="image_wr.gif";

var newBanner = 0;
var totalBan = bannerImg.length;
var totalBan = images.length;

function cycleBan() {
    newBanner++;
    if (newBanner == totalBan) {
        newBanner = 0;
    }
    
    //document.banner.src=images[newBanner];
    setTimeout("cycleBan()", 4*1000);
}
window.onload=cycleBan;

/*

<!-- Paste this code into the HEAD section of your HTML document.
     You may need to change the path of the file.  -->

<script type="text/javascript" src="banner.js.js"></script>



<!-- Paste this code into the BODY section of your HTML document  -->

<img src="image_jss.gif" name="banner">
<p><div align="center">
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</div><p>

*/
;
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * 
 * please remove or improve (RJC)
 * 
 */
MN = {
    j : jQuery,
    form : '#user-login-form',
    formSubmit : '.form-submit',
    formUserLogin : '#user-login-form',
    formUserLoginPasswordField : '#edit-pass'
}
MN.run = function(){
    MN.moveReadMore();
    MN.loginFormSubmit();
    MN.j(MN.formSubmit).remove();
    MN.socialIcons();
    MN.resetSocialIcons();
    
     MN.j('table#sociale-media').mouseleave(function(){
        console.log('out');
        MN.resetSocialIcons();
    });
    
}


MN.resetSocialIcons = function(){

    
    MN.j('table#sociale-media > tbody > tr > td > a  ').each(function(){
                  
        //Fb.log(this);
                        
        var id =MN.j(this).find('img').attr('id');
        var img = MN.j(this).find('img').attr('src');
  
        switch(id)
        {
            case 'flog':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/bl-flogs30.png';
                break;
            case 'youtube':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/bl-youtube.png';
                break;
            case 'hyves':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/bl-hyves.png';
                break;
            case 'facebook':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/bl-facebook.png';
                break;
            case 'rss':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/bl-rss.png';
                break;
            case 'twitter':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/bl-twitter.png';
                break;
        }
        MN.j(this).find('img').attr('src',img);
                  
    });
}

MN.moveReadMore = function(){
    
   MN.j('.submitted').each(function(){
       MN.j(this).next().append(this); 
    });

    
    
    MN.j('.node-readmore ').each(function(){
        var link = MN.j(this).find('a');
        MN.j(link).text('   lees verder');
        MN.j(this).parent().parent().find('p:last').append(link); 
    });
    
    MN.j('.node > ul.links ').remove();
}

MN.socialIcons = function(){
        
   // MN.j('table#sociale-media').mouseout(function(){
     //   MN.resetSocialIcons();
    //});
    
    
    MN.j('table#sociale-media > tbody > tr > td > a  ').hover(function(){

        id =MN.j(this).find('img').attr('id');
        img = MN.j(this).find('img').attr('src');
  
        switch(id)
        {
            case 'flog':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/flogs30.png';
                break;
            case 'youtube':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/youtube.png';
                break;
            case 'hyves':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/hyves.png';
                break;
            case 'facebook':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/facebook.png';
                break;
            case 'rss':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/rss.png';
                break;
            case 'twitter':
                img = '/sites/fc-eindhoven.nl/themes/blue/img/icon/twitter.png';
                break;
        }
        MN.resetSocialIcons();
        MN.j(this).find('img').attr('src',img);
    });
}

MN.loginFormSubmit = function(){
    MN.j(MN.formUserLoginPasswordField).keypress(function(e) {
        if(e.which == 13) {
            MN.j(MN.formUserLogin).submit();
        }
    });
}
MN.log = function(msg){
    window.console && console.log && console.log( msg );
}
jQuery(document).ready(function() {
    (function(j) {
        MN.run();    
    })(jQuery)
});


;

