function isplz(val) {
	return val.length == 5 && ((parseInt(val,10) == val || ""+"0"+parseInt(val,10) == val ));
}


jQuery(document).ready(function(){
	jQuery('.fancybox').fancybox();
	
	
	jQuery("#pikame").PikaChoose({
		auto_play:false,
		show_captions: false,
		thumb_width:100,
		thumb_height: 90,
		slide_enabled: false,
		show_prev_next: false,
		show_play: false,
		transition: [6]
	});
	
	

	
	/** Lustiges Image Galery Gehacke **/
	jQuery('body').append(jQuery('<div></div>').attr('id','imgContainerHaus'));
	jQuery('ul#pikame li div img').each(function(i,el){
		var newEl = jQuery('<a></a>')
						.attr('href',jQuery(el).attr('pikalink'))
						.attr('id',jQuery(el).attr('src').split('/')[jQuery(el).attr('src').split('/').length-1].split('.')[0])
						.attr('rel','hausbilder');
		
		jQuery('div#imgContainerHaus').append(newEl);
	});
	
	jQuery('.pika_main a').click(function(e){
		var imgId = jQuery(this).attr('href').split('/')[jQuery(this).attr('href').split('/').length-1].split('.')[0].replace('resize_600','resize_322');
		jQuery('#'+imgId).trigger('click');
		e.preventDefault();
	});
	
	jQuery('div#imgContainerHaus a').fancybox();
	
		if(window.opera) {
		if ($("a.jqbookmark").attr("rel") != ""){ // don't overwrite the rel attrib if already set
			$("a.jqbookmark").attr("rel","sidebar");
		}
	}

	jQuery("a.jqbookmark").click(function(event){
		event.preventDefault(); // prevent the anchor tag from sending the user off to the link
		var url = this.href;
		var title = this.title;

		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title);
		} else if(window.opera) { // Opera 7+
			return false; // do nothing - the rel="sidebar" should do the trick
		} else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)
			 alert('Unfortunately, this browser does not support the requested action,'
			 + ' please bookmark this page manually.');
		}

	})
	
	
	
	
})

