
function show_progress_layer()
{
		jQuery(".graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#upload-progress-box").css({"display":"block"}).animate({"opacity" :"1.0"}, 500);
}
function hide_progress_layer()
{
		jQuery("#graymeout").animate({"opacity" :"0.0"}, 500).css({"display":"none"});
		jQuery("#upload-progress-box").animate({"opacity" :"0.0"}, 500).css({"display":"none"});
}

function update_progress()
{
	
}

/* upselling */
function show_upselling_myfixx()
{
		get_centered_position('layer-box-upselling-myfixx');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixx").fadeIn("fast");
		
		
}
function hide_upselling_myfixx()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixx").fadeOut("fast");
}

function show_upselling_myfixfreefly()
{
		get_centered_position('layer-box-upselling-myfixfreefly');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixfreefly").fadeIn("fast");
}
function hide_upselling_myfixfreefly()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixfreefly").fadeOut("fast");
}

function show_upselling_myfixinvisible()
{
		get_centered_position('layer-box-upselling-myfixinvisible');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixinvisible").fadeIn("fast");
}
function hide_upselling_myfixinvisible()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixinvisible").fadeOut("fast");
}

function show_upselling_myfixborder()
{
		get_centered_position('layer-box-upselling-myfixborder');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixborder").fadeIn("fast");
}
function hide_upselling_myfixborder()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixborder").fadeOut("fast");
}

function show_upselling_myfixcorner()
{
		get_centered_position('layer-box-upselling-myfixcorner');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixcorner").fadeIn("fast");
}

function hide_upselling_myfixcorner()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixcorner").fadeOut("fast");
}

function show_upselling_myfixdrill()
{
		get_centered_position('layer-box-upselling-myfixdrill');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixdrill").fadeIn("fast");
}
function hide_upselling_myfixdrill()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixdrill").fadeOut("fast");
}

function show_upselling_myfixtop()
{
		get_centered_position('layer-box-upselling-myfixtop');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-upselling-myfixtop").fadeIn("fast");
}
function hide_upselling_myfixtop()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-upselling-myfixtop").fadeOut("fast");
}


/* preise & formate */
function show_pricelist_layer()
{
		jQuery("#material-poster").click();
		
		
		//jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		//jQuery("#layer-box-pricelist").fadeIn("fast");
}
function hide_pricelist_layer()
{
		jQuery("#graymeout").fadeOut("fast");
		jQuery("#layer-box-pricelist").fadeOut("fast");
}
function pricelist_choose(material)
{
	if(material=='foil')
		material='foil_sticky';
		
	jQuery(".layer-pricelist-prices").fadeIn("fast");
	jQuery(".layer-pricelist-material").removeClass("highlight");
	jQuery(".layer-pricelist-prices").css({"display":"none"});
	jQuery("#"+material+"_list").fadeIn("fast");
	
	if(material=='fotobook' || material=='fotobook_uv')
		jQuery("#material-fotobook").addClass("highlight");
	else
		jQuery("#material-"+material).addClass("highlight");
	
	if(material=='foil_adhesive' || material=='foil_sticky')
		jQuery("#material-foil").addClass("highlight");
}

function show_upload_layer()
{
//		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
//		jQuery("#layer-box-upload").fadeIn("fast");
}
function hide_upload_layer()
{
		jQuery("#graymeout").animate({"opacity" :"0.0"}, 500).fadeIn("fast");
		jQuery("#layer-box-upload").animate({"opacity" :"0.0"}, 500).fadeIn("fast");
}

function show_hint_layer()
{
	jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
	jQuery("#layer-box-hint").fadeIn("fast");
	jQuery("#layer-box-hint");
}
function hide_hint_layer()
{
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).fadeIn("fast");
		jQuery("#layer-box-hint").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).fadeIn("fast");
}
function show_warn_layer()
{
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-warn").fadeIn("fast");
}
function hide_warn_layer()
{
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).fadeIn("fast");
		jQuery("#layer-box-warn").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).fadeIn("fast");
		
}
function show_format_layer()
{
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-format").fadeIn("fast");
}

