$(document).ready(function ()
{
  $('#language').change(function() {
    $('#change_language').submit();
  });
  
  $('#arrow-left').click(function()
  {
   // alert('ho');
  });

  $('a[rel*=shadowframe]').click(function() 
  {
    Shadowbox.open({
      content:    this,
      player:     "iframe",
      height:     560,
      width:      750
    }); 
    
    return false;
  });

  Shadowbox.setup("#page_text > a:has(img)", 
  {
    gallery:            "My Movies",
    autoplayMovies:     true
  });
  
  Shadowbox.setup("#page_text p > a:has(img)", 
  {
    gallery:            "My Movies",
    autoplayMovies:     true
  });
  
  Shadowbox.init({
    handleOversize: "drag",
    modal: true,
    onOpen: moveCloseLink
  });  
  
	$(function(){		
    $('#sub_menu').jqcollapse({
       slide: true,
       speed: 1000,
       easing: 'easeOutCubic'
    });
  });  
});

function moveCloseLink()
{ 
  var cb=document.getElementById('sb-nav-close'); 
  var tb=document.getElementById('sb-title'); 
  if(tb) tb.appendChild(cb); 
} 

  //var arr = new Array();
  
//  $("#page_text > a:has(img)").each(function(obj)
//  {
//      arr[arr.length] = 
//      {
//        player: "img", 
//        content: $(this).attr("href"), 
//        gallery: "portefolio"
//      };
//
//  });
  
//  $("#page_text > a:has(img)").click(function()
//  {
//   // alert($("#page_text > a:has(img)"));
//    Shadowbox.open(arr); 
//    return false;
//  }); 
//    
