//window.name = "SecondaryPage";
/*window.onbeforeunload = function (){
    bringBackHome();
  }*/
function getInternetExplorerVersion()
{
  var rv = -1; // Return value assumes failure.    
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;        
    var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");        
    if (re.exec(ua) != null)
    {
      rv = parseFloat(RegExp.$1);    
    }    
    return rv;
   }
}

  
function checkVersion()
{  
   ver = getInternetExplorerVersion();    
   if (ver > -1)
    {
      if (ver >= 8.0)
      {
         /*alert('IE Version 8');*/
      }
    }
}


  
function showLogo()
{
     $(function(){
       var $logo = $('div#logo');
       var $body = $('body');
       var $content = $('div#content');
       $logo.css('visibility', 'visible');
       //$body.css({'background-image': 'url(background.jpg)', 'overflow':'hidden'});
       $body.css({'background-color':'#000000', 'overflow':'hidden'});
       $content.css('top', 80);
       var $close = $('.close');
       var $goRoll = $('.goRoll');
       $close.css('visibility', 'hidden');
       $goRoll.css('visibility', 'visible');
    });
}

function bringBackHome()
{
  
    if (independent != true)
    {
        parent.bringBackHome();
        
    }else{
        window.location.href = "/"
    }
}
          
function homeAndWall(hasgallery)
{
    window.location.href = "/default.aspx?galreq="+hasgallery
}
          
function hideContentSA()
{
    if (ver != 8.0)
   {
     $(function(){
         var $cHide = $('#contBackground');;
         $cHide.animate({opacity:0}, 1000);
       });
  }
    else
  {
    $(function(){
         var $cHide = $('#contBackground');
         $cHide.css('visibility', 'hidden');
    });
  }
}

function showContentSA()
{
    if (ver != 8.0)
   {
     $(function(){
         var $cShow = $('#contBackground');
         $cShow.animate({opacity:1}, 1000);
       });
  }
    else
  {
    $(function(){
          var $cShow = $('#contBackground');
         $cShow.css('visibility', 'visible');
    });
   }
}
          
function hideContent()
{
   if (ver != 8.0)
   {
     $(function(){
        //var $saHide = $('smallAdContent');
        var $cHide = $('#contBackground');;
        $cHide.animate({opacity:0}, 1000);
        $('#smallAdContent').hide();
       });
  }
    else
  {
    $(function(){
         var $cHide = $('#contBackground');
         var $saHide = $('smallAdContent');
         $cHide.css('visibility', 'hidden');
         $saHide.css('visibility', 'hidden');
    });
  }
}

function showContent()
{
  if (ver != 8.0)
   {
     $(function(){
         //var $saShow = $('smallAdContent');
         var $cShow = $('#contBackground');
         $cShow.animate({opacity:1}, 1000);
         $('#smallAdContent').show();
         //$saShow.css('visibility', 'visible');
       });
  }
    else
  {
    $(function(){
          var $cShow = $('#contBackground');
          var $saShow = $('smallAdContent');
          $cShow.css('visibility', 'visible');
          $saShow.css('visibility', 'visible');
    });
   }
}

function showBookMarks()
{
    $(function(){
    
            var $bMark = $('#bookmarks');
           $bMark.animate({left:50}, 'slow');
       });
}

function hideBookMarks()
{
    $(function(){
            var $bMark = $('#bookmarks');
           $bMark.animate({left:-400}, 'slow');
       });
}
 
var independent;
var hasgallery = "";
var ver;
checkVersion();

if (window.name != 'ifrm1')
{
    independent = true;
    showLogo();
}else{
      $(function(){
         var $close = $('.close');
          var $goRoll = $('.goRoll');
           $close.css('visibility', 'visible');
           $goRoll.css('visibility', 'hidden');
       });
}

var scroller; //= null;
window.onload = function () {
  var el = document.getElementById("Scroller-1");
  scroller = new jsScroller(el, 610, 475);
}
swfobject.embedSWF("roll35Ad.swf", "adContent", "865", "450", "9.0.0", null, null, {wmode:"transparent"});
swfobject.embedSWF("roll35SmallAd.swf", "smallAdContent", "500", "360", "9.0.0", null, null, {wmode:"transparent"});
swfobject.embedSWF("galleryButton.swf", "galleryButton", "19", "166", "9.0.0", null, null, {wmode:"transparent"});

/*$(function() {
    var zIndexNumber = 1000;
    $('div').each(function() {
        $(this).css('zIndex', zIndexNumber);
        zIndexNumber -= 10;
    });
});*/