function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName('a'); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute('href') && 
       anchor.getAttribute("rel") == 'external') 
     anchor.target = '_blank'; 
 } 
}

function facebookButtonparams(){
	document.write('<fb:like href="' + this.location.href + '" layout="button_count" font="arial"></fb:like>');
	}
	
function twitterButtonparams(txtline){
	var header = $('.content h1').html();
	
	if (txtline == ''){
		txtline = '#FlexAssets: &#8217;'
		}
	else{txtline = ' &#8217;'}

	document.write('<a href="http://twitter.com/share" class="twitter-share-button" data-text="' + txtline + header + '&#8216;:" data-count="horizontal" data-via="FlexAssets">Tweet</a>');
	}

function googleplusButtonparams(){
	document.write('<g:plusone size="medium"></g:plusone>');
	}

$(document).ready(function(){
		
		$('div#menu').hide();
		$('div#con-main-menu li').hide();
		$('div#con-main-menu li#current').show();
			
		externalLinks();

		/*
		var pageContent  = $("#content");
		var pageHeader   = $("#header");
		var pageMainMenu = $("#con-main-menu");
		var pageFooter   = $("#footer");
		
		var contentHeight  = (pageContent.innerHeight());
		var headerHeight   = (pageHeader.innerHeight());
		var mainMenuHeight = (pageMainMenu.innerHeight());
		var footerHeight   = (pageFooter.innerHeight());
		
		var calculatedContentHeight = 0
		var myHeight = 0;
		var FFHack = 0;
		  if( typeof( window.innerHeight ) == 'number' ) {
		    //Non-IE
		    myHeight = window.innerHeight;
			FFHack   = 40
		  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myHeight = document.body.clientHeight;
		  }
//alert( 'Height = ' + myHeight );
		 
		if (contentHeight < myHeight){
//alert('contentHeight < myHeight');
			calculatedContentHeight = (myHeight - headerHeight - mainMenuHeight - footerHeight - FFHack);
			if( typeof( window.innerHeight ) == 'number' ) {
		    //Non-IE
		    calculatedContentHeight = (calculatedContentHeight + 20);
		  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    calculatedContentHeight = (calculatedContentHeight - 80);
		  } else if( document.body && ( document.body.clientHeight ) ) {
		    //IE 4 compatible
		    calculatedContentHeight = (calculatedContentHeight  - 80);
		  }


			
//alert(calculatedContentHeight);								
			//$("div#content").css("height",(calculatedContentHeight + "px" ));
			$("div#bodyText").css("height",(calculatedContentHeight + "px" ));
		 	$("div#leftbar").css("height",(calculatedContentHeight + "px" ));
			
		} else {
		 	$("div#leftbar").css("height",(contentHeight + "px" ));
			$("div#rightbar").css("height",(contentHeight + "px" ));
			if( typeof( window.innerHeight ) == 'number' ) {
				
				$("div#footer").css("margin-top",(70 + "px" ));
				}
		}
		*/
		
	    $('div#menu').slideDown({ queue:true, duration:3000 });
	    $('div#con-main-menu li')
			.show({ queue:true, duration:500 });
			
		$('#nbbukorting').click(function() {
     		$('div#formDiv').slideDown({ queue:true, duration:2000 });
   		});
		
		$('#nbbukortingFormGone').click(function() {
     		$('div#formDiv').slideUp({ queue:true, duration:1000 });
   		});
   });

						
						
						

