$(document).ready(function(){
	//Maak invulveld leeg onFocus
	$('input#username').focus(function(){
		if (this.value == this.defaultValue){
			this.value = ''; 
		}
	});
	$('.slideshow').cycle({
		fx:			'fade',
		speed:		10000,
		speedIn:	2000,
		speedOut:	2000
	});
	$(".menu_left_middle_company a[title], .menu_left_middle_private a[title]").tooltip({
		tip: ".tooltip",
		offset: [0, 10],
		opacity: 0.8,
		effect: "fade",
		position: "center right"
	});
	$("#myprofile_table_details input[title], textarea[title], select[title]").tooltip({
		tip: ".tooltip",
		offset: [0, 10],
		opacity: 0.8,
		effect: "fade",
		position: "center right"
	});
	$("#myprofile_table_menu a[title]").tooltip({
		tip: ".tooltip",
		offset: [-10, 0],
		opacity: 0.8,
		effect: "fade",
		position: "top center"
	});
	jQuery('#top_rated_list').jcarousel({
        vertical: true,
		scroll: 3,
		auto: 5,
		/* initCallback: mycarousel_initCallback, */
		wrap: 'last',
		buttonNextHTML: null,
		buttonPrevHTML: null
    });
	$("#top_rated_list2").simplyScroll({
		autoMode: 'loop'
	});
});

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
 
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
 
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function openWindow(url,width,height,options,name) {
	width = width ? width : 800;
	height = height ? height : 700;
	options = options ? options : 'resizable=yes';
	name = name ? name : 'openWindow';
	window.open(
		url,
		name,
		'screenX='+(screen.width-width)/2+',screenY='+(screen.height-height)/2+',width='+width+',height='+height+','+options
	)
}


