jQuery(document).ready(function() {
	var navWidth = parseInt(jQuery(".flash-template-col1").css("width").substring(0, 3)) + 20;
	var testWidth;
	if (jQuery(window).width() > 1300) {
		testWidth = false;
	}
	else {
		testWidth = true;
	}


	jQuery("#flash-arrow").click(function(event) {
		event.preventDefault();
		if (jQuery(".flash-template-col1").css("display") == "none") {
			jQuery("#flash-arrow").css('background-image', 'url("lcms-theme/images/pfeil.gif")');
			if (testWidth) {
				jQuery("#wrapper").animate( {
					paddingLeft : navWidth + 'px'
				}, 600, function() {
					jQuery(".flash-template-col1").show();
					jQuery(".flash-template-col1").animate( {
						left : '-217px'
					}, 600, function() {
						//animation complete
					});
				});
			}
			else {
				jQuery(".flash-template-col1").show();
				jQuery(".flash-template-col1").animate( {									                                                	left : '-217px'
                                 }, 600, function() {													                                                //animation complete
                                 });
			}
		}
		else {		
			jQuery("#flash-arrow").css('background-image', 'url("lcms-theme/images/pfeil2-unten.gif")');
			if (testWidth) {
				jQuery("#wrapper").animate( {
					paddingLeft : '0px'
				}, 600, function() {
					jQuery(".flash-template-col1").animate( {
						left : '0px'
					}, 600, function() {
						jQuery(".flash-template-col1").hide();
					});
				});
				//jQuery("#wrapper").css("padding-left", navWidth + "px");
			}
			else {
				jQuery(".flash-template-col1").animate( {
					left : '0px'
                                 }, 600, function() {
				 	jQuery(".flash-template-col1").hide();
                                 });
			}
		}
	});	
});

