$(document).ready(function(){$("#breadcrumb").after("<div id='tester'></div>");initNewSlideshow();$(".general-testing-overlay").initGeneralTestingOverlay()});function initNewSlideshow(){$(".slideshowLink").each(function(a){$(this).unbind().bind("click",function(){$("#colorbox").removeClass();if($("#tester").length==0){$("#grad").before("<div id='tester'></div>")}var b=$(this).attr("title");$("#tester").empty().load($(this).attr("href")+" div.slides a",function(){$("#tester a").empty().attr("rel",a).colorbox({open:true,onLoad:function(){$(".image-panel object").hide()},onComplete:function(){$("#cboxTopCenter").html("<h3>"+b+"</h3>");flashReplace()},onClosed:function(){$("#cboxTopCenter").empty();$(".image-panel object").show()}})});return false})})}function flashReplace(){sIFR.replace(crankMinus,{selector:"#cboxTopCenter h3",wmode:"transparent",forceSingleLine:true,css:[".sIFR-root { color: #666666;}"],tuneHeight:0,offsetTop:0})}(function(b){b.fn.initGeneralTestingOverlay=function(h){var c=b.extend({},b.fn.initGeneralTestingOverlay.defaults,h);var e=b.meta?b.extend({},c,$this.data()):c;var g=e.width;var f=e.height;var d=e.scrolling;return this.each(function(k){$this=b(this);var l=$this.attr("href");var j="Testing Terms and Conditions";$this.unbind().bind("click",function(){b.colorbox({href:"/testing-overlay.html",scrolling:d,width:g,height:f,onComplete:function(){b("#colorbox #cboxTitle").hide();b("#cboxTopCenter").append("<h3>"+j+"</h3>");flashReplace();b("#generalTesting").validate({onkeyup:false,onblur:false,onsubmit:true,onfocusout:false,rules:{currentMsa:"required",vehicleComplies:"required",readRegulations:"required"},errorPlacement:function(m,i){m.insertAfter(i)},messages:{currentMsa:"Please check this",vehicleComplies:"Please check this",readRegulations:"Please check this"},submitHandler:function(i){b(i).ajaxSubmit();location.href=l;b.colorbox.close();return false}})},onClosed:function(){b("#cboxTopCenter").empty()}});b("#colorbox").removeClass().addClass("general");if(!b.support.opacity){setTimeout(a,500)}return false})})};function a(){b.colorbox.resize({height:508})}b.fn.initGeneralTestingOverlay.defaults={width:700,height:485,scrolling:false}})(jQuery);
