// CUFON
Cufon.replace('.hl_prod h2', {fontFamily: 'ConduitLight'});
Cufon.replace('.hl_prod h3', {fontFamily: 'ConduitBoldItalic'});
Cufon.replace('.kolC h4', {fontFamily: 'ConduitBold'});
Cufon.replace('#sok_resultat_head', {fontFamily: 'ConduitBold'});
Cufon.replace('h5,div#innholdSok h1,div#innholdSok h2', {fontFamily: 'ConduitBold'});
Cufon.replace('.quotes p', {fontFamily: 'ConduitBold'});

// ANYTHINGSLIDER
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: false,        		// 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);
    });
    
});

// LANG SLIDE
$(document).ready(function(){
$('#lang_top').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]);
            }
        });
    });
});

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

// FRONTHOVER
$(document).ready(function(){
       $(".frontFlash p").hover(
           function() { $('.rollover', this).fadeIn('fast'); },
           function() { $('.rollover', this).fadeOut('fast'); });
});

// 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;
	});
});

// SWFOBJECT
$(document).ready( 
	function () { 
		$('#stylebook').flash( 
			{ 
				swf: 'Stylebook.swf', 
				params: { 
					play: true 
				}, 
				height: 494, 
				width: 900 
			} 
		); 
		$('#about').flash( 
			{ 
				swf: 'about_KT_motion_grfx_02.swf', 
				params: { 
					play: false 
				}, 
				height: 494, 
				width: 900 
			} 
		); 
		$('#storeLocateHeader').flash( 
			{ 
				swf: 'storelocator/StoreLocatorHeader.swf', 
				params: { 
					play: false 
				}, 
				height: 256, 
				width: 900 
			} 
		); 
		$('#storeLocator').flash( 
			{ 
				swf: 'storelocator/StoreLocator.swf', 
				params: { 
					play: false 
				}, 
				height: 450, 
				width: 900 
			} 
		); 
	} 
);

