//<![CDATA[
jQuery.noConflict();
     
// Put all your code in your document ready area
jQuery(document).ready(function(jQuery){

	if(jQuery('div').hasClass('tx-lfcreateseminar-pi1')){
	
		jQuery('#tx_lfcreateseminar_pi1_begin_date').datepicker({
			dateFormat:'dd-mm-yy',
			onClose:function (date) {
				var begin = jQuery('#tx_lfcreateseminar_pi1_begin_date').val();
				var end = jQuery('#tx_lfcreateseminar_pi1_end_date').val();
				var beginParts = begin.split('-');
				var endParts = end.split('-');
				
				if( parseInt(beginParts[2]+beginParts[1]+beginParts[0]) > parseInt(endParts[2]+endParts[1]+endParts[0]) ){
					jQuery('#tx_lfcreateseminar_pi1_end_date').val(begin);
				}
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi1_end_date').datepicker({
			dateFormat:'dd-mm-yy',
			onClose:function (date) {
				var begin = jQuery('#tx_lfcreateseminar_pi1_begin_date').val();
				var end = jQuery('#tx_lfcreateseminar_pi1_end_date').val();
				var beginParts = begin.split('-');
				var endParts = end.split('-');
				
				if( parseInt(beginParts[2]+beginParts[1]+beginParts[0]) > parseInt(endParts[2]+endParts[1]+endParts[0]) ){
					jQuery('#tx_lfcreateseminar_pi1_end_date').val(begin);
				}
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi1_begin_hour').change(function () {
			var begin = jQuery('#tx_lfcreateseminar_pi1_begin_hour').val();
			var end = jQuery('#tx_lfcreateseminar_pi1_end_hour').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 23){
				jQuery(this).val(23);
			}
			if(jQuery('#tx_lfcreateseminar_pi1_begin_date').val() == jQuery('#tx_lfcreateseminar_pi1_end_date').val() && end < begin){
				jQuery('#tx_lfcreateseminar_pi1_end_hour').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi1_end_hour').change(function () {
			var begin = jQuery('#tx_lfcreateseminar_pi1_begin_hour').val();
			var end = jQuery('#tx_lfcreateseminar_pi1_end_hour').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 23){
				jQuery(this).val(23);
			}
			if(jQuery('#tx_lfcreateseminar_pi1_begin_date').val() == jQuery('#tx_lfcreateseminar_pi1_end_date').val() && end < begin){
				jQuery('#tx_lfcreateseminar_pi1_end_hour').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi1_begin_minute').change(function() {
			var begin = jQuery('#tx_lfcreateseminar_pi1_begin_minute').val();
			var end = jQuery('#tx_lfcreateseminar_pi1_end_minute').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 59){
				jQuery(this).val(59);
			}
			if(jQuery('#tx_lfcreateseminar_pi1_begin_date').val() == jQuery('#tx_lfcreateseminar_pi1_end_date').val() && jQuery('#tx_lfcreateseminar_pi1_begin_hour').val() == jQuery('#tx_lfcreateseminar_pi1_end_hour').val() &&  end < begin){
				jQuery('#tx_lfcreateseminar_pi1_end_minute').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi1_end_minute').change(function() {
			var begin = jQuery('#tx_lfcreateseminar_pi1_begin_minute').val();
			var end = jQuery('#tx_lfcreateseminar_pi1_end_minute').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 59){
				jQuery(this).val(59);
			}
			if(jQuery('#tx_lfcreateseminar_pi1_begin_date').val() == jQuery('#tx_lfcreateseminar_pi1_end_date').val() && jQuery('#tx_lfcreateseminar_pi1_begin_hour').val() == jQuery('#tx_lfcreateseminar_pi1_end_hour').val() &&  end < begin){
				jQuery('#tx_lfcreateseminar_pi1_end_minute').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi1_tx_lfseminarsmaps_lat').change(formatLat);
		jQuery('#tx_lfcreateseminar_pi1_tx_lfseminarsmaps_lng').change(formatLng);
	}
	if(jQuery('div').hasClass('tx-lfcreateseminar-pi2')){
		
		jQuery('#tx_lfcreateseminar_pi2_begin_date').datepicker({
			dateFormat:'dd-mm-yy',
			onClose:function (date) {
				var begin = jQuery('#tx_lfcreateseminar_pi2_begin_date').val();
				var end = jQuery('#tx_lfcreateseminar_pi2_end_date').val();
				var beginParts = begin.split('-');
				var endParts = end.split('-');
				
				if( parseInt(beginParts[2]+beginParts[1]+beginParts[0]) > parseInt(endParts[2]+endParts[1]+endParts[0]) ){
					jQuery('#tx_lfcreateseminar_pi2_end_date').val(begin);
				}
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi2_end_date').datepicker({
			dateFormat:'dd-mm-yy',
			onClose:function (date) {
				var begin = jQuery('#tx_lfcreateseminar_pi2_begin_date').val();
				var end = jQuery('#tx_lfcreateseminar_pi2_end_date').val();
				var beginParts = begin.split('-');
				var endParts = end.split('-');
				
				if( parseInt(beginParts[2]+beginParts[1]+beginParts[0]) > parseInt(endParts[2]+endParts[1]+endParts[0]) ){
					jQuery('#tx_lfcreateseminar_pi2_end_date').val(begin);
				}
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi2_begin_hour').change(function () {
			var begin = jQuery('#tx_lfcreateseminar_pi2_begin_hour').val();
			var end = jQuery('#tx_lfcreateseminar_pi2_end_hour').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 23){
				jQuery(this).val(23);
			}
			if(jQuery('#tx_lfcreateseminar_pi2_begin_date').val() == jQuery('#tx_lfcreateseminar_pi2_end_date').val() && end < begin){
				jQuery('#tx_lfcreateseminar_pi2_end_hour').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi2_end_hour').change(function () {
			var begin = jQuery('#tx_lfcreateseminar_pi2_begin_hour').val();
			var end = jQuery('#tx_lfcreateseminar_pi2_end_hour').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 23){
				jQuery(this).val(23);
			}
			if(jQuery('#tx_lfcreateseminar_pi2_begin_date').val() == jQuery('#tx_lfcreateseminar_pi2_end_date').val() && end < begin){
				jQuery('#tx_lfcreateseminar_pi2_end_hour').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi2_begin_minute').change(function() {
			var begin = jQuery('#tx_lfcreateseminar_pi2_begin_minute').val();
			var end = jQuery('#tx_lfcreateseminar_pi2_end_minute').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 59){
				jQuery(this).val(59);
			}
			if(jQuery('#tx_lfcreateseminar_pi2_begin_date').val() == jQuery('#tx_lfcreateseminar_pi2_end_date').val() && jQuery('#tx_lfcreateseminar_pi2_begin_hour').val() == jQuery('#tx_lfcreateseminar_pi2_end_hour').val() &&  end < begin){
				jQuery('#tx_lfcreateseminar_pi2_end_minute').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi2_end_minute').change(function() {
			var begin = jQuery('#tx_lfcreateseminar_pi2_begin_minute').val();
			var end = jQuery('#tx_lfcreateseminar_pi2_end_minute').val();
			if(jQuery(this).val() < 0){
				jQuery(this).val(0);
			}
			if(jQuery(this).val() >= 59){
				jQuery(this).val(59);
			}
			if(jQuery('#tx_lfcreateseminar_pi2_begin_date').val() == jQuery('#tx_lfcreateseminar_pi2_end_date').val() && jQuery('#tx_lfcreateseminar_pi2_begin_hour').val() == jQuery('#tx_lfcreateseminar_pi2_end_hour').val() &&  end < begin){
				jQuery('#tx_lfcreateseminar_pi2_end_minute').val(begin);
			}
		});
		
		jQuery('#tx_lfcreateseminar_pi2_tx_lfseminarsmaps_lat').change(formatLat);
		jQuery('#tx_lfcreateseminar_pi2_tx_lfseminarsmaps_lng').change(formatLng);
	}

function formatLat() {
	if(jQuery(this).val() < -90){
		jQuery(this).val(-90);
	}
	if(jQuery(this).val() >= 90){
		jQuery(this).val(90);
	}
}

function formatLng() {
	if(jQuery(this).val() < -180){
		jQuery(this).val(-180);
	}
	if(jQuery(this).val() >= 180){
		jQuery(this).val(180);
	}
}		

	jQuery(document).pngFix();
	
	if(jQuery('.gallery-container #slider').text().length > 0){
		jQuery('.gallery-container #slider').easySlider({
		controlsFade:false,
		continuous: true
		});
	}

//----
// find eksterne links i højre kolonne og sæt target=_blank på dem
//----
/*
jQuery('.main .column a').each(function(){
    if(jQuery(this).text().length > 0){
    var str  = jQuery(this).attr("href").split(":",1);
        if(str == "http"){
            jQuery(this).attr("target","_blank");
        }
    }
});
*/


//-----
// tøm søgefelt på focus
//-----
jQuery("#searchForm input:text").each(function(){
		var ov = jQuery(this).val();
		
		jQuery(this).focus(function(){
			var fv = jQuery(this).val();
			if (fv == ov) {
  				jQuery(this).val('');
  			}
		});
	
		jQuery(this).blur(function(){
			var bv = jQuery(this).val();
  			if (bv.length < 1) {
  				jQuery(this).val(ov);
  			}
		});
});

jQuery("#searchFormular input:text").each(function(){
		var ov = jQuery(this).val();
		
		jQuery(this).focus(function(){
			var fv = jQuery(this).val();
			if (fv == ov) {
  				jQuery(this).val('');
  			}
		});
	
		jQuery(this).blur(function(){
			var bv = jQuery(this).val();
  			if (bv.length < 1) {
  				jQuery(this).val(ov);
  			}
		});
});


	
//wrap input felter så de får baggrund
jQuery('#content input:text').wrap('<span class="inputfield"><span></span></span>');
jQuery('#content input:password').wrap('<span class="inputfield"><span></span></span>');

//-----
// faktaboks uden link
//-----

jQuery('.fact .more').each(function(){
	if(jQuery(this).text().length < 1){
		jQuery(this).remove();
		//alert("ja");
	}
});

//-----
// Sitemap lister
//-----
jQuery('.tx-lfcategoriesfe-pi1 .csc-menu>li:even').addClass("odd");

//-----
// Img lightbox
//-----

jQuery('.csc-textpic-image').each(function(){
  if(jQuery(this).children('dt').children('a').attr("rel") != ""){
	if(jQuery(this).children('dt').children('a').length > 0){
		var imgwidth = jQuery(this).children('dt').children('a').children('img').width();
		jQuery(this).children('.csc-textpic-caption').css("width",imgwidth-45 +"px");
		
		var linkhref = jQuery(this).children('dt').children('a').attr("href");
		var linkrel = jQuery(this).children('dt').children('a').attr("rel");
		var linktarget = jQuery(this).children('dt').children('a').attr("target");
		var linktitle = jQuery(this).children('dt').children('a').attr("title");
		
		var zoomtxt = "Forstør";
		if(jQuery('.header-holder a.logo').attr("title") == "Home"){
		 zoomtxt = "Enlarge";
		}
		
		//var enlargelink = '<dd class="enlargelink"><a target="' + linktarget + '" title="' + linktitle + '" href="'+ linkhref + '" rel="'+linkrel + '">' + zoomtxt + '</a></dd>';
		//jQuery(this).append(enlargelink);
		jQuery(this).children().children('a').append('<span class="enlargelink">' + zoomtxt + '</span>');
		
	}
  }
});

jQuery('.news-single-img a').each(function(){
	if(jQuery(this).length > 0){
		var imgwidth = jQuery(this).children('img').width();
		jQuery(this).next().css("width",imgwidth-45 +"px");
		
		var linkhref = jQuery(this).attr("href");
		var linkrel = jQuery(this).attr("rel");
		var linktarget = jQuery(this).attr("target");
		var linktitle = jQuery(this).attr("title");

		var enlargelink = '<span class="enlargelink">Forstør</span>';
		jQuery(this).append(enlargelink);
		
	}
});

//-----
// tx-contacts-pi1 table
// contenttable
//-----

jQuery('.tx-contacts-pi1 table tr:even td').addClass("odd");
jQuery('.contenttable tr:even td').addClass("odd");


//-----
// sitemap over undersider
//-----
jQuery('.catmenu ul').each(function(){
	jQuery(this).parent().prepend('<form class="catmenuform" action=""><select id="catJump" class="sellist"></select><input type="submit" value="Søg"/></form>');
	jQuery(this).children('li').each(function(i){
		var link = jQuery(this).children('a').attr("href");
		var txt = jQuery(this).children('a').text();
		jQuery(this).parent().parent().children('form').children('select').append('<option value="'+ link +'">'+ txt +'</option>');
	});
	jQuery(this).remove();

});
        
jQuery('.catmenuform').each(function(){
	jQuery(this).children('select').change(function(){
		jQuery(this).children("option:selected").each(function () {
			var actionvar = jQuery(this).attr("value");
			jQuery(this).parent().parent().attr("action",actionvar);
		});

	})
	.change();
	
});




//-----
// Frontpage swapper
//-----
//tjek om det er pluginnet der lægger billeder m.v. ind
if(jQuery('#focus div:first').attr("class") == "tx-lfkulturarvforside-pi1"){
//appender mouseover divs
//jQuery('#focus').children('.tx-lfkulturarvforside-pi1').append('<div class="topimghover"><div style="position:absolute; bottom:0; right:0; width:653px; height:304px;">&nbsp;<\/div><div style="position:absolute; bottom:292px; right:0; width:432px; height:47px;">&nbsp;<\/div><\/div>');
jQuery('#focus').children('.tx-lfkulturarvforside-pi1').append('<div class="topimghover" style="zoom:1;"><div style="position:absolute; bottom:0; right:0; width:653px; height:304px;">&nbsp;<\/div><div style="position:absolute; bottom:292px; right:0; width:432px; height:47px;">&nbsp;<\/div><\/div>');
//jQuery('#focus .topimghover div').each(function(){
jQuery('#focus .topimghover').each(function(){
jQuery(this).hover(
	function(){
		//jQuery('#focus').css("background","url("+ moverbg +") no-repeat bottom");
		//new
		jQuery('#focus').css("background","transparent none");
	},
	function(){
		jQuery('#focus').css("background","url("+ normbg +") no-repeat bottom");
	}
);
});

//henter array med bg-billeder
if(typeof getbgarr == 'function') {
bgarr = getbgarr();
} 
else
{
bgarr = new Array();
bgarr[0] = new Array();
bgarr[0][0]='';
bgarr[0][1]='';
}

var normbg = bgarr[0][0];
var moverbg = bgarr[0][1];

//skifter baggrund til den aktuelle
jQuery('#focus').css("background","url("+ normbg +") no-repeat bottom");

//new
jQuery('#focus-outer').css("background","url("+ moverbg +") no-repeat bottom");

//--- nyt med accordion
jQuery('#foldout h3').each(function(i){
	jQuery(this).click(function(){

	//sæt moverbg og moutbg til de aktuelle værdier fra array
		normbg = bgarr[i][0];
		moverbg = bgarr[i][1];
	
		//skift baggrund til den aktuelle fra array
		//jQuery('#focus').css("background","url("+ normbg +") no-repeat bottom");
		//new
		jQuery('#focus').css("background","url("+ normbg +") no-repeat bottom");
		jQuery('#focus-outer').css("background","url("+ moverbg +") no-repeat bottom");
	
	});
});

jQuery("#focus .focus-box #foldout").accordion({
			//event: "mouseover",
			//clearStyle: false,
			autoHeight: false
});

jQuery("#focus .focus-box #foldout h3").each(function(){
	jQuery(this).children('a').click(function(){
		if(jQuery(this).parent().attr("aria-expanded") =="true"){
			var url =jQuery(this).attr("href");
			//alert(url);
			document.location.href = url;
		}
	});
});

}

//-----
// english fokus
//-----
if(jQuery('#focus div:first').attr("class") == "englishfocus"){
//alert("english");
var engbg = jQuery('#focus .englishfocus img:first').attr("src");
var engbgover = jQuery('#focus .englishfocus img:nth-child(2)').attr("src");
//alert(engbg);
jQuery('#focus').css("background", "url(../../" + engbg + ") no-repeat bottom");
jQuery('#focus-outer').css("background", "url(../../" + engbgover + ") no-repeat bottom");
//jQuery('.englishfocus img').attr("src"));
//jQuery('.englishfocus img').attr("src");

jQuery('#focus').children('.englishfocus').append('<div class="topimghover" style="zoom:1;"><div style="position:absolute; bottom:0; right:0; width:653px; height:304px;">&nbsp;<\/div><div style="position:absolute; bottom:292px; right:0; width:432px; height:47px;">&nbsp;<\/div><\/div>');
//jQuery('#focus .topimghover div').each(function(){
jQuery('#focus .topimghover').each(function(){
jQuery(this).hover(
	function(){
		//jQuery('#focus').css("background","url("+ moverbg +") no-repeat bottom");
		//new
		jQuery('#focus').css("background","transparent none");
	},
	function(){
		jQuery('#focus').css("background","url("+ engbg +") no-repeat bottom");
	}
);
});


}
//--------------------


//-----
// Subpage header image swap
//-----


/* indsat i template for lf_kulturarvheader

jQuery('#inner .header-holder').append('<div class="topimghover" style="zoom:1;"><div style="position:absolute; bottom:91px; right:0; width:432px; height:47px;"><\/div><div style="position:absolute; bottom:0; right:0; width:653px; height:102px;">&nbsp;<\/div><\/div>');
jQuery('#inner .header-holder .topimghover div').hover(
	function(){
		jQuery('#inner #header').css("background","url(fileadmin/images/bg-header.jpg) no-repeat bottom");

	},
	function(){
		jQuery('#inner #header').css("background","url(fileadmin/images/bg-header.jpg) no-repeat bottom");
	}
);

*/


//-----
// Info boks2
//-----
jQuery('.info-box-2 .infolinks').each(function(){
	//jQuery(this).replaceWith("<select>");
	jQuery(this).parent().append('<form class="infolinksform" action=""><select class="sellist"></select><input class="catJumpsubmit" type="submit" value="Søg"/></form>');
	jQuery('.info-box-2 .infolinks li').each(function(){
		var link = jQuery(this).children('a').attr("href");
		var txt = jQuery(this).children('a').text();
		jQuery(this).parent().parent().children('form').children('select').append('<option value="'+ link +'">'+ txt +'</option>');
		
	});
	jQuery(this).remove();

});
        
jQuery('.infolinksform').each(function(){
	jQuery(this).children('select').change(function(){
		jQuery(this).children("option:selected").each(function () {
			var actionvar = jQuery(this).attr("value");
			jQuery(this).parent().parent().attr("action",actionvar);
		});

	})
	.change();
	
});


//-----
// Info-links
//-----

jQuery('.info-links .info-links-box').each(function(){
jQuery(this).css("position","absolute");
 jQuery(this).children('ul').children('li:odd').children('a').attr("class","dark"); 
 var i = 0;
 jQuery(this).children('ul').children('li').each(function(){
 	i++;
 	//alert(i);
 	if(i >=3){
 		jQuery(this).hide();
 	}
 });
 if(jQuery('body').attr("class") == "english"){
	//gør ingenting
 }
 else{
  if(i >=3){
 	jQuery(this).append('<div class="more"><a class="show3-4" href="#">Se flere</a><a class="show5-6" href="#">Se flere</a>&nbsp;<a href="#" class="close">Luk</a></div>');
	//jQuery('.info-links .show5-6').hide();
	jQuery(this).children('.more').children('.show5-6').hide();
	jQuery(this).children('.more').children('.close').hide();
  }
 }
 
});

jQuery('.info-links .show3-4').click(function(){
	jQuery(this).parent().parent().children('ul').children('li:eq(2)').show();
	jQuery(this).parent().parent().children('ul').children('li:eq(3)').show();
	jQuery(this).parent().children('.show5-6').show();
	jQuery(this).parent().children('.close').show();
	jQuery(this).hide();
	return false;
});

jQuery('.info-links .show5-6').click(function(){
	jQuery(this).parent().parent().children('ul').children('li:eq(4)').show();
	jQuery(this).parent().parent().children('ul').children('li:eq(5)').show();
	jQuery(this).hide();
	return false;
});

jQuery('.info-links .close').click(function(){
	jQuery(this).parent().parent().children('ul').children('li:eq(2)').hide();
	jQuery(this).parent().parent().children('ul').children('li:eq(3)').hide();
	jQuery(this).parent().parent().children('ul').children('li:eq(4)').hide();
	jQuery(this).parent().parent().children('ul').children('li:eq(5)').hide();
	jQuery(this).hide();
	jQuery(this).parent().children('.show3-4').show();
	jQuery(this).parent().children('.show5-6').hide();
	return false;
});


//-----
// Linkboks
//-----

jQuery('.links').each(function(){
 jQuery(this).children('ul').children('li:odd').addClass("color");
 jQuery(this).children('p:odd').addClass("color");
});



//-----
// Dropdown contactslist
//-----
	
/*jQuery(".information #dropdownsubmit").hide();
var formsubmitlink = '<li><a href="#" id="formsubmitlink">Søg</a></li>';
jQuery(".tx-contacts-pi1 ul.info-list").prepend(formsubmitlink);

jQuery("#formsubmitlink").click(function(){
	jQuery(".tx-contacts-pi1 .selectpeople").submit();
});*/



//-----
// klikbart billede i topfrise
//-----

if(jQuery('#focus div:first').attr("class") == "englishfocus"){
var link = jQuery('.englishfocus #nofoldout h3:first a').attr("href");
}
else{
var link = jQuery('.tx-lfkulturarvforside-pi1 #foldout h3:first a').attr("href");
jQuery('.tx-lfkulturarvforside-pi1 #foldout h3').each(function(){
    jQuery(this).children('a').click(function(){
    	link = jQuery(this).attr("href");    
    });
});
}

jQuery('#focus .topimghover div').click(function(){
    location.href = link;
});


//----- 	
// Switch stylesheets starts
//-----

var c = readCookie('style');

if (c) {
	switchStylestyle(c);
}
	
jQuery('.bigfont').click(function() {

	var relatt = this.getAttribute("rel");
        
       	switchStylestyle(relatt);	
        return false;
}); 	



jQuery('.smallfont').click(function() {

	var relatt = this.getAttribute("rel");
        
       	switchStylestyle(relatt);	
        return false;
});

jQuery('.middlefont').click(function() {

	var relatt = this.getAttribute("rel");
        
       	switchStylestyle(relatt);
       	return false;
});

//-----
// Switch stylesheets ends
//-----

}); // End jQuery onReady

var stylesheets = new Array("font_8px.css","font_10px.css","font_12px.css","font_14px.css","font_16px.css","font_18px.css");

function switchStylestyle(styleName)
{
        jQuery('link[rel*=style][title]').each(function(i)
        {
                //this.disabled = true;
                //if (this.getAttribute('title') == styleName) this.disabled = false;
                var styleCSS = styleName;
                jQuery(this).attr("href","fileadmin/res/"+ styleCSS);
           
                for(i=0;i<stylesheets.length;i++) {
			
			if(stylesheets[i] == styleCSS){
				jQuery('.smallfont').attr("rel",stylesheets[i-1]);
				jQuery('.bigfont').attr("rel",stylesheets[i+1]);				
			}
		}
                
        });

        createCookie('style', styleName, 365);

}

// Ends all jquery



// cookie functions http://www.quirksmode.org/js/cookies.html

function createCookie(name,value,days){
	if (days)	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name){
	createCookie(name,"",-1);
}

// cookie functions end


// Show slide - lf_rtcontent

function showSlide(jQuerypageLink,jQuerycurrent){
	jQuery.post(jQuerypageLink, {'tx_lfrtcontent_pi1[action]':"showSlide",'tx_lfrtcontent_pi1[current]':jQuerycurrent}, 
				function(data){
					if(data.length >0) {
						jQuery('#galleryarea').html(data);
					}
			});
}

//]]>