$(document).ready(function(){
	$(".itemarrowlist").tabs({event: 'mouseover'}).tabs("rotate", 5000, true);
});

function showSubMenu(id){
	$('.subnavigation ul').hide();
	$('.navigation-tabs a').removeClass('active');
	
	$('#'+id).show();
	$('.'+id).addClass('active');
}

function smilietoevoegen(smilie,veld){
	
	text_veld = text_veld = document.getElementById(veld);
	
	var geselecteerdetekst = '';
	
	if(document.all && text_veld.cursorPos){
		geselecteerdetekst = text_veld.cursorPos.smilie;
	}else if (typeof(text_veld.selectionStart) != 'undefined'){
		geselecteerdetekst = text_veld.value.substr(text_veld.selectionStart, text_veld.selectionEnd - text_veld.selectionStart);
	}
	
	geselecteerdetekst = smilie;
	
	ubb_tekst_toevoegen(geselecteerdetekst,veld);
	
}


function ubb_tekst_toevoegen(text,veld){
	
	text_veld = document.getElementById(veld);

	if(typeof(text_veld.selectionStart) != 'undefined'){
		var sStart = text_veld.selectionStart;
		var sEnd = text_veld.selectionEnd;
		text_veld.value = text_veld.value.substr(0, sStart) + text + text_veld.value.substr(sEnd, text_veld.value.length);
		text_veld.selectionStart = (sStart == sEnd)? sStart + text.length:sStart;
		text_veld.selectionEnd = sStart + text.length;
	}else{
		//text_veld.value += text;
		text_veld.focus();
		sel = document.selection.createRange();
		sel.text = text;
		text_veld.focus();
	}
	text_veld.focus();
	if(document.all && text_veld.createTextRange) text_veld.cursorPos = document.selection.createRange().duplicate();
	
}

function ubb(actie,veld){
	
	text_veld = document.getElementById(veld);
	
	var geselecteerdetekst = '';
	var sel;
	
	if(document.all && text_veld.cursorPos){
		geselecteerdetekst = text_veld.cursorPos.text;
	}else if (typeof(text_veld.selectionStart) != 'undefined'){
		geselecteerdetekst = text_veld.value.substr(text_veld.selectionStart, text_veld.selectionEnd - text_veld.selectionStart);
	}else{
		text_veld.focus();
		sel = document.selection.createRange();
		if(sel.text != "") {
			sel.text = "[" + actie + "]" + sel.text + "[/" + actie + "]";
			return false;
		}
		text_veld.focus();
	}
	
	geselecteerdetekst = '['+actie+']'+geselecteerdetekst+'[/'+actie+']';
	
	ubb_tekst_toevoegen(geselecteerdetekst,veld);
}

var slideShowSpeed = 5000
var crossFadeDuration = 3

var Pic = new Array();

var t
	var j = 0
	var p = Pic.length
	
	var preLoad = new Array()
	for (i = 0; i < p; i++){
	   preLoad[i] = new Image()
	   preLoad[i].src = Pic[i]
	}

function runSlideShow(){

   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
