
$(document).ready(function()
{initBindings();$(".hideOnReady").hide();$("#previewButton").show();var flashMessageId;var animateFlashMessage=function(el)
{if(!el.hasClass('message'))
{setTimeout(function(){el.slideUp('slow')},6000);}}
if((flashMessageId=$("#authMessage")).length>0){animateFlashMessage(flashMessageId);};if((flashMessageId=$("#flashMessage")).length>0){animateFlashMessage(flashMessageId);};$(".fancyhtml").click(function(){$.fancybox({'type':'iframe','width':560,'height':500,'href':addParameterToURL(this.href,'printversion','1'),'onComplete':function(){$.fancybox.hideActivity();},'autoScale':false,'autoDimensions':false,'zoomSpeedIn':200,'zoomSpeedOut':200,'overlayShow':true,'overlayOpacity':0.2});$.fancybox.showActivity();return false;});$(".fancyswf").click(function(){$.fancybox({'padding':0,'autoScale':false,'transitionIn':'none','transitionOut':'none','title':false,'width':640,'height':390,'href':this.href.replace(new RegExp("watch\\?v=","i"),'v/')+'&version=3','type':'swf','overlayOpacity':0.2,'swf':{'wmode':'transparent','allowfullscreen':'true'}});return false;});var accordionSpeed=300;$("#accordion .item_header").click(function(){if($(this).hasClass('active')){$(this).removeClass("active").next('div.item_content').slideUp(accordionSpeed);}else{$(this).addClass("active").next('div.item_content').slideDown(accordionSpeed);}})});function initBindings()
{$('img:not(.usesqtip).infoicon[title], a:not(.usesqtip).qtiplink[title]').qtip({position:{corner:{target:'topMiddle',tooltip:'bottomRight'},adjust:{screen:true,y:-3}},style:{name:'dortex',padding:'7px 13px',width:{max:350,min:0},tip:true}}).addClass('usesqtip');$("a[rel^='fancybox']").fancybox({'zoomSpeedIn':200,'zoomSpeedOut':200,'overlayShow':true,'overlayOpacity':0,'hideOnContentClick':true}).addClass('fancybox');}
(function($){$.fn.validHex=function(){return this.each(function(){var value=$(this).val();value=value.replace(/[^#a-fA-F0-9]/g,'');if(value.match(/#/g)&&value.match(/#/g).length>1)value=value.replace(/#/g,'');if(value.indexOf('#')==-1)value='#'+value;if(value.length>7)value=value.substr(0,7);$(this).val(value);});};})(jQuery);(function($){$.fn.customFadeIn=function(speed,callback){$(this).fadeIn(speed,function(){if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');if(callback!=undefined)
callback();});};$.fn.customFadeOut=function(speed,callback){$(this).fadeOut(speed,function(){if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');if(callback!=undefined)
callback();});};})(jQuery);var delay=(function(){var timer=0;return function(callback,ms){clearTimeout(timer);timer=setTimeout(callback,ms);};})();function addParameterToURL(_url,_key,_value){var param=_key+'='+escape(_value);var sep='&';if(_url.indexOf('?')<0){sep='?';}else{var lastChar=_url.slice(-1);if(lastChar=='&')sep='';if(lastChar=='?')sep='';}
_url+=sep+param;return _url;}
var ajaxRequest=null;function updatePreview(ajaxUrl,formId,ajaxAbort)
{if(arguments.length<3)ajaxAbort=true;if(ajaxAbort==true&&ajaxRequest!=null){ajaxRequest.abort();}
$('#updateIndicator,.updateIndicator').show();var forceSubmitAction=false;ajaxRequest=$.ajax({type:'POST',url:ajaxUrl,data:$(formId).serialize(),timeout:15000,success:function(data,textStatus,XMLHttpRequest)
{$('#previewPicture').html(data);initBindings();if(typeof(checkRibbonLengthOnAjaxSuccess)!='undefined'&&checkRibbonLengthOnAjaxSuccess==true&&checkRibbonLength()){if(typeof(forceSubmitOnAjaxSuccess)!='undefined'&&forceSubmitOnAjaxSuccess==true){forceSubmitAction=true;}}
if(typeof(checkColorContrastOnAjaxSuccess)!='undefined'&&checkColorContrastOnAjaxSuccess==true&&checkColorContrast()){if(typeof(forceSubmitOnAjaxSuccess)!='undefined'&&forceSubmitOnAjaxSuccess==true){forceSubmitAction=true;}}
if(forceSubmitAction==true){setTimeout(function(){$(formId).addClass('forcesubmit').submit();},150);}
else{$('#updateIndicator,.updateIndicator').hide();$('#overlayIndicator').hide();}},error:function(XMLHttpRequest,textStatus,errorThrown)
{$('#updateIndicator,.updateIndicator').hide();$('#overlayIndicator').hide();}})
return false;}
function updateContent(ajaxUrl,formId,dataId,indicatorId,ajaxAbort)
{if(arguments.length<5)ajaxAbort=true;if(ajaxAbort==true&&ajaxRequest!=null){ajaxRequest.abort();}
$(indicatorId).show();ajaxRequest=$.ajax({type:'POST',url:ajaxUrl,data:$(formId).serialize(),timeout:15000,success:function(data,textStatus,XMLHttpRequest)
{$(dataId).html(data);$(dataId).show();$(indicatorId).hide();},error:function(XMLHttpRequest,textStatus,errorThrown)
{$(indicatorId).hide();}})}
function modalconfirm(id,message,callback){$(id).modal({onShow:function(dialog){var modal=this;$('.message',dialog.data[0]).append(message);$('.yes',dialog.data[0]).click(function()
{modal.close();if($.isFunction(callback)){callback.apply();}});}});}
function fixIESubmitProgressIndicator(elementId){refObject=$('#'+elementId);if($.browser.msie&&refObject.length>0){refObject.attr('src',refObject.attr('src'));}}
function prepareModalHint()
{$('#tapeImg1, #tapeImg2').attr('src',$('#tapeImg').attr('src'));if($('#tapeImg').css('width').replace(/px/,'')>$('#meldung2Content').css('width').replace(/px/,'')){$('.divTapeImg').css('width',$('#meldung2Content').css('width'));}
else{$('.divTapeImg').css('width',$('#tapeImg').css('width'));}
$('.divTapeImg').css('overflow','hidden');$('.meldungLaenge').html((bandlaenge/10).toString().replace(/\./,','));$('.ueberlaengePreis').html($('#einzelpreis').html());}
function showOverlayIndicator(el)
{offsetTop=parseInt($('.joodo-Post').offset().top);offsetLeft=parseInt($('.joodo-Post').offset().left);$('#overlayIndicator').css('height',el.innerHeight()+'px').css('width',el.innerWidth()+'px').css('left',(el.offset().left-offsetLeft)+'px').css('top',(el.offset().top-offsetTop)+'px');$('#overlayIndicator img').css('margin-left',($('#overlayIndicator').outerWidth()/2-8)+'px').css('margin-top',($('#overlayIndicator').outerHeight()/2-8)+'px');$('#overlayIndicator').show();}
var checkInputFlag=true;var checkTextinputMessage='Please enter content at least in one row.';function checkTextinput(el,popup)
{if(typeof(popup)=='undefined')popup=true;if(checkInputFlag==true)
{var _Content1;($('#'+el+'0Beschriftung')!=null)&&(_Content1=$('#'+el+'0Beschriftung').val());var _Content2;($('#'+el+'1Beschriftung')!=null)&&(_Content2=$('#'+el+'1Beschriftung').val());var _Content3;($('#'+el+'2Beschriftung')!=null)&&(_Content3=$('#'+el+'2Beschriftung').val());var _Content4;($('#'+el+'3Beschriftung')!=null)&&(_Content4=$('#'+el+'3Beschriftung').val());if(!_Content1&&!_Content2&&!_Content3&&!_Content4){markInput(el);if(popup==true){alert(checkTextinputMessage);}
return false;}}
unmarkInput(el);return true;}
function hasEmptyTextRows(el)
{var foundEmptyTextRow=false;var rowCounter=0;for(var i=0;i<=3;i++)
{if($('#'+el+i+'Beschriftung').length>0){rowCounter++;if($('#'+el+i+'Beschriftung').val()==''){foundEmptyTextRow=true;}}}
if(rowCounter>1&&foundEmptyTextRow==true){return true;}else{return false;}}
function markInput(el)
{if($('#'+el+'0Beschriftung')!=null){$('#'+el+'0Beschriftung').addClass('markedtextinput');$('#'+el+'0Beschriftung').focus();}
($('#'+el+'1Beschriftung')!=null)&&$('#'+el+'1Beschriftung').addClass('markedtextinput');($('#'+el+'2Beschriftung')!=null)&&$('#'+el+'2Beschriftung').addClass('markedtextinput');($('#'+el+'3Beschriftung')!=null)&&$('#'+el+'3Beschriftung').addClass('markedtextinput');}
function unmarkInput(el)
{($('#'+el+'0Beschriftung')!=null)&&$('#'+el+'0Beschriftung').removeClass('markedtextinput');($('#'+el+'1Beschriftung')!=null)&&$('#'+el+'1Beschriftung').removeClass('markedtextinput');($('#'+el+'2Beschriftung')!=null)&&$('#'+el+'2Beschriftung').removeClass('markedtextinput');($('#'+el+'3Beschriftung')!=null)&&$('#'+el+'3Beschriftung').removeClass('markedtextinput');}
