function mainMenuDropdown()
		{
			$('#nav li').hoverIntent(function()
					{
						$(this).children('.sub_menu').slideDown(300);
					},
		
						function()
					{
						$(this).children('.sub_menu').slideUp(300);
					});
		};
		
function sliderArrows()
		{


			$('#slider_image_container').hover(
					function(){
						
						$('#slider_arrows').fadeIn(100);
						$('#slider_nav').fadeIn(100);
					},
					function(){
						$('#slider_arrows').fadeOut(100);
						$('#slider_nav').fadeOut(100);
					}
			);
		};

		
function galleryImages()
		{
			$('.project_image').fadeTo(0, 0.7);

			$('.one_project').hover(function()
				{
					$(this).children('.project_image').fadeTo(0, 1);
					$(this).children('.project_details').addClass('project_details_on');
					//Daki 12.10.11. 21.37 - adding details text to the block
					$('#project_details_right').html($(this).children('.product_info_container').html());
					
				},
				function()
				{
					$(this).children('.project_image').fadeTo(0, 0.7);
					$(this).children('.project_details').removeClass('project_details_on');
					$('#project_details_right').html('');
				}
				);
		}
		
function picSlideshow()
		{


			$("#slides").after('<div id="slider_nav">').cycle({
                activePagerClass: 'activeSlide',
				fx: 'fade',
				speed: 800,
				pause: 6,
				prev: '#slider_arrow_left',
				next: '#slider_arrow_right',
				pager:  '#slider_nav',
                after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
                    imgWidth=($(nextSlideElement).attr("width"));
                    imgHeight=($(nextSlideElement).attr("height"));

					
					//imgWidth=($(nextSlideElement).width());
					//alert(imgWidth);
					$('#slider_arrows').css('width', imgWidth);
					$('#slider_nav').css('width', imgWidth);
					//$('#slider_nav').css('top',imgHeight-647);
					$('#slides').css('height', imgHeight);
					
                }
			});
			$('#slider_nav').fadeOut(1);
		}
		
function stylsheetSwitcher()
		{
			
			$("#color_switch").click(function () {
					  if($(this).attr('rel')=='theme_white'){
						switchStylestyle('theme_black');
						$(this).attr('rel', 'theme_black');
					}else{
						switchStylestyle('theme_white');
						$(this).attr('rel', 'theme_white');
					}
					return false;
				  });

			
			//var c = readCookie('style');
		    //if (c) switchStylestyle(c);

			function switchStylestyle(styleName){
			  $('link[@rel*=style][title]').each(function(i){
				 $(this).attr('disabled', true);
				 if ($(this).attr('title') == styleName){ 
					$(this).attr('disabled', false);
				 }
			  });
			  createCookie('style', styleName, 365);
		   }

		}

		// cookie functions http://www.quirksmode.org/js/cookies.html
function createCookie(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)
{
	createCookie(name,"",-1);
}
// /cookie functions





function lightboxForContentImages(){

	//$('#main_content a[href=#]').attr('href', $(this).children("img:first").attr('src'));
	
	$('#main_content a[href=#]').attr('href', function(){
		$(this).attr('href', $(this).children("img:first").attr('src'));
		$(this).attr('rel', 'gallery_1');
		$(this).attr('class', 'dynamic_gallery_image');
	});
	

	
	$("#main_content .dynamic_gallery_image").fancybox({
		'titleShow'	:	false
	});

}



$(document).ready(function()
{
	
	mainMenuDropdown();
	stylsheetSwitcher();
	galleryImages();
	lightboxForContentImages();

});
