var opera = (navigator.appName.indexOf("Opera") != -1) ? true : false;
var firefox = navigator.userAgent.toLowerCase(); 
    firefox = (firefox.indexOf("firefox") != -1) ? true : false;
var safari = navigator.userAgent.toLowerCase();
    safari = (safari.indexOf("safari") != -1) ? true : false;
var chrome = navigator.userAgent.toLowerCase();
    chrome = (chrome.indexOf('chrome') != -1) ? true : false;
var msie_only = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
var msie_old = false; // MSIE versions older than 7
var msie_80  = false; // MSIE version 8.0 or newer
var msie_70  = false; // MSIE vesrion 7.0
var msie_60  = false; // only MSIE 6.0
var msie_55  = false; // only MSIE 5.5

if (msie_only) {
  fullVerStr = navigator.appVersion;
  verStr = fullVerStr.substring(fullVerStr.indexOf('MSIE')+4,fullVerStr.length);
  verStr = verStr.substring(0,verStr.indexOf(';'));
  msie_old = (parseFloat(verStr) <  7.0) ? true : false;
  msie_80  = (parseFloat(verStr) >= 8.0) ? true : false;  
  msie_70  = (parseFloat(verStr) == 7.0) ? true : false;
  msie_60  = (parseFloat(verStr) == 6.0) ? true : false;
  msie_55  = (parseFloat(verStr) == 5.5) ? true : false;
}

document.writeln('<style type="text/css">\n/*<![CDATA[*/\n');
  if (msie_80) {
  }

  if (msie_70) {
  }

  if (msie_old) {

    

    //document.writeln("#SaraPerks {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/Images/SaraPerks.png', sizingMethod='scale');}\n");

  }
  if (msie_only) {
  //document.writeln('.SlideshowImage{display:none;}\n');
  }
  if (opera) {
  }
  if (firefox) {
  }
  if (safari) {
  }
  if (chrome) {
  }
  
 document.writeln('.DisplayNone {display:none;}\n');
 
  
document.writeln('/*]]>*/\n</style>\n');




















$(document).ready(function(){

$('a.OptionLink').hide();

$('.PortfolioLink1').hover(function(){
$(this).parent().find('img').animate({width:'150px'},300)
},
function(){
$(this).parent().find('img').animate({width:'12px'},300)
});

$('.PortfolioLink2').hover(function(){
$(this).parent().find('img').animate({width:'150px'},300)
},
function(){
$(this).parent().find('img').animate({width:'12px'},300)
});

$('#Dim01').css('display','none');










});//ready



function MenuOptions(clicked){
$('a.OptionLink').slideUp();
if($(clicked).parent().find('a.OptionLink').is(':hidden')){

   $(clicked).parent().find('a.OptionLink').slideDown();
    
}
else{
 $(clicked).parent().find('a.OptionLink').slideUp();
}


}



function ShowThumbnail (clicked){
	var image_source = $(clicked).parent().find('img:eq(1)').attr('src')
	$('.ThumbnailLargeImage').animate({opacity:'1'},500);
	$('.ThumbnailLargeImage').attr('src',image_source)
	$('.ThumbnailLargeImage2').animate({opacity:'0.'},500);
}

function ShowThumbnail2 (clicked){
	var image_source = $(clicked).parent().find('img:eq(1)').attr('src')
	$('.ThumbnailLargeImageHolder2').css('display','block');
	$('.ThumbnailLargeImage2').css('border','solid 2px #fff');
	$('.ThumbnailLargeImage2').animate({opacity:'1'},500);
	$('.ThumbnailLargeImage2').attr('src',image_source)
	$('.ThumbnailLargeImage').animate({opacity:'0'},500);
}


function ShowSet1(clicked){
$(clicked).parent().find('a:eq(4)').css('display','block');
$(clicked).css('display','none');
$(clicked).parent().parent().find('p').text('Photo-Set 1');
$('.ThumbnailViewerLarge:eq(0)').show();
$('.ThumbnailViewerLarge:eq(1)').hide();
}

function ShowSet2(clicked){
$(clicked).parent().find('a:eq(3)').css('display','block');
$(clicked).css('display','none');
$(clicked).parent().parent().find('p').text('Photo-Set 2');
$('.ThumbnailViewerLarge:eq(1)').show();
$('.ThumbnailViewerLarge:eq(0)').hide();
}

//function slideSwitch(){
// var $active = $('#slideshow img.active');
// if( $active.length == 0 ) {$active = $('#slideshow img:last');}
// var $next = $active.next().length ? $active.next()
//    : $('#slideshow img:first');
 
    
//    $active.addClass('last-active').animate({opacity: 0.0},200);
    
//    $next.css({opacity: 0.0})
//        .addClass('active')
//        .animate({opacity:1.0},200, function(){
//            $active.removeClass('active last-active');
//        });    
//}



//function slideSwitch(){

 //var $active = $('#slideshow img.active');
// if( $active.length == 0 ) {$active = $('#slideshow img:last');}
// var $next = $active.next('img');
// if($next.length == 0) {$next = $('#slideshow img:first')}
    
//    $next.addClass('active')
//        .animate({opacity:1.0},0, function(){
  //          $active.animate({opacity: 0.0},0);
  //          $active.removeClass('active');
    //    });    
//}


function slideSwitch(){

 var $active = $('#slideshow img.active');
 if( $active.length == 0 ) {$active = $('#slideshow img:last');}
var $next = $active.next().length ? $active.next()
    : $('#slideshow img:first'); 
 if($next.length == 0) {$next = $('#slideshow img:first')}
    
    $next.addClass('active')
        .animate({opacity:1.0},0, function(){
            $active.animate({opacity: 0.0},0);
            $active.removeClass('active');
        });    
}

var play_show = setInterval("slideSwitch()", 4000);









//$(function(){
//setInterval("slideSwitch()", 4000);
//});



function PlayShow(){
play_show = setInterval("slideSwitch()", 4000);}

function PauseShow(){
clearInterval(play_show);
}

function NextShow(){
$('#slideshow img').css({opacity: 0.0})

 var $active = $('#slideshow img.active');
 if( $active.length == 0 ) {$active = $('#slideshow img:last');}
 var $next = $active.next().length ? $active.next()
    : $('#slideshow img:first');
    
    $active.addClass('last-active').animate({opacity: 0.0},0);
    
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity:1.0},0, function(){
            $active.removeClass('active last-active');
        });    
}

function LastShow(){
$('#slideshow img').css({opacity: 0.0})

 var $active = $('#slideshow img.active');
 if( $active.length == 0 ) {$active = $('#slideshow img:last');}
 var $last = $active.prev().length ? $active.prev()
    : $('#slideshow img:first');
    
    $active.addClass('last-active').animate({opacity: 0.0},0);
    
    $last.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity:1.0},0, function(){
            $active.removeClass('active last-active');
        });    
}






