$(document).ready(function () {
    $("a.grouped-elements").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'speedIn': 600,
        'speedOut': 200,
        'overlayShow': false
    });

    $("a.video").click(function () {
        $.fancybox({
            'padding': 0,
            'autoScale': false,
            'transitionIn': 'elastic',
            'transitionOut': 'elastic',
			'speedIn': 600,
        	'speedOut': 200,
            'title': this.title,
            'width': 680,
            'height': 495,
			'overlayShow': false,
            'href': this.href = this.href.replace(new RegExp("watch\\?v=", "i"), 'v/') + '&autoplay=1',
            'type': 'swf',
            'swf': {
                'allowfullscreen': 'true'
            }
        });
        return false;

    });

});

$(document).ready(function () {
    $(".portfolio-thumb img").fadeTo("slow", 0.3);
    $(".portfolio-thumb img").hover(function () {
        $(this).fadeTo("slow", 1.0);
    }, function () {
        $(this).fadeTo("slow", 0.3);
    });
});


function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
  $(document).ready(function(){
    $(".ro_extended").hide();
    var id_param = gup( 'id' );
	if(id_param != "") {$(document.getElementById("ro_extended_"+id_param)).show();}
     $(".ro_header").click(function () {
     var full_ro_header_id = this.id;
     var full_ro_extended_id = full_ro_header_id.split("_");
     var ro_extended_id = "ro_extended_"+full_ro_extended_id[2];
      $(".ro_extended").hide();
      $(document.getElementById(ro_extended_id)).show("slow");
      return false;
    });
  });


