/***********************************************************
Scriptname: 	init.js
Dependencies: 	jquery.1.4.3
Version: 		1.0 Prod
Description:	Initializing all objects

Copyright: 		Webavance B.V. 2011 for Dusk!
Legal: 			Any use of this script without Webavance B.V.
				express written consent is prohibited
************************************************************/

$(document).ready( function() {
	Cufon.replace('h1, h2, h4, h5, h6');
	
	$('#slidebanner-wrapper').slidebanner();
	
	$('body').find('[href]:not(a)').each(function(x,a) {
		$(a).css({ cursor: 'pointer' });
		$(a).bind('click', function(e){
			e.preventDefault();
			e.cancelBubble=true;
			window.location.href=$(this).attr('href');
		});
	});
	
	if ($('.comments_quote').length>0) {
		$('.comments_quote').comments_quote();
	}
	
	if ($('[fieldlabel]').length>0) {
		$('[fieldlabel]').fieldlabel();
	}
	
	if ($('#schedule_wrapper').length>0 && $('#schedule_providers').length>0) {
		url = location.host;
		fullurl = document.location.href;
		pathurl = fullurl.replace('http://'+url, "");
		language = pathurl.substr(0, 4);
		$('#schedule_wrapper').schedule({
			menu: '#schedule_providers',
			json_schedule: 'http://'+url+'/module/ajax'+language+'programmering_json/'
		});
	}
	
	var menuheight = $('.menu_wrapper').height() - 220;
	$('.col:first').css({
		paddingTop: menuheight + 'px'
	});
	
	$('.movie_descr_smallp > p:first').css({
		width: 180,
		clear: 'none'
	});
	
	$('.mod24').find('table').each( function(i, table){
		table = $(table);
		table.find('tr:first > td').addClass('table_toprow');
		table.find('tr:last > td').addClass('table_bottomrow');
		table.find('tr > td:first').addClass('table_firstcol');
		table.find('tr > td:last').addClass('table_lastcol');
	});
	
	
	$('#hidreaction').html('<input type="hidden" name="hidreaction" value="du5k!" />');
	
	
});
