// JavaScript Document


$(document).ready(function(){
PEPS.rollover.init();
});


//Image Rollover
PEPS = {};
PEPS.rollover =
{
   init: function()
   {
      this.preload();
      $(".rollover").hover(
         function () { $(this).attr( 'src', PEPS.rollover.newimage($(this).attr('src')) ); },
         function () { $(this).attr( 'src', PEPS.rollover.oldimage($(this).attr('src')) ); }
      );
   },
   preload: function()
   {
      $(window).bind('load', function() {
         $('.rollover').each( function( key, elm ) { $('<img>').attr( 'src', PEPS.rollover.newimage( $(this).attr('src') ) ); });
      });
   },   
   newimage: function( src )
   {
      return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_r' + src.match(/(\.[a-z]+)$/)[0];
   },
   oldimage: function( src )
   {
      return src.replace(/_r\./, '.');
   }
};

$(document).ready(function(){
						   
	$("a[href='http://www.codan.com.au/impdev/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://codan.com.au/impdev/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
		
	$("a[href='http://www.codan.com.au/impdev/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://codan.com.au/impdev/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	
	
	$("a[href='http://www.codan.com.au/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://codan.com.au/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://www.codan.com.au/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://codan.com.au/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	
	$("a[href='http://www.codan.com.au/imp/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://www.codan.com.au/imp/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://codan.com.au/imp/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='http://codan.com.au/imp/Products/Graphics/MemDecalsbrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	
	$("a[href='/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='/Products/Graphics/Membrane/MaterialSelection/tabid/574/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
	$("a[href='/Products/Graphics/Decals/MaterialSelection/tabid/576/Default.aspx']").colorbox({iframe:true, width:805, height:500});
	
      $(".search #dnn_dnnSearch_txtSearch").css({ color: "#ABA2B3" }).attr({ value: 'Search...' }).focus(function(){
            if($(this).val()=="Search..."){
               $(this).css({ color: "#7F3FA0" }).val("");
            }
       }).blur(function(){
            if($(this).val()==""){
               $(this).css({ color: "#ABA2B3" }).val("Search...");
            }
       });
	   
	   
	/* ----------------------------------------------------
	Admin Logout Button
	----------------------------------------------------- */
	if( $("#dnnOtherTools").length>0 ) {
		$("#dnnOtherTools").after("<li><a href='/Logoff.aspx' style='color: red; font-weight: bold;'>Log Out</a></li>");
	}
	
});

