﻿  hs.graphicsDir = 'js/highslide/graphics/';
  hs.outlineType = 'outer-glow';
  hs.wrapperClassName = 'outer-glow';

var currentLink; 


jQuery.event.add(window, "load", setSizes);
jQuery.event.add(window, "resize", setSizes);


function setSizes() 
{
    var h = $(window).height();
    var w = $(window).width();
    
    var navW = $("#topNavLinksContainer .topNavLinks").width();
    var roundW = Math.round(w);
    var newNavW = Math.round(w/8);
    var diffW = w - (newNavW*8); 
    var navImgH = Math.round(newNavW * 0.67);
    var minW = 900;
    
    var divTopHeight = $('#topBar').height();
    var divContentHeight = $('#contentWrapper').height();
    var divFooterHeight = $('#footerC').height();
    var divTotalHeight =  divTopHeight + divContentHeight +divFooterHeight;
    var divTotalDiff = h - divTotalHeight;
    
    if(divTotalDiff > 0){
    	$('#footSpace').css('height',divTotalDiff-30);
    }else{
    	$('#footSpace').css('height','10px');
    }
    
    $("#topBar").css('min-width', (minW + 20) );
if(roundW >= minW){
    
    $('.topNavLinksDescription').each(function(){
    	$(this).css('width', newNavW );
    	$(this).css('height', navImgH);
    });
    
    $('.topNavLinks li').each(function(){
    	$(this).css('width', newNavW);
    });
	    $('.topNavLinks li:last').css('width', newNavW+diffW);
}else{
    $('.topNavLinks li').each(function(){
    	$(this).css('width', '12.5%');
    });
}
};

function navigationSlide(){
$(".topNavLinks li").hover(
  function () {
		currentLink = $(this).attr('id');	
		$('.topNavLinksDescription').hide();
		if ($(this).hasClass('page')){
		
		}else{
			$(this).addClass('current');	
		}	
		$('#linkDescription'+currentLink).slideDown(400);
  },
  function(){
		currentLink = $(this).attr('id');
		if ($(this).hasClass('page')){
		
		}else{
			$(this).removeClass('current');			
		}	
	//	$('#linkDescription'+currentLink).slideUp('fast');
		$('.topNavLinksDescription').hide();
  });
};
function navigationSlideTable(){
$("#topNavLinksContainer td").hover(
  function () {
		currentLink = $(this).attr('id');	
		$('.topNavLinksDescription').hide();	
		$('#linkDescription'+currentLink).slideDown(400);
  },
  function(){
		$('.topNavLinksDescription').hide();
  });
};

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-7178430-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
function getFirst(div, type){
	var firstPup = $('#listing').children('img:first').attr('name');
	loadUserControlWithMedium(div, type+'/'+firstPup+'.txt');

}

function getFirstPup(div, type){
	var firstPup = $('#listing').children('img:first').attr('name');
	loadUserControlWithMedium(div, type+'/'+firstPup+'.html');

}



