// JavaScript Document
$(document).ready(function(){
	
	//$('[slider="true"]').hide();
	//$('[slider="true"]:first').show();
	
	$('.headerItemTitle').fadeTo('fast',0.5);
	
	$('.headerimage').cycle({
		fx: 'fade',
		slideExpr: '.headerItem'
	});
	
	$('.scroll_container').cycle({
		    fx:      'custom', 
			sync: 0, 
			cssBefore: {  
				top:  0, 
				left: 232, 
				display: 'block' 
			}, 
			animIn:  { 
				left: 0 
			}, 
			animOut: {  
				top: 232 
			}, 
			delay: -1000,
			pause: true
	});
	
	var active_color = $('[active_menu="true"]').attr("pcolor");
	
	if(active_color == undefined || active_color == ""){
		var active_color = '#6aaad1';
	}
	
	$("[border_select='true']").each(function(){
	
		$(this).css('borderColor',active_color);
	
	});
	
	$('.breadcrumbs').css('backgroundColor',active_color);
	$('.content_container .content h1, .content_container .content h2').css('color', active_color);
	
	
	$('tbody.info_fields tr:odd').each(function(){
		 $('> th', this).addClass('odd_higlight');
	});
	
	$('.required').each(function(){
		
		if($(this).attr("type") != "radio"){
			var thisElId = $(this).attr('id');
			var thisElDesc = $(this).attr('desc');
			if(thisElDesc == undefined || thisElDesc == "" || thisElDesc == " "){
				thisElDesc = "";
			}
			$('<label for="'+thisElId+'" class="error">* '+thisElDesc+'</label>').insertAfter(this);
		}
	});
	
	$('[input_label]').each(function(){
		
		var thisLabel = $(this).attr('input_label');
		
		if(thisLabel != ""){
			$(this).append('<input name="field_name[]" type="hidden" value="'+thisLabel+'" />');
		}
		
	});
	
	if($('form').size() > 0){
		$('form').append('<input type="hidden" name="form_title" value="'+$('.header_title h1').text()+'" />');
	}
	
	
	$(".meer").click(function(){
		$(".read_more").slideDown("fast");
		$(this).remove();
	});
	
	$(".content_container .content").find("span").attr("style","");
	
});
