﻿
// ####################################################### PFERSDORF ####################################################### //

function activateListImage(Id, categoryName, outputUrl) {
	$('#' + Id).attr('style','list-style-image: url(' + outputUrl + '/library/img/layout/' + categoryName + '_li.png);');
}

function inactivateListImage(Id, categoryName, outputUrl) {
	$('#' + Id).attr('style','list-style-image: url(' + outputUrl + '/library/img/layout/' + categoryName + '_inactive_li.png);');
}

function loadGalleryDetail(picId, pageId) {
	var picCnt = $('#galleryPicCount').html() * 1;
  	var splitPic = picId.split("_");
  	$.ajax({
    	url: '/picGallery.html?view=detail&pic=' +  picId + '&page=' + pageId,
        cache: false,
        type: "POST",
        beforeSend: function() {
        	$('#hideContentTitle').html('Detailansicht wird geladen');
        	showElementById('hideContent');
        	
        },
        success: function(html) {
            $('#content').html(html);
            setTimeout("loadjCarousel(" + splitPic[0] + "," + picCnt +");", 400);	
            
        }
    });
}

function loadjCarousel(startPic, picCnt)
{ 
	$('#mycarousel_' + startPic).jcarousel({
		size: picCnt,
		start: startPic
	});
    
    hideElementById('hideContent');
    $('#hideContentTitle').html('');
}

// ####################################################### GENERAL ####################################################### //

function hideElementById(Id) {
    $('#' + Id).hide();
}

function showElementById(Id) {
    $('#' + Id).show();
}

function showAndHide(showId, hideId) {
    $('#' + showId).show();
    $('#' + hideId).hide();
}

function showTwoAndHide(showId, show2Id, hideId) {
    $('#' + showId).show();
    $('#' + show2Id).show();
    $('#' + hideId).hide();
}

function showAndHideTwo(showId, hideId, hide2Id) {
    $('#' + showId).show();
    $('#' + hideId).hide();
    $('#' + hide2Id).hide();
}

function showAndHideByClass(showClass, hideClass) {
    $('.' + showClass).show();
    $('.' + hideClass).hide();
}

function showHideAndFocus(showId, hideId, focusId) {
    $('#' + showId).show();
    $('#' + hideId).hide();
    $('#' + focusId).focus();    
}

function show2ElementsAndHide(showId, showSecondId, hideId) {
    $('#' + showId).show();
    $('#' + showSecondId).show();
    $('#' + hideId).hide();
}

function showAndHide2Elements(showId, hideId, hideSecondId) {
    $('#' + showId).show();
    $('#' + hideId).hide();
    $('#' + hideSecondId).hide();
}

function addValueToField(Id, value) {
    $('#' + Id).val(value);
}

function addContentToField(Id, content) {
    $('#' + Id).html(content);
}

function hideAjaxGraphics() {
    $('#ajaxGraphics').hide();
}

function showAjaxGraphics() {
    $('#ajaxGraphics').show();
}

function hideAjaxGraphicsCircle() {
    $('#ajaxGraphicsCircle').hide();
}

function showAjaxGraphicsCircle() {
    $('#ajaxGraphicsCircle').show();
}

// ####################################################### DOCUMENT READY ####################################################### //


$(document).ready(function() {
});
