// TEXT REPLACE
Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('#menutxt');

// DIV SLIDE
jQuery(document).ready(function() {
  jQuery("#cmtform").hide();
  //toggle the componenet with class msg_body
  jQuery("#addcmt").click(function()
  {
	jQuery(this).next("#cmtform").slideToggle(500);
  });
});


// TWEETS
/*
jQuery(document).ready(function($) {
$(".tweet").tweet({
	'avatar_size' : 0,
});
});      
*/

// BLUR LINKS
function bluranchors(){
if(document.getElementsByTagName) {
var a = document.getElementsByTagName("a");


//collect all anchors A
for(var i = 0; i < a.length; i++){
// mouse onfocus, blur anchors
a[i].onfocus = function(){this.blur();};
}
}
}

window.onload = bluranchors; 


// FANCYBOX

$(document).ready(function() {
	
	$("a#single_image").fancybox({
		'padding'			:	1,	
		'hideOnContentClick': true,
		'overlayOpacity'	: 0.7,
		'overlayColor'		: '#000',
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
	});
	
		
	$(".iframe").fancybox({
		'width'				: 720,
		'height'			: 540,
        'autoScale'     	: true,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'autoDimensions'    : true,
		'scrolling'         : 'no',
		'padding'           : 0,
		'overlayOpacity'	: 0.7,
		'overlayColor'		: '#000',
	});
	
});


// TOOLTIP

$(document).ready(function() { 
         
    // enable tooltip for "download" element. use the "slide" effect 
    $(".gigs").tooltip({ 
		effect: 'slide',
		position: "bottom center", 
		opacity: 0.9, 
	});  
});


// RIGHT CLICK
// JavaScript Document

function clickIE() {
	if (document.all){
		return false;
	}
}
 
function clickNS(e) { 
	if (document.layers||(document.getElementById&&!document.all)) {
	
		if (e.which==2||e.which==3) {
			return false;
		}
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
} else {
	document.onmouseup=clickNS;document.oncontextmenu  =clickIE;
} 
document.oncontextmenu=new Function("return false");

// SHOP
								// Format a value as currency.
				function formatCurrency(num) {
				  num = num.toString().replace(/\$|\,/g,'');
				  if(isNaN(num))
					 num = "0";
				  sign = (num == (num = Math.abs(num)));
				  num = Math.floor(num*100+0.50000000001);
				  cents = num%100;
				  num = Math.floor(num/100).toString();
				  if(cents<10)
					  cents = "0" + cents;
				  for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
					  num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3));
				  return (((sign)?'':'-') + '€ ' + num + ',' + cents);
				}
				
				function update(vakje){

					var totaal=document.getElementById("totaalprijs");
					var verzending = document.getElementById("verzending");
					var verzendprijs = document.getElementById("verzend_prijs");
					var betaling = document.getElementById("betaling");
					var pricetot=document.getElementById("sc_prijs");
					var quantity=document.getElementById("sc_aantal");
					
					if(vakje != "betaling") {					
						if (verzending.selectedIndex == 0) {
							verzendprijs.innerHTML = "n.v.t.";
							var verzendk = 0;
							option0 = new Option("Contant bij afhalen",0);
							option1 = new Option("Vooruitbetaling",1);
							betaling.options[0] = option0;
							betaling.options[1] = option1;
						} else if (verzending.selectedIndex == 1) {
							verzendprijs.innerHTML = formatCurrency(2);
							var verzendk = 2;
							betaling.remove(1);
							option0 = new Option("Vooruitbetaling",0);
							betaling.options[0] = option0;
						} else if(verzending.selectedIndex == 2){
							verzendprijs.innerHTML = "n.t.b.";
							var verzendk = 0;
							betaling.remove(1);
							option0 = new Option("-- n.v.t. --",0);
							betaling.options[0] = option0;
						}
					}
					
		
						
					pricetot.innerHTML= formatCurrency(6 * quantity.value);
										
					totaal.innerHTML = formatCurrency(6 * quantity.value + verzendk);	
					document.getElementById("sc_hidden").value = (6 * quantity.value);
					document.getElementById("verzend_hidden").value = verzendk;
					document.getElementById("totaal_hidden").value = (6 * quantity.value + verzendk);
									
				}

