/*

	// -------------------------------------------------------------- //
	// script.js

*/

	// nav_main
	$('#nav_main li a').hover(
		function(){ $(this).animate({borderTop: '20px solid #b00000'}, 'fast'); },
		function(){ $(this).animate({borderTopWidth: '0'}, 'fast'); }
	);
	$('#nav_main .current_page_item a').hover(
		function(){ $(this).animate({borderTop: '20px solid #b00000'}, 'fast'); },
		function(){ $(this).animate({borderTopWidth: '10px'}, 'fast'); }
	);

	// clients
	$('#login').hover(
		function(){ $(this).animate({borderTop: '60px solid #b00000'}, 'fast'); },
		function(){ $(this).animate({borderTopWidth: '0'}, 'fast'); }
	);

	// jquery innerfade slideshow ----------------------------------- //
/*	$(document).ready(function(){
		$('#news').innerfade({
		//	runningclass: 'innerfade',
			animationtype: 'slide',
			type: 'sequence',
			speed: 750,
			timeout: 2000,
			containerheight: '1em'
		});
		$('#portfolio').innerfade({
		//	runningclass: 'innerfade',
			animationtype: 'fade',
			type: 'sequence',
			speed: 1000,
			timeout: 2000,
			containerheight: '220px'
		});
		$('.slideshow').innerfade({
		//	runningclass: 'innerfade',	// 
			animationtype: 'fade',		// fade, slide
			type: 'random',				// sequence, random, random_start
			speed: 1500,				// fade speed: slow, normal, fast
			timeout: 4000,				// time between fades in miliseconds
			containerheight: '300px'	// 
		});
	}); */

	// jquery imageswitch slideshow --------------------------------- //
	// nothing

	// jquery slideshow --------------------------------------------- //
/*	function slideSwitch(switchSpeed) {
		var $active = $('#slideshow li.active');
	
		if ($active.length == 0) $active = $('#slideshow li:last');
	
		// ordered selection
		var $next = $active.next('li').length ? $active.next('li') : $('#slideshow li:first');

		// random selection
	//	var $sibs = $active.siblings();
	//	var rndNum = Math.floor(Math.random() * $sibs.length );
	//	var $next = $($sibs[ rndNum ]);

		$active.addClass('last-active');

		$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, switchSpeed, function() {
				$active.removeClass('active last-active');
			});
	}

	$(function() {
		setInterval("slideSwitch(1000)", 5000);
	});
		
	// pause when mouseover // does not work
	var playSlideshow = setInterval('slideSwitch(1000)', 4000);
		
	$('.slideshow li').hover(function() {
		clearInterval(playSlideshow);
	},
		
	function() {
		playSlideshow;
	}); */

	// jquery toggle overlay & notice ------------------------------- //
/*	$(document).ready(function(){
		$('.toggle').click(function(){
			$('.overlay').hide();
			$('#notice').fadeOut('slow');
		});
	}); */

	// jquery slider ------------------------------------------------ //
/*	$(document).ready(function(){
		$(".slide_toggle").click(function(){
			if ($("#slider").is(':hidden')){
				$("#slider").slideDown('slow');
			}
			else{
				$("#slider").slideUp('slow');
			}
		});
	});
            
	function closeForm(){
		$('#messageSent').show('slow');
		setTimeout('$("#messageSent").hide();$("#slider").slideUp("slow")', 2000);
   	} */

	// print -------------------------------------------------------- //
/*	$(function(){
		$('select').each(function(i){
			var $el = $(this);
			var $options = $el.find('option');

			$el.after('<div class="print-select">Options: <ul id="sel'+i+'"></ul></div>');

			var $curPrintBox = $('#sel'+i);

			$options.each(function() {
				$curPrintBox.append('<li>'+$(this).text()+'</li>');
			});    
		});
	}); */

	// cookies ------------------------------------------------------ //
	function setCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}

	function eraseCookie(name) {
		setCookie(name,"",-1);
	}
