$(document).ready(function(){

    $("ul.mainmenu li").hover(function(event)
		{ 
        $(this).find("ul.submenu").fadeIn('fast').show();

        $(this).hover(function() {
        }, function(){
            $(this).find("ul.submenu").fadeOut('fast');
        });
    });
    

		$('div#galleryboxes div.imagebox div.image').hover(
			function(){$(this).find('div.shortinfo:hidden').slideDown(500);},
			function(){$(this).find('div.shortinfo:visible').slideUp(100);}
		);


		$('div#galleryboxes div.imagebox div.image img[id|="projectid"]').click(function(event)
		{
			var idvalue=$(this).attr('id');
			idvalue=idvalue.split('-');
			$('div#right div.bigitem').fadeOut(250,function()
			{
				$('div#right').html($('div#galleryboxes div#projectidbig-'+idvalue[1]).html());
				
				if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
					jQuery(function($) {
						$("div#right a[rel^='slimbox']").slimbox({/* Put custom options here */}, null, function(el) {
							return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
						});
					});
				}
				
				$('div#right div.bigitem img[id^="img-p"]').click(function(event)
				{
					var idvalue2=$(this).attr('id');
          idvalue2=idvalue2.split('-');
          switch (idvalue2[2])
          {
						case '1':
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-2-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-3-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-4-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-1-big').fadeIn(500);
						break;

						case '2':
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-1-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-3-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-4-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-2-big').fadeIn(500);
						break;

						case '3':
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-1-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-2-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-4-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-3-big').fadeIn(500);
						break;

						case '4':
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-1-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-2-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-3-big').hide();
							$('div#right div#'+idvalue2[0]+'-'+idvalue2[1]+'-4-big').fadeIn(500);
						break;

					}
          
				});
				
				
				
				$('div#right div.bigitem').hide();
				$('div#right div.bigitem').fadeIn(250);
			});
		});



		$('div#galleryboxes div.imagebox div.image img[id|="projectid"]').first().click();


/*
				if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
					jQuery(function($) {
						$("div#right a[rel^='slimbox']").slimbox({}, null, function(el) {
							return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
						});
					});
				}
*/




});


