$(function() {

if ($("#viewer").length)
{	
	$("#viewer").imageScroller({
				next:"btn1",
				prev:"btn2",
				frame:"viewerFrame",
				width:150,
				child:".slideItem",
				auto:true,
				bigFrame: "beeld1",
				bigFrame2: "beeld2",
				showTitles: false,
				titleBgColor: "",
				titleBgPijl: "",
				showBig: true
			});
}

if ($("#viewer2").length)
{	
	$("#viewer2").imageScroller({
				next:"btn1",
				prev:"btn2",
				frame:"viewerFrame",
				width:150,
				child:".slideItem",
				auto:true,
				bigFrame: "beeld1",
				bigFrame2: "beeld2",
				showTitles: true,
				titleBgColor: "#83af45",
				titleBgPijl: "/cmsmedia/images/layout/pijltje.png",
				showBig: true
			});
}

if ($("#viewer3").length)
{	
	$("#viewer3").imageScroller({
				next:"btn1",
				prev:"btn2",
				frame:"viewerFrame",
				width:150,
				child:".slideItem",
				auto:true,
				bigFrame: "beeld1",
				bigFrame2: "beeld2",
				showTitles: true,
				titleBgColor: "#f37021",
				titleBgPijl: "/cmsmedia/images/layout/pijltjeO.png",
				showBig: true
			});
}

if ($("#viewer4").length)
{	
	$("#viewer4").imageScroller({
				next:"btn1",
				prev:"btn2",
				frame:"viewerFrame",
				width:150,
				child:".slideItem",
				auto:true,
				bigFrame: "beeld1",
				bigFrame2: "beeld2",
				showTitles: true,
				titleBgColor: "#ed1c24",
				titleBgPijl: "/cmsmedia/images/layout/pijltjer.png",
				showBig: true
			});
}


if ($("#viewer5").length)
{	
	$("#viewer5").imageScroller({
				next:"btn1",
				prev:"btn2",
				frame:"viewerFrame",
				width:150,
				child:".slideItem",
				auto:true,
				bigFrame: "beeld1",
				bigFrame2: "beeld2",
				showTitles: true,
				titleBgColor: "#fdb813",
				titleBgPijl: "/cmsmedia/images/layout/pijltjeg.png",
				showBig: true
			});
}

/*$('#miss').dialog({
				autoOpen: true,
				show: 'blind',
				width: 825,
				modal: true
				});
*/

$(".hoverswap2").hover(
		function () {
			//$(this).attr("src", $(this).attr("src").replace(/.gif/, "-over.gif"));
			//alert($(this).css("background").replace(".png", "-over.png"));
			if($(this).attr("rel") != "selected"){
				$(this).css("background-image", $(this).css("background-image").replace(".png", "-over.png"));
			}

		},
		function () {			
			if($(this).attr("rel") != "selected"){
				$(this).css("background-image", $(this).css("background-image").replace("-over.png", ".png"));
			}
		}
	);


  var container = $(".stars");
  container
    .hover(
    
     
      // fade background div out when cursor enters and change the color of the text to yellow,
      function()
      {
        $(".background", this).css("background-image", "none").css("background-image","url(/cmsmedia/images/layout/1.gif)");
      },
      // fade back in when cursor leaves and fade the color back to white
      function()
      {
       $(".background", this).css("background-image", "none").css("background-image","url('/cmsmedia/images/layout/1_.gif')");
      })
    // allow positioning child div relative to parent
    .css('position', 'relative')
    // create and append background div
    // (initially visible, obscuring parent's background)
    .append( $("<div>")
      .attr('class', 'background')
      .css({
        backgroundColor:'black',
        position: 'absolute',
        top:0,
        left:0,
        zIndex:-1,
        width:container.width(),
        height:container.height()
      })
    );
});


