//-changeClass
//-setImgSize
//-getElementsByClassName
//-bookmarksite


$('#menu span').hover(function() {
	$(this).addClass('hover');
		}, function() {
	$(this).removeClass('hover');
});




function changeClass(en,cn)
{
 	if (!document.getElementById(en)) {
 		return;
 	}
 	var element = document.getElementById(en);    
 	element.className = cn;
}

function makepage(newsrc)
{
	return "<html>\n" +
	"<head>\n" +
	"<title>Jumbo Dokkum</title>\n" +
	"<scr" + "ipt type='text/javascr" + "ipt'>\n" +
	"function step1() {\n" +
	" setTimeout('step2()', 40);\n" +
	"}\n" +
	"function step2() {\n" +
	" window.print();\n" +
	" window.close();\n" +
	"}\n" +
	"</scr" + "ipt>\n" +
	"</head>\n" +
	"<body onLoad='step1()'>\n" +
	"<img src='" + newsrc + "'/>\n" +
	"</body>\n" +
	"</html>\n";
}
	
function printme(evt)
{
	if (!evt) {
	// Old IE
	evt = window.event;
	}
	var image = evt.target;
	if (!image) {
		// Old IE
		image = window.event.srcElement;
	}
	src = image.src;
	srcstrip = src.split("/");
	newsrc = "/downloads/" + srcstrip[6];
	link = "about:blank";

	var pw = window.open(link, "_new",'width=1,height=1,scrollbars=no,toolbar=no,location=no');
	pw.document.open();
	pw.document.write(makepage(newsrc));
	pw.document.close();
}

function doClock() {
	// By Paul Davis - www.kaosweaver.com;
	var t = new Date(), a = doClock.arguments, str = "", i, a1, lang = "1";
	var month = new Array(' januari ','Jan', ' februari ','Feb', ' maart ','Mar', ' april ','Apr', ' mei ','May', ' juni ','Jun', ' juli ','Jul', ' augustus ','Aug', ' september ','Sep', ' oktober ','Oct', ' november ',' Nov ', ' december ','Dec');
	var tday = new Array('Zondag ','Sun','Maandag ','Mon', 'Dinsdag ','Tue', 'Woensdag ','Wed','Donderdag ','Thr','Vrijdag ','Fri','Zaterdag ','Sat');
	
	for (i = 0; i < a.length; i++) {
		a1 = a[i].charAt(1);
		
		switch (a[i].charAt(0)) {
			case "M":
				if ((Number(a1) == 3) && ((t.getMonth() + 1) < 10)) {
					str += "0";
				}
				str += (Number(a1) > 1) ? t.getMonth() + 1 : month[t.getMonth() * 2 + Number(a1)];
				break;
			case "D":
				if ((Number(a1) == 1) && (t.getDate() < 10)) {
					str += "0";
				}
				str += t.getDate();
				break;
			case "Y":
				str += (a1 == "0") ? t.getFullYear() : t.getFullYear().toString().substring(2);
				break;
			case "W":
				str += tday[t.getDay() * 2 + Number(a1)];
				break;
			default:
				str += unescape(a[i]);
		}
	}
	
	return str;
}











function onBefore() {
    $('#gallery_info').html(this.title); 
    $('#g_photo_link').attr('href', $(this).attr('href'));
} 
function onAfter() { 
    $('#gallery_info').html(this.title); 
    $('#g_photo_link').attr('href', $(this).attr('href'));
}

/* ONLOAD */
$(document).ready(function()
{
	//Externe links
	$("a[rel='external']").each(function(){
		$(this).attr('target', "_blank");
	});
	
	$('#g_photo').cycle({ 
		fx:     'fade', 
   	 	speed:  1000, 
   		timeout: 4000, 
    	next:   '#next', 
   		prev:   '#prev',
   		before:  onBefore, 
    	after:   onAfter  
	});
	
	$('#s').cycle({ 
    	fx:      'fade', 
   	 	speed:    7000, 
    	timeout:  3000 
	});
	
	$("a.fancybox").fancybox({
		'imageScale' : false,
		'centerOnScroll' : false
	});
		
	$(document).pngFix();
	
	$('input.toggle_value').each(function(){
		var current_value = $(this).attr('value');
		var current_title = $(this).attr('title');
		
		if(current_value == '' || current_value == undefined) {
			$(this).attr('value', current_title);
		}
	});
		
	$('input.toggle_value').focus(function(){
		var current_value = $(this).attr('value');
		var current_title = $(this).attr('title');
		
		if(current_value == current_title) {
			$(this).attr('value', '');
		}
	});
		
	$('input.toggle_value').blur(function(){
		var current_value = $(this).attr('value');
		var current_title = $(this).attr('title');
		
		if(current_value == '' || current_value == undefined) {
			$(this).attr('value', current_title);
		}
	});
});