var layer_dsl_reminder={notice_id:"",layer_id:"",post_url:"",comparison_id:null,show_filter:function(){overlay=$.rs.overlay.getInstance();overlay.setOptions({onClick:function(){overlay.hide();layer_dsl_reminder.hide()},onEsc:function(){overlay.hide();layer_dsl_reminder.hide()},id:this.layer_id});overlay.show()},show:function(){if(this.notice_id!=""){$("#"+this.notice_id).hide()}this.show_filter();$layer=$("#"+this.layer_id);var a=$(document).width();var b=$(document).scrollTop();if(b==0){b+=200}else{b+=100}$("#interval_reminder").css("visibility","visible");$layer.css({top:b+"px"});$layer.bgiframe();$layer.show();$("#reminder_email").focus()},hide:function(){$("#"+this.layer_id).hide();$.rs.overlay.getInstance().hide()},init:function(g,c,b,f,d){this.layer_id=g;this.post_url=c;this.comparison_id=b;$("body").append('<div class="c24Frame c24PopupLayer" id="'+g+'" style="display:none; position:absolute"></div>');var a="";if(f>0){a+="preload_lead_id="+f+"&"}if(d!=""){a+="preload_lead_access_key="+d}$("#"+g).load(this.post_url,a,function(){layer_dsl_reminder.show()});this.show_filter();if(this.notice_id==""){this.notice_id="c24NoticeLoading";if($("#"+this.notice_id).length==0){$("body").append('<div id="'+this.notice_id+'">Wird geladen</div>')}}$("#"+this.notice_id).css("top",($(document).scrollTop()+$(window).height()/2-$("#"+this.notice_id).outerHeight()/2)+"px").show()},post_data:function(){var a=$("#popup_dslreminder").serialize();$.get(this.post_url+"?x=&"+a,{comparison_id:this.comparison_id},function(b,c){if(c=="success"){$layer.html(b)}});return false}};
/*
 * jQuery Countdown plugin v1.0
 * http://www.littlewebthings.com/projects/countdown/
 *
 * Copyright 2010, Vassilis Dourdounis
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
(function(a){a.fn.countDown=function(b){config={};a.extend(config,b);diffSecs=this.setCountDown(config);if(config.onComplete){a.data(a(this)[0],"callback",config.onComplete)}if(config.omitWeeks){a.data(a(this)[0],"omitWeeks",config.omitWeeks)}a("#"+a(this).attr("id")+" .digit").html('<div class="top"></div><div class="bottom"></div>');a(this).doCountDown(a(this).attr("id"),diffSecs,500);return this};a.fn.stopCountDown=function(){clearTimeout(a.data(this[0],"timer"))};a.fn.startCountDown=function(){this.doCountDown(a(this).attr("id"),a.data(this[0],"diffSecs"),500)};a.fn.setCountDown=function(b){var d=new Date();if(b.targetDate){d=new Date(b.targetDate.month+"/"+b.targetDate.day+"/"+b.targetDate.year+" "+b.targetDate.hour+":"+b.targetDate.min+":"+b.targetDate.sec+(b.targetDate.utc?" UTC":""))}else{if(b.targetOffset){d.setFullYear(b.targetOffset.year+d.getFullYear());d.setMonth(b.targetOffset.month+d.getMonth());d.setDate(b.targetOffset.day+d.getDate());d.setHours(b.targetOffset.hour+d.getHours());d.setMinutes(b.targetOffset.min+d.getMinutes());d.setSeconds(b.targetOffset.sec+d.getSeconds())}}var c=new Date();diffSecs=Math.floor((d.valueOf()-c.valueOf())/1000);a.data(this[0],"diffSecs",diffSecs);return diffSecs};a.fn.doCountDown=function(d,b,c){$this=a("#"+d);if(b<=0){b=0;if(a.data($this[0],"timer")){clearTimeout(a.data($this[0],"timer"))}}secs=b%60;mins=Math.floor(b/60)%60;hours=Math.floor(b/60/60)%24;if(a.data($this[0],"omitWeeks")==true){days=Math.floor(b/60/60/24);weeks=Math.floor(b/60/60/24/7)}else{days=Math.floor(b/60/60/24)%7;weeks=Math.floor(b/60/60/24/7)}$this.dashChangeTo(d,"seconds_dash",secs,c?c:800);$this.dashChangeTo(d,"minutes_dash",mins,c?c:1200);$this.dashChangeTo(d,"hours_dash",hours,c?c:1200);$this.dashChangeTo(d,"days_dash",days,c?c:1200);$this.dashChangeTo(d,"weeks_dash",weeks,c?c:1200);a.data($this[0],"diffSecs",b);if(b>0){e=$this;t=setTimeout(function(){e.doCountDown(d,b-1)},1000);a.data(e[0],"timer",t)}else{if(cb=a.data($this[0],"callback")){a.data($this[0],"callback")()}}};a.fn.dashChangeTo=function(j,g,h,c){$this=a("#"+j);for(var b=($this.find("."+g+" .digit").length-1);b>=0;b--){var f=h%10;h=(h-f)/10;$this.digitChangeTo("#"+$this.attr("id")+" ."+g+" .digit:eq("+b+")",f,c)}};a.fn.digitChangeTo=function(d,c,b){if(!b){b=800}if(a(d+" div.top").html()!=c+""){a(d+" div.top").css({display:"none"});a(d+" div.top").html((c?c:"0")).slideDown(b);a(d+" div.bottom").animate({height:""},b,function(){a(d+" div.bottom").html(a(d+" div.top").html());a(d+" div.bottom").css({display:"block",height:""});a(d+" div.top").hide().slideUp(10)})}}})(jQuery);(function(a){a.fn.digitChangeTo=function(d,c,b){if(!b){b=800}if(a(d+" div.top").html()!=c+""){a(d+" div.top").css({display:"none"});a(d+" div.top").html((c?c:"0")).slideDown(b);a(d+" div.bottom").animate({height:"0"},b,function(){a(d+" div.bottom").html(a(d+" div.top").html());a(d+" div.bottom").css({display:"block",height:""});a(d+" div.top").hide().slideUp(10)})}}})(jQuery);var layer_availabilitycheck={layer_content:null,layer_width:null,sender:null,post_url:"",filter:null,comparison_id:null,mode:"",returnurl:"",show:function(){$layer=$("#c24AvailabilitycheckLayer");$layer.html(this.layer_content);$layer.css({top:$(document).scrollTop()+50+"px"});$layer.bgiframe();this.filter.css({opacity:0.2,width:$(document).width(),height:$(document).height()});this.filter.bgiframe();this.filter.show();$layer.show();if($("#areacode").length){$("#avail_areacode").val($("#areacode").val())}$("#avail_areacode").focus()},hide:function(){$("#c24AvailabilitycheckLayer").hide();this.filter.hide();this.sender=null},init:function(g,d,a,f,c){this.layer_id=g;this.post_url=d;this.comparison_id=a;this.mode=f;this.returnurl=c;var b=$("#"+this.layer_id);this.layer_width=b.width();this.layer_content=b.html();b.html("");$("body").append('<div class="c24Frame" id="c24AvailabilitycheckLayer"></div>');$("body").append('<div id="c24Availabilitycheckfilter" style="display: none; position: absolute; width: 1px; height: 1px; background: #000; z-index: 10; left: 0; top: 0;"></div>');this.filter=$("#c24Availabilitycheckfilter");this.filter.click(function(){layer_availabilitycheck.hide()})},toggle:function(a){if(this.sender==a){this.hide()}else{this.show();this.sender=a}return false},post_data:function(){var f=$("#zipcode").val();var d=$("#city").val();var b=$("#street").val();var a=$("#streetnumber").val();var h=$("#avail_areacode").val();var g=$("#phone").val();var c=$("#avail_email").val();$.get(this.post_url,{zipcode:f,city:d,street:b,streetnumber:a,avail_areacode:h,phone:g,avail_email:c,x:"y",comparison_id:this.comparison_id,mode:this.mode,returnurl:this.returnurl},function(i,j){if(j=="success"){$layer.html(i)}});return false}};var layer_mailoffer={notice_id:"",layer_id:"c24MailOfferLayer",post_url:"",comparison_id:null,show_filter:function(){overlay=$.rs.overlay.getInstance();overlay.setOptions({onClick:function(){overlay.hide();layer_mailoffer.hide()},onEsc:function(){overlay.hide();layer_mailoffer.hide()},id:this.layer_id});overlay.show()},load:function(a){$("#"+this.layer_id).load(this.post_url,function(){layer_mailoffer.show(a)});this.show_filter();if(this.notice_id==""){this.notice_id="c24NoticeLoading";if($("#"+this.notice_id).length==0){$("body").append('<div id="'+this.notice_id+'">Wird geladen</div>')}}$("#"+this.notice_id).css("top",($(document).scrollTop()+$(window).height()/2-$("#"+this.notice_id).outerHeight()/2)+"px").show()},show:function(b){if(this.notice_id!=""){$("#"+this.notice_id).hide()}this.show_filter();$layer=$("#"+this.layer_id);var a=$(document).width();var c=$(b).offset().top;if(c+$layer.height()<($(document).scrollTop()+$(window).height())){if(c-100<$(document).scrollTop()){c=$(document).scrollTop()+20}else{c=c-60}}else{c=$(document).scrollTop()+$(window).height()-$layer.height()-50}$layer.css({top:c+"px",left:$(b).offset().left-$layer.width()-20+"px"});$layer.bgiframe();$layer.show();$("#mailoffer_email").focus()},hide:function(){$("#"+this.layer_id).hide();$.rs.overlay.getInstance().hide()},init:function(c,b,a){this.post_url=b;this.comparison_id=a;$("body").append('<div class="c24Frame c24PopupLayer" id="'+this.layer_id+'" style="display:none; position:absolute"></div>');layer_mailoffer.load(c)},post_data:function(){var a=$("#mailoffer_form").serialize();$.get(this.post_url+"?x=&"+a,{comparison_id:this.comparison_id},function(b,c){if(c=="success"){$layer.html(b)}});return false}};
