﻿$(document).ready(function() {
    $('#tabs .tabed_div').hide();
    $('#tabs div:first').show();
    $('#tabs ul li:first').addClass('active');

    $('#tabs ul li a').click(function() {
    $('#tabs ul li').removeClass('active');
        $(this).parent().addClass('active');
        var currentTab = $(this).attr('href');
        $('#tabs .tabed_div').hide();
        $(currentTab).show();
        return false;
    });
});


$(function() {
    var image = $('.image:first').attr("rel");
    var title = $('.image:first').attr("title");
    $('#image').html('<img src="' + image + '" width="250" height="180" />');
    $('#title').html(title);
    $(".image").mouseover(function() {
        var image = $(this).attr("rel");
        var title = $(this).attr("title");

        $('#gallery').fadeIn('slow');
        $('#image').html('<img src="' + image + '" width="250" height="180" />');
        $('#title').html(title);
        
        return false;
    });
});

$(function() {
    var video = $('.video:first').attr("rel");
    var title = $('.video:first').attr("title");
    $('#video').html('<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/' + video + '&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + video + '&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>');
    $('#title').html(title);

    $(".video").click(function() {
        var video = $(this).attr("rel");
        var title = $(this).attr("title");
        $('.video_btn').html('<img src="../../App_Themes/yekev/images/video_none_active.jpg" />');
        $(this).html('<img src="../../App_Themes/yekev/images/video_active.jpg" />');
        $('#videoGallery').fadeIn('slow');
        $('#video').html('<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/' + video + '&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + video + '&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>');
        $('#title').html(title);

        return false;
    });
});

$(function() {
    var video2 = $('.videoPart:first').attr("rel");
    var title2 = $('.videoPart:first').attr("title");
    $('#videoPart').html('<object width="300"><param name="movie" value="http://www.youtube.com/v/' + video2 + '&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + video2 + '&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" ></embed></object>');
    $('#titleVideoPart').html(title2);

    $(".videoPart").click(function() {
        var video2 = $(this).attr("rel");
        var title2 = $(this).attr("title");
        $('.video_btnPart').html('<img src="../../App_Themes/yekev/images/video_none_active.jpg" />');
        $(this).html('<img src="../../App_Themes/yekev/images/video_active.jpg" />');
        $('#videoGalleryPart').fadeIn('slow');
        $('#videoPart').html('<object width="300"><param name="movie" value="http://www.youtube.com/v/' + video2 + '&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + video2 + '&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" ></embed></object>');
        $('#titleVideoPart').html(title2);

        return false;
    });
});

$(document).ready(function() {
    $('.jqAlbumParser').jqAlbumParser({
        pluginExec: function() {
            $(this).jqGalViewII();
        }
    }).click();
});


function makepage(src)
{
  return "<html>\n" +
    "<head>\n" +
    "<title>Temporary Printing Window</title>\n" +
    "<script>\n" +
    "function step1() {\n" +
    "  setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    "<img src='" + src + "'/>\n" +
    "</body>\n" +
    "</html>\n";
}
function printme(src)
{
  link = "about:blank";
  var pw = window.open(link, "_new");
  pw.document.open();
  pw.document.write(makepage(src));
  pw.document.close();
}

