$(document).ready(function() {
	init_wsscroll();
	init_wssocial();
});

function wssocial(img, mode, string) {
	var url;
	var txt;
	if (mode == 'on') {
		url = $(img).attr('src').replace(/_off.png/, '_on.png');
		$(string).show();
	} else {
		url = $(img).attr('src').replace(/_on.png/, '_off.png');
		$(string).hide();
	}
	$(img).attr('src', url);
}

function init_wssocial() {
	$('#root_header_icons_fb').hover(
		function() { wssocial('#root_header_icons_fb', 'on', '#root_header_icons_fb_string'); },
		function() { wssocial('#root_header_icons_fb', 'off', '#root_header_icons_fb_string'); }
	);
	$('#root_header_icons_tw').hover(
		function() { wssocial('#root_header_icons_tw', 'on', '#root_header_icons_tw_string'); },
		function() { wssocial('#root_header_icons_tw', 'off', '#root_header_icons_tw_string'); }
	);
	$('#root_header_icons_rss').hover(
		function() { wssocial('#root_header_icons_rss', 'on', '#root_header_icons_rss_string'); },
		function() { wssocial('#root_header_icons_rss', 'off', '#root_header_icons_rss_string'); }
	);
	$('#root_header_icons_fb_string').hide();
	$('#root_header_icons_tw_string').hide();
	$('#root_header_icons_rss_string').hide();
}

function init_wsscroll() {
	$('#root_div_gallery').serialScroll({		
		items: 'li',
		prev: '#root_div_gallery_prev',
		next: '#root_div_gallery_next',
		axis: 'x',
		duration: 700,
		force: true,
		queue: true,
		cycle: true,
		interval: 10000,
		constant: true,
	});
}
