// CUFON
/*
Cufon.replace('h4', { fontFamily: 'EurostileBold' });
Cufon.replace('.prodBoks', { 
	fontFamily: 'EurostileBold',
	hover: true
 });
Cufon.replace('.midKollsA a', { 
	fontFamily: 'EurostileBold',
	hover: true
 });
Cufon.replace('.midKollsB a', { 
	fontFamily: 'EurostileBold',
	hover: true
 });
Cufon.replace('.top_right a', { 
	fontFamily: 'EurostileBold',
	hover: true
 });

Cufon.replace('.nettbutikk', { fontFamily: 'EurostileBold' });
Cufon.replace('a.utvalg', { fontFamily: 'EurostileBold' });
*/

// MENU SLIDE
/*
$(document).ready(function(){
	$('.m_nivaa2 ul li').hover(
		function() { $('ul', this).show(); },
		function() { $('ul', this).fadeOut('fast'); });
});
*/

// SEARCH FIELD VALUE SWAP
$(function() {
    swapValues = [];
    $(".swap_value").each(function(i){
        swapValues[i] = $(this).val();
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {
                $(this).val("");
            }
        }).blur(function(){
            if ($.trim($(this).val()) == "") {
                $(this).val(swapValues[i]);
            }
        });
    });

    $('.prodBoks').hover(function(){
           $(this).addClass('over');
    }, function() {
           $(this).removeClass('over');
    });

});

// SLIDESHOW
$('.slide')
.before('<div id="nav">') 
.cycle({
    fx:     'fade',
    speed:   1200,
    timeout: 5000,
    pause:  '1',
    pager:  '#nav'
});

function formatText(index, panel) {
  return index + "";
}

$(function () {

    $('.anythingSlider').anythingSlider({
        easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        startStopped: true,            // If autoPlay is on, this can force it to start stopped
        animationTime: 600,             // How long the slide transition takes
        hashTags: false,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
        stopText: "Stop",               // Stop text
        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
    });
    
    $("#slide-jump").click(function(){
        $('.anythingSlider').anythingSlider(6);
    });
    
});

// IMAGE SWAP
jQuery(document).ready(function(){
	jQuery("a.thumbs").click(function(){
		var largePath = jQuery(this).attr("href");
		var largeAlt = jQuery(this).attr("title");
		var mainpic = jQuery("img#mainpic");
		mainpic.attr({ src: largePath, alt: largeAlt });    
		mainpic.closest('a').attr('href', largePath.replace('_main_', '_original_'));
		return false;
	});
});

