﻿function x(a) { alert(a) }
$().ready(function() {

    $('#test1').rater({
        url: 'vote.php',
        mediapath: '',
        value: 3
    });

    $('#test2').rater({
        url: 'vote.php',
        mediapath: '',
        value: 2
    });


});

(function ($) {
        $.fn.cross = function (options) {
            return this.each(function (i) { 
                // cache the copy of jQuery(this) - the start image
                var $$ = $(this);
                
                // get the target from the backgroundImage + regexp
                var target = $$.css('backgroundImage').replace(/^url|[\(\)'"]/g, '');

                // nice long chain: wrap img element in span
                $$.wrap('<span style="position: relative;"></span>')
                    // change selector to parent - i.e. newly created span
                    .parent()
                    // prepend a new image inside the span
                    .prepend('<img>')
                    // change the selector to the newly created image
                    .find(':first-child')
                    // set the image to the target
                    .attr('src', target);

                // the CSS styling of the start image needs to be handled
                // differently for different browsers
                if ($.browser.msie || $.browser.mozilla) {
                    $$.css({
                        'position' : 'absolute', 
                        'left' : 0,
                        'background' : '',
                        'top' : this.offsetTop
                    });
                } else if ($.browser.opera && $.browser.version < 9.5) {
                    // Browser sniffing is bad - however opera < 9.5 has a render bug 
                    // so this is required to get around it we can't apply the 'top' : 0 
                    // separately because Mozilla strips the style set originally somehow...                    
                    $$.css({
                        'position' : 'absolute', 
                        'left' : 0,
                        'background' : '',
                        'top' : "0"
                    });
                } else { // Safari
                    $$.css({
                        'position' : 'absolute', 
                        'left' : 0,
                        'background' : ''
                    });
                }

                // similar effect as single image technique, except using .animate 
                // which will handle the fading up from the right opacity for us
                $$.hover(function () {
                    $$.stop().animate({
                        opacity: 0
                    }, 150);
                }, function () {
                    $$.stop().animate({
                        opacity: 1
                    }, 950);
                });
            });
        };
        
    })(jQuery);
    
    // note that this uses the .bind('load') on the window object, rather than $(document).ready() 
    // because .ready() fires before the images have loaded, but we need to fire *after* because
    // our code relies on the dimensions of the images already in place.
    $(window).bind('load', function () {
        $('img.fade').cross();
    });





$(document).ready(function() {
	$('.fadeButtonLogout').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});	
	
	$('.fadeButtonFavorites').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});	
	$('.fadeButtonTop1').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fadeButtonTop2').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fadeButtonTop3').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fadeButtonTop4').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fadeButtonTop5').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   



	$('.fade1').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade2').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade3').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade4').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade5').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
						   


$('.fade1off').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade2off').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade3off').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade4off').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   
	$('.fade5off').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(150, 1);
	  }, function () {
	    $span.stop().fadeTo(950, 0);
	  });
	});						   





    $('a.previewLink').cluetip({ splitTitle: '|' });
    $('a.previewLink2').cluetip({ splitTitle: '|' });

    $('#carousel').Carousel(
				{
				    itemWidth: 60,
				    itemHeight: 89,
				    itemMinWidth: 60,
				    items: 'a',
				    reflections: .5,
				    rotationSpeed: 2.4
				}
			);

    $("#myController").jFlow({
        slides: "#mySlides",
        controller: ".jFlowControl", // must be class, use . sign
        slideWrapper: "#jFlowSlide", // must be id, use # sign
        selectedWrapper: "jFlowSelected",  // just pure text, no sign
        width: "330px",
        height: "150px",
        duration: 400,
        prev: ".jFlowPrev", // must be class, use . sign
        next: ".jFlowNext" // must be class, use . sign
    });

    settings1 = {
        tl: { radius: 5 },
        tr: { radius: 5 },
        bl: { radius: 5 },
        br: { radius: 5 },
        antiAlias: true,
        autoPad: false,
        validTags: ["div"]
    }

    /*
    Usage:

      newCornersObj = new curvyCorners(settingsObj, classNameStr);
    newCornersObj = new curvyCorners(settingsObj, divObj1[, divObj2[, divObj3[, . . . [, divObjN]]]]);
    */
    var myBoxObject1 = new curvyCorners(settings1, "myBox");
    myBoxObject1.applyCornersToAll();
});


new jqRollover("a.rollover");

new jqAccordion({
    trigger: "mouseover",
    animation: "slide",
    container: "#leftNavigation",
    item: "div.item",
    bodyHeight: "310px",
    header: "h2 a",
    body: "div.body"
});

  // jQuery.noConflict();
  
  // VAR
  
  var inPullNav = false;  
  
  // RUN
  
  var corners = '<img src="/templates/VadaboomEffektGreen/images/corner_white_tl.png" class="tl" />'+
  							'<img src="/templates/VadaboomEffektGreen/images/corner_white_tr.png" class="tr" />'+
  							'<img src="/templates/VadaboomEffektGreen/images/corner_white_bl.png" class="bl" />'+
  							'<img src="/templates/VadaboomEffektGreen/images/corner_white_br.png" class="br" />';
  

 jQuery(document).ready(function(){
	jQuery('#parallax').jparallax({});
  });