function hide_format_layer()
{
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).fadeIn("fast");
		jQuery("#layer-box-format").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).fadeIn("fast");
}
function show_papreview_layer(id)
{
		var p = jQuery("#layer-dummy").position();
		var rel_top = p.top + 150;

		jQuery("#layer-box-papreview").css({"top":rel_top});
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500); //.css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#pa_preview_content").load("/pictureportal/layer/"+id, function() 
		{ 
			initCastomForms(); 
			papreview_size();
			
			jQuery('.paginate-prev').css({"cursor":"pointer"});
			jQuery('.paginate-next').css({"cursor":"pointer"});
			
			// for showing next, previous preview in layer
			var pagarray =pa_get_surrounding_previews();
			
			jQuery(".paginate-prev").click(function(){
				release_pa_current();
				jQuery(".pa-current-prev").removeClass("pa-current-prev").addClass("pa-current");
				show_papreview_layer(pagarray[0]);
				
			});
			jQuery(".paginate-next").click(function(){
				release_pa_current();
				jQuery(".pa-current-next").removeClass("pa-current-next").addClass("pa-current");
				show_papreview_layer(pagarray[1]);
				
			});
		});
		jQuery("#layer-box-papreview").fadeIn("fast"); //css({"display":"block"}).animate({"opacity" :"1.0"}, 500);
		initCastomForms();
}
function hide_papreview_layer()
{
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
		jQuery("#layer-box-papreview").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
}


function show_pacart_layer(id)
{			
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500); //.css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-pacart").fadeIn("fast"); //.css({"display":"block"}).animate({"opacity" :"1.0"}, 500);
		
		jQuery.ajax({
		dataType	: 'text',
		async		: true,
		url			: "/aktion/pa/"+id+"/",
		type		: "GET",
		success		: function(data){
			show_pa_completed();
		}
		
		});

}
function show_preview_pacart_layer()
{
	jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500); //.css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
	jQuery("#layer-box-pacart").fadeIn("fast"); //.css({"display":"block"}).animate({"opacity" :"1.0"}, 500);
}

function hide_pacart_layer()
{
		jQuery("#pa_loading").css({"display":"block"});
		jQuery("#pa_ready").css({"display":"none"});
		jQuery("#pa_loader").css({"display":"block"});
		jQuery("#pa_ready_buttons").css({"visibility":"hidden"});
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
		jQuery("#layer-box-pacart").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
}

function show_voucher_layer()
{
		get_centered_position('layer-box-voucher');
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500); //.css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-voucher").fadeIn("fast"); //.css({"display":"block"}).animate({"opacity" :"1.0"}, 500);
}
function hide_voucher_layer()
{
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
		jQuery("#layer-box-voucher").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
}

function show_vouchercart_layer()
{
		jQuery("#graymeout").css({"display":"block"}).animate({"opacity" :"0.80"}, 500); //.css({"display":"block"}).animate({"opacity" :"0.80"}, 500);
		jQuery("#layer-box-vouchercart").fadeIn("fast"); //.css({"display":"block"}).animate({"opacity" :"1.0"}, 500);
}
function hide_vouchercart_layer()
{
		jQuery("#graymeout").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});

		jQuery("#layer-box-vouchercart").fadeOut("fast"); //.animate({"opacity" :"0.0"}, 500).css({"display":"none"});
}

function toggle_multiupload_layer()
{
	jQuery("#multiupload").toggle();
}


function get_centered_position(id)
{
	var p = jQuery("#layer-dummy").position();
	var rel_top = p.top + 150;
	jQuery("#"+id).css({"top":rel_top});
	
	//return rel_top;
}

function get_centered_position_class(cls)
{
	var p = jQuery("#layer-dummy").position();
	var rel_top = p.top + 150;
	jQuery("."+cls).css({"top":rel_top});

}

