$(document).ready(function () {
	
//	$("a").each(function () {
//		var input = $(this).attr("href");
//		var output = input.replace("\ ", "%20");
//		$(this).attr("href", output);
//	});

	
	$(".container").hide();
	$(".trigger").click(function () {
		$(this).next(".container").slideToggle();	
	});
	
	$('#image').cycle({ 
    fx:     'fade', 
    timeout: 4000,
	pager: '#viewer-nav',
	
	pagerAnchorBuilder: function(idx, slide) { 
        return '<a href="#" class="id"></a>'; 
    } 
	});
	
	$(".menubox").css({ opacity: '0' });
	
	$("#menu a").mouseover(function () {
		var name = $(this).attr("id");
		$("." + name).stop(true, true).animate({
		opacity: '1',
		marginTop: '30px'
		});
	});
	
	$("#menu a").mouseout(function () {
		var name = $(this).attr("id");
		$("." + name).stop(true, true).animate({
		opacity: '0',
		marginTop: '20px'
		});
	});
	
//	$("#searchfield").focus(function () {
//		$("#searchfield").animate({ width: '553px'});
//	});
//	
//	$("#searchfield").blur(function () {
//		$("#searchfield").animate({ width: '255px' });
//	});
	
	$(".adress").attr("href", "mailto:info@dictodesigns.com");
	$(".adress").html("info@dictodesigns.com");
	
	$(".work span").css({ opacity: '0' });
	
	$(".work").mouseover(function() {
    $(this).find("span").stop().animate({
        opacity: '1',
		marginTop: '181px'
    }, 200);
	}).mouseout(function() {
    $(this).find("span").stop().animate({
        opacity: '0',
		marginTop: '200px'
    }, 200);
});

	$("#list").mouseover(function() {
    $(this).attr("src", "images/list-viewH.png");
	}).mouseout(function() {
    $(this).attr("src", "images/list-view.png");
	});
	
		$("#thumb").mouseover(function() {
    $(this).attr("src", "images/thumb-viewH.png");
	}).mouseout(function() {
    $(this).attr("src", "images/thumb-view.png");
	});
	
});
