

$(function(initial) {
	
	//We have turned on Javascript
	$('body').addClass('js');	    
	
	//navigation (Active) button wrapper	
	$('#nav-sub a.button').wrapInner('<span></span>');
	$('#nav-sub a.button span').after('<i> </i>');	
	
	$("a[rel^='prettyPhoto']").prettyPhoto();
	$("a.external").attr('target','_blank');	
	

	
});	
	
 $(function(viewSelector) {  
      
       $('select#viewSelector').change(function () {
       
        	var QueryString = document.location.search;
			var QueryMatch = new RegExp("collectionType=(text|image)", "gi");
		
			QueryString = QueryString.substr(1, QueryString.length);
			QueryString = QueryString.replace(QueryMatch, '');
				
			var DocLocation = String(document.location);
			DocLocation = DocLocation.split('?');
			DocLocation = DocLocation[0];
		
			
			var DocumentURL = DocLocation + '?collectionType=' + $('#viewSelector').val();
			
			if (QueryString != '') {
				DocumentURL += '&' + QueryString;
			}
		
		document.location = DocumentURL;    	

	})
	
});	

 $(function(clicktracker) {  

	$(".clickTracker").click(function() {
		window.location = $(this).find("h2:first a:first").attr("href");  				  				
	});

});	






 $(function(paginationList) {  	
	var SelPagination = document.getElementsByName('paginationList');
	
	for (var i = 0; i < SelPagination.length; i++) {
		
		if (typeof attachEvent != 'undefined') {
			//ie only	
			SelPagination[i].onchange = function() {
				document.location = this.value;
			}
		} else {
			SelPagination[i].addEventListener('change', function() {
				document.location = String(this.value);
			}, true);
		}		
		
	}
	
});	

		



	
/* ###	SIFR	##################################################################################### */


  var font_h1= {
    src: '/js/sifr3.swf'
  };
  
   var font_h2= {
    src: '/js/sifr3.swf'
  };
	

  sIFR.useStyleCheck = true;
  sIFR.activate(font_h1);

  sIFR.replace(font_h1, {
    selector: 'h1'
	,wmode: 'transparent'
    ,css: [
      '.sIFR-root { color:#52504E;font-size:24px; }'
    ]
  });
  
  sIFR.useStyleCheck = true;
  sIFR.activate(font_h2);

  sIFR.replace(font_h2,  {
    selector: '#containerBlock h2, #containerBlock legend, #contactForm legend'
	,wmode: 'transparent'
    ,css: [
      '.sIFR-root { color:#52504E; font-size:18px; }'
    ]
  });



