$(document).ready(function(){	
	$(".postalCode").keyup(function(event){
		if (this.value.length == 4) {
			$.get('/ajax/postalCode2city?pc='+$('.postalCode').val(), function(data){
				$('.city').val(data);
			});
		}
	});
    
    $(document).bind('cbox_closed', function(){
		$('.hideOnBox').show();
        //hiddenObjects.show();
        $('.cbox-object-replacer').each(function(){
            $(this).prev().show();
        }).remove();
        $('.cbox-hidden').removeClass('cbox-hidden').css('margin-left','0px');
	});
	$(document).bind('cbox_open', function(){
		$('.hideOnBox').hide();
        /*$('object:visible').after(function() {
            return '<div class="cbox-object-replacer" style="width:'+$(this).outerWidth()+'px;height:'+$(this).outerWidth()+'px;">&nbsp;</div>';
        }).hide();*/
        $('object, iframe').addClass('cbox-hidden').css('margin-left','3000px');
	});
    
	$(".productImage").colorbox();
	
	$('input:not(.noExample,[type*=file],[title=]),textarea:not(.noExample,[title=])').example(function() {
		return $(this).attr('title'); 
	});	
});
