


/////////////////////////////////////////////////////////////////////////////////////////////ROLLOVER

var rolloverImages = Array();

rolloverImages['COLLECTION 2011'] = 'people_greenblue.jpg';
rolloverImages['PENDANTS'] = 'people_bricks.jpg';
rolloverImages['RINGS'] = 'people_rose.jpg';
rolloverImages['BRACELETS'] = 'people_rommy.jpg';
rolloverImages['EAR-CLIPS'] = 'people_claudia.jpg';
rolloverImages['OVERVIEW'] = 'people_bricks.jpg';
rolloverImages['CONTACT'] = 'people_greenblue.jpg';

    	

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}


var currentmenuelement;

function MM_swapImage() { //v3.0
	var menuelement = MM_swapImage.arguments[0];
  	rolloverRestore();
	//$('#layer-rollover').css("background-image", "url(img/slideshow/"+rolloverImages[menuelement]+")");  
	//$('#layer-rollover').animate({opacity: 0.3}, 1);
	
}
function MM_swapImgRestore() { //v3.0
	rolloverRestore();
  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function rolloverRestore(){
	$('#layer-rollover').css("background-image", "none"); 
	$find('.overall').css({opacity: 0.0});
	
}




/////////////////////////////////////////////////////////////////////////////////////////////SLIDESHOW

var debug;

var slidespeed = 0;
var slidepause = 4000;
var slidebegin = 10000;

function slideSwitch() {
    var $active = $('#slideshowcontainer DIV.active');

    if ( $active.length == 0 ){
    	$active = $('#slideshowcontainer DIV:last');
    }
    
   
	
	

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next() : $('#slideshowcontainer DIV:first');
   
    debug = $next;
    
    if($next.hasClass('hidden-nav')){
    	$("#nav").hide();
    }else{
    	$("#nav").show();
    }
    
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, slidespeed, function() {
            $active.removeClass('active last-active');
        });
}

var timerSlideshow;
function startSlideshow(){
	$('#pagenav').css({opacity: 0.0});
	$('#languagenav').css({opacity: 0.0});
	$('#overview').css({opacity: 0.0});
	$('.overview').css({opacity: 0.0});
	
	$('#slideshowcontainer').find("DIV").css({opacity:0.0});
	
	$('#slideshowcontainer').css({opacity:1.0});
	$('#slideshowcontainer').css({display:'inline'});
	$('#slideshowcontainer').css({visibility:'visible'});
	
	//$('#layer-background').css({opacity:0.0});
	//$('#layer-background').css({visibility:'visible'});
	clearInterval(timerSlideshow);
	clearInterval(timerSleep);
	slideSwitch();
	//$('#layer-background').css({opacity: 0.0}).animate({opacity: 1.0}, slidespeed);
    timerSlideshow = setInterval( "slideSwitch()", slidepause );
};




document.onclick=stopSlideshow;	
document.onmousemove=stopSlideshow;
timerSleep = window.setInterval("startSlideshow()", slidebegin);

function stopSlideshow(event)
{
	$("#nav").show();
	ev = event || window.event;
	clearInterval(timerSlideshow);
	clearInterval(timerSleep);
	$('#pagenav').css({opacity: 1.0});
	$('#languagenav').css({opacity: 1.0});
	$('#overview').css({opacity: 1.0});
	$('.overview').css({opacity: 1.0});
	$('#slideshowcontainer').css({visibility: 'hidden'})
	//$('#layer-background').css({opacity: 0.0}).animate({opacity: 0.0}, slidespeed);
	var $active = $('#layer-projector IMG');
    $active.css({opacity: 0.0})

	timerSleep = window.setInterval("startSlideshow()", slidebegin);	
}
	
	
	
jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    if(arguments[i]) jQuery("<img>").attr("src", arguments[i]);
  }
}



