function pad(b){if(b<10){return"0"+b}return b}function proc(f,e){c=Math.floor(f/3600);f=f%3600;d=Math.floor(f/60);f=f%60;f=Math.floor(f);e.html(pad(c)+":"+pad(d)+":"+pad(f))}function cd(f,e,g){now=new Date();amt=f.getTime()-now.getTime();delete now;if(amt<0){e.parent().css("text-align","left");e.parent().html(e.parent().find(".visited").contents());clearInterval(g)}else{proc(Math.floor(amt/1000),e)}}$(document).ready(function(){$(".cntdwn").each(function(){var f=new Date(),e=$(this);f.setSeconds(f.getSeconds()+parseInt($(this).html()));proc(parseInt($(this).html())-1,e);var g=setInterval(function(){cd(f,e,g)},1000)});$(".json_form").submit(function(e){var f=$(this).find(".info_box");f.show().html("").removeClass("success").removeClass("error").addClass("loading");$.ajax({type:"POST",url:$(this).attr("action"),data:$(this).serialize(),dataType:"json",success:function(a){f.removeClass("loading");if(parseInt(a.status)==1){window.location=a.txt}else{if(parseInt(a.status)==2){f.removeClass("error").addClass("success").show().html(a.txt)}else{if(parseInt(a.status)==0){f.removeClass("success").addClass("error").show().html(a.txt)}}}}});e.preventDefault()});$("html").click(function(){$(".content").hide()});$(".parent").click(function(b){$(this).children(".content").toggle();b.stopPropagation()});$(".content").click(function(b){b.stopPropagation()})});
