
/* HIGHSLIDE HELPER FUNCTIONS */

hs.graphicsDir = '../../include/api/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.dimmingOpacity = 0.8;
hs.outlineType = 'rounded-white';
hs.captionEval = 'this.thumb.alt';
hs.marginBottom = 105 // make room for the thumbstrip and the controls
hs.numberPosition = 'caption';
hs.showCredits = 0;

// Add the slideshow providing the controlbar and the thumbstrip
hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	overlayOptions: {
		className: 'text-controls',
		position: 'bottom center',
		relativeTo: 'viewport',
		offsetY: -60
	},
	thumbstrip: {
		position: 'bottom center',
		mode: 'horizontal',
		relativeTo: 'viewport'
	}
});	
hs.lang = {
	loadingText :     'Laster...',
	loadingTitle :    'Klikk for å avbryte',
	focusTitle :      'Klikk for å flytte fram',
	fullExpandText :  'Full størrelse',
	fullExpandTitle : 'Utvid til full størrelse',
	creditsText :     'Drevet av <i>Highslide JS</i>',
	creditsTitle :    'Gå til hjemmesiden til Highslide JS',
	previousText :    'Forrige',
	previousTitle :   'Forrige (pil venstre)',
	nextText :        'Neste',
	nextTitle :       'Neste (pil høyre)',
	moveText :        'Flytt',
	moveTitle :       'Flytt',
	closeText :       'Lukk',
	closeTitle :      'Lukk (esc)',
	resizeTitle :     'Endre størrelse',
	playText :        'Spill av',
	playTitle :       'Vis bildeserie (mellomrom)',
	pauseText :       'Pause',
	pauseTitle :      'Pause (mellomrom)',
	number :          'Bilde %1 av %2',
	restoreTitle :    'Klikk for å lukke bildet, klikk og dra for å flytte. Bruk piltastene for forrige og neste.'
};


/* JQUERY HELPER FUNCTIONS */
jQuery(document).ready(function() { 
    // Lage bildegalleri
    var link = jQuery(".Body").find("a[href*='image_listgroup.asp']");
    if (link.length) {

        var url = link.attr("href");

        var catId = 0;
        var showAll = 0;
        var arrRequestVars = url.split("?");
        arrRequestVars = arrRequestVars[1].split("&");

        for (i = 0; i < arrRequestVars.length; i++) {
            var arrRequestVar = arrRequestVars[i].split("=");
            if (arrRequestVar[0] == "iGroupId") {
                catId = arrRequestVar[1];
            }
            if (arrRequestVar[0] == "showAll") {
                showAll = arrRequestVar[1];
            }
        }
        jQuery.get("../../include/api/load_images.asp", { id: catId, multi: showAll },
		function(result) {
		    link.replaceWith(result);
		});
    }
    jQuery(".Tips").click(function() {
    if (jQuery("#TipFrame").css("display") == "none") {
        jQuery("#TipFrame").show("fast");
        } else {
        jQuery("#TipFrame").hide("fast");
        }
    });
    jQuery(".Forum").click(function() {
        ShowHideForum();
    });
    jQuery(".CommentForumLink").click(function() {
        ShowForum();
    });
});	
function ShowHideForum(){
    if (jQuery("#ForumLogin").css("display") == "none") {
        jQuery("#ForumLogin").show("fast");
	}else{
	jQuery("#ForumLogin").hide("fast");
	}
} 
function ShowForum(){
    if (jQuery("#ForumLogin").css("display") == "none") {
        jQuery("#ForumLogin").show("fast");	
	}	
	document.location.href = "#ForumPosition";
} 
