/* #################################  START SHOW ARCHIVE  ############################################ */
$(document).ready(function () {
    var $div = $('.msg_body');
    var height = $div.height();
    $div.hide().css({ height : 0 });

    $('.msg_head a').click(function () {
        if ($div.is(':visible')) {
            $div.animate({ height: 0 }, { duration: 2000, complete: function () {
                $div.hide();
            } });
        } else {
            $div.show().animate({ height : height }, { duration: 2000 });
        }
        
        return false;
    });
});
/* #################################  CLOSE SHOW ARCHIVE  ############################################ */

/* #################################  START PNG FIX  ############################################ */
    $(document).ready(function(){ 
        $(document).pngFix(); 
    }); 
/* #################################  CLOSE PNG FIX  ############################################ */

/* #################################  START YOUTUBE PLAYER  ############################################ */
$(function() {
	$("ul.video").ytplaylist({addThumbs:false, autoPlay: false, holderId: 'ytvideo'});
});
/* #################################  CLOSE YOUTUBE PLAYER  ############################################ */

/* #################################  */
jQuery(function($) {
 $('.gallery').addClass('gallery'); // adds new class name to maintain degradability

 $('ul.gallery').galleria({
 history : true, // activates the history object for bookmarking, back-button etc.
 clickNext : true, // helper for making the image clickable
 insert : '#main_image', // the containing selector for our main image
 onImage : function(image,caption,thumb) { // let's add some image effects for demonstration purposes

 // fade in the image & caption
 if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
 image.css('display','none').fadeIn(1000);
 }
 caption.css('display','none').fadeIn(1000);

 // fetch the thumbnail container
 var _li = thumb.parents('li');

 // fade out inactive thumbnail
 _li.siblings().children('img.selected').fadeTo(500,0.3);

 // fade in active thumbnail
 thumb.fadeTo('fast',1).addClass('selected');

 // add a title for the clickable image
 image.attr('title','volgende foto');
 },
 onThumb : function(thumb) { // thumbnail effects goes here

 // fetch the thumbnail container
 var _li = thumb.parents('li');

 // if thumbnail is active, fade all the way.
 var _fadeTo = _li.is('.active') ? '1' : '0.3';
 // fade in the thumbnail when finnished loading
 thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);

 // hover effects
 thumb.hover(
 function() { thumb.fadeTo('fast',1); },
 function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active
 )
 }
 });
 }); 

/* ############################################################## GOOGLE MAPS */
			function initialize() {
				var latlng = new google.maps.LatLng(50.86683, 4.74312);
				var settings = {
					zoom: 15,
					center: latlng,
					mapTypeControl: true,
					mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
					navigationControl: true,
					navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
					mapTypeId: google.maps.MapTypeId.ROADMAP};
				var map = new google.maps.Map(document.getElementById("map"), settings);
				var contentString = '<div id="content_map">'+
					'<div id="siteNotice">'+
					'</div>'+
					'<h1 class="maps">Standard AHZ</h1>'+
					'<div style="color: #000000">'+
					'<p>Tiensesteenweg 386<br/>B-3000 Leuven<br/>T: +32 (0)16 25 00 15<br/>F: +32 (0)15 25 00 37<br/></p>'+
					'</div>'+
					'</div>';
				var infowindow = new google.maps.InfoWindow({
					content: contentString
				});
				
				var companyImage = new google.maps.MarkerImage('http://www.standardahz.be/afbeeldingen/icoon.png',
					new google.maps.Size(41,36)
					
				);

				var companyShadow = new google.maps.MarkerImage('images/logo_shadow.png',
					new google.maps.Size(130,50),
					new google.maps.Point(0,0),
					new google.maps.Point(65, 50));

				var companyPos = new google.maps.LatLng(50.86683, 4.74312);

				var companyMarker = new google.maps.Marker({
					position: companyPos,
					map: map,
					icon: companyImage,
					shadow: companyShadow,
					title:"kopje",
					zIndex: 3});
				google.maps.event.addListener(companyMarker, 'click', function() {
					infowindow.open(map,companyMarker);
				});
			}
/* ############################################################## END GOOGLE MAPS */ 
/* ###################################### show field form */
	function klik(){  
     if(document.getElementById("frm_zoekveld").value == "Search...") { document.getElementById("frm_zoekveld").value = "" } 
     }; 
	 function leave(){  
     if(document.getElementById("frm_zoekveld").value == "") { document.getElementById("frm_zoekveld").value = "Search..." } 
     }; 


/* ###################################### end show field form */
