var host = window.location.hostname;
var totalamount;

$(document).ready(function(){

		// initialize checkbox style

		$('input[artothek]:checkbox').checkbox({cls:'jquery-artothek-checkbox'});


		// popUp creation

		var recentHash = "";

		setInterval(pollHash, 1000);

		function pollHash()
			{
			if (window.location.hash==recentHash)
				{
				return; // Nothing's changed since last polled.
			 	}
			recentHash = window.location.hash;
			// URL has changed, update the UI accordingly.
			$("div#popup").remove();
			$(".gallery-descr a.active").removeClass('active');
			if ((recentHash.indexOf("description") != -1) && ($(recentHash).length > 0))
				{
				showPopUp(recentHash);
				}
			}

		function showPopUp(PopId)
			{
			//attention PopId is something like '#description890'
			var description = $(PopId).html();
			$("div.topframe").append("<div id='popup'>"+description+"<a href='#' class='close'>SCHLIESSEN &gt;</a></div>");
			var shortPopId = PopId.replace("#","");
			$("a[href*='"+shortPopId+"']").addClass('active');
			}


	    // marking thumbnails of same artist

		$("div.gallery-small").hover(
		function () {
		var divClass = $(this).attr("class");
		divClass = divClass.replace(/gallery-small /,"");
		divClass = divClass.replace(/active/,"");
		$(this).parent().children("div."+divClass).addClass("mouseover");
		},
		function () {
		var divClass = $(this).attr("class");
		divClass = divClass.replace(/gallery-small /,"");
		divClass = divClass.replace(/active/,"");
		$(this).parent().children("div."+divClass).removeClass("mouseover");
		}
		);



/*
    $("#klein").change(function () {
		$("#suche").submit();
	});

	$("#gross").change(function () {
		$("#suche").submit();
	});

    $("#entliehen").change(function () {
		$("#suche").submit();
	});

    $("#grafiken").change(function () {
		$("#suche").submit();
	});

    $("#bilder").change(function () {
		$("#suche").submit();
	});
*/

 });