/**
*	Site-specific configuration settings for Highslide JS
*/
hs.graphicsDir = 'mysite/javascript/highslide/graphics/';
hs.showCredits = false;
hs.outlineType = 'custom';
hs.padToMinWidth = true;
hs.maxWidth = 980;
hs.maxHeight = 413;
hs.allowMultipleInstances = false;
hs.expandDuration = 500;

// Norwegian (bokmål) language strings
hs.lang = {
	cssDirection: 'ltr',
	loadingText: 'Laster...',
	loadingTitle: 'Klikk for å avbryte',
	focusTitle: 'Klikk for å flytte fram',
	fullExpandTitle: 'Utvid til full størrelse',
	creditsText: 'Drevet av <i>Highslide JS</i>',
	creditsTitle: 'Gå til hjemmesiden til Highslide JS',
	previousText: 'Forrige',
	nextText: 'Neste',
	moveText: 'Flytt',
	closeText: 'Lukk',
	closeTitle: 'Lukk (esc)',
	resizeTitle: 'Endre størrelse',
	playText: 'Spill av',
	playTitle: 'Vis bildeserie (mellomrom)',
	pauseText: 'Pause',
	pauseTitle: 'Pause (mellomrom)',
	previousTitle: 'Forrige (pil venstre)',
	nextTitle: 'Neste (pil høyre)',
	moveTitle: 'Flytt',
	fullExpandText: 'Full størrelse',
	number: 'Bilde %1 av %2',
	restoreTitle: 'Tips: Bruk piltastene for forrige og neste.'
};

// gallery config object
var hus = {
	slideshowGroup: 'hus',
	targetY: 'Content 0px',
	captionEval: 'this.a.title',
	align: 'center'
};
var bygard = {
	slideshowGroup: 'bygard',
	targetY: 'Content 0px',
	captionEval: 'this.a.title',
	align: 'center'
};
var hytte = {
	slideshowGroup: 'hytte',
	targetY: 'Content 0px',
	captionEval: 'this.a.title',
	align: 'center'
};
var mediegalleri = {
	slideshowGroup: 'mediegalleri',
	targetY: 'Content 0px',
	captionEval: 'this.a.rel',
	align: 'center'
};

var frontimgtags = {
	slideshowGroup: 'frontimgtags',
	outlineType: null,
	wrapperClassName: 'frontimgtag'
};

function openYouTube(opener) {
    var returnValue;
    
    // Safari Mobile doesn't have Flash, so we just let the device use the built-in 
    // YouTube viewer.
    
        
    if (/(iPhone|iPod|iPad)/.test(navigator.userAgent)) {
        opener.href = opener.href.replace('/v/', '/watch?v=');
        returnValue = true;        
    }

    else returnValue = hs.htmlExpand(opener, { 
        objectType: 'swf', 
        objectWidth: 480, 
        objectHeight: 385, 
        width: 480, 
        swfOptions: { 
            params: { 
                allowfullscreen: 'true' 
            }
        },
        src: opener.href.replace("watch?", "").replace("=", "/")+'&fs=1&autoplay=1', // convert from Youtube page to movie
        maincontentText: 'You need to upgrade your Flash player'
    });
    
    return returnValue;
};
