
$(document).ready(function(){
				
	//$("div.carousel").carousel({ autoSlide: true, loop: true, autoSlideInterval: 7000, delayAutoSlide: 1000});
	
	$("#nav").treeview({persist: "location", collapsed: true});
	
	$('#vertical-menu').css('visibility','visible');

	$("#logo_home").click(function(){ window.location.href     = 'http://www.drpicardt.nl'; });

	$(".success-message").fadeOut(3000);

});

function insert_smiley(id)
{
	//document.forms['reactie-formulier'].message.value += " " + smiley;
	
	id = ' ' + id + ' ';
    var obj = document.getElementById('message');
    if(typeof(document.selection)!='undefined') 
    {
        obj.focus();
        var range = document.selection.createRange();
        if(range.parentElement() != obj) {
            return false;
        }
        var orig = obj.value.replace(/rn/g, "n");
        range.text = id;
        var actual = tmp = obj.value.replace(/rn/g, "n");
        for(var diff = 0; diff < orig.length; diff++) {
            if(orig.charAt(diff) != actual.charAt(diff)) break;
        }
        for(var index = 0, start = 0; (tmp = tmp.replace(id, "")) && (index <= diff); index = start + id.length) {
            start = actual.indexOf(id, index);
        }
    } else {
        var startPos = obj.selectionStart;
        var endPos = obj.selectionEnd;
        obj.value = obj.value.substr(0, startPos) + id + obj.value.substr(endPos, obj.value.length);
    }

	
}



sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

