/* GILISSEN 

	Js specifics.
	
	jQuery based. v 1.6.2+

*/


jQuery.noConflict(); /* Mootools loaded for menus */

jQuery(document).ready(function($) {
		
		/* from text area default values */
		var $off = "Kan u een idee geven over de grootte? Aantal gevels, aantal vierkante meter? Grote of kleine woning? Geef ook extra informatie over uw noden en wensen voor een offerte op maat.";

		var $cont = "Stel hier uw vraag.";

	if(	$('body').attr('id') == 'body_offerte' )
	{
		$('#fev_77_12').focus(function(){
									if( $(this).val() == $off ) { $(this).val('') ;}
							  });

		$('#fev_77_12').blur(function(){
									if( $.trim($(this).val()) == '' ) { $(this).val($off) ;}
							  });
	}

	if(	$('body').attr('id') == 'body_contact' )
	{
		$('#fev_76_6').focus(function(){
									if( $(this).val() == $cont ) { $(this).val('') ;}
							  });

		$('#fev_76_6').blur(function(){
									if( $.trim($(this).val()) == '' ) { $(this).val($cont) ;}
							  });
	}



	/* CTAs */
	$('.CTA').each(function(){
		/* source = current page */
	//	var cpg = $('body').attr('id');
	//	cpg = cpg.split('_');
		var cpg = location.pathname ;
		/* target page */
		var tpag = $(this).attr('href');
		/* CTA position*/
		var pos = $(this).attr('rel');
		/* lang */
//		var lg = '';
//		if(	$(this).hasClass('fr') ) {lg = 'fr-'}
//		if(	$(this).hasClass('nl') ) {lg = 'nl-'}
//		if(	$(this).hasClass('de') ) {lg = 'de-'}
		
	/* if we have subpages &|or trailling / */					
	//	tpag = tpag.split('/');
	//	if( tpag[ (tpag.length) -1 ] == "" ){tpag = tpag[ (tpag.length) -2 ];}else{tpag = tpag[ (tpag.length) -1];}

		tracker = "_gaq.push(['_trackEvent', '"+tpag+"', '"+cpg+"', 'CTA"+pos+"']);";
		$(this).attr('onclick',tracker);
	});

		/*	topCTA */
		var cpg = location.pathname ;
		var	 topCTA = "_gaq.push(['_trackEvent', 'offerte', '"+cpg+"', 'CTA-Top']);";

		$('#topCTA a').attr('onclick',topCTA);



/* end */
	});


