﻿function showValidators() {
    $('.inputCell').each(function() {
        validator = $(this).children("span")[0];
        if (validator != null)
            $(validator).css("visibility", "visible");
    });
    /*
    for (index in Page_Validators) {
    $(Page_Validators[index]).css("visibility", "visible");
    }
    */
}

$(document).ready(function() {
    $('a[rel*=facebox]').facebox()
});

$(document).ready(function() {
    $('a[title*=youtube]').each(function() {
        videoCode = $(this).attr("href").substring($(this).attr("href").indexOf("v=") + 2);

        embeddedVideo = "<div id=\"youtubeVideo\"  style=\"float: left; margin: 5px;\">";
        embeddedVideo += "<object width=\"235\" height=\"160\">";
        embeddedVideo += "<param name=\"movie\" value=\"http://www.youtube.com/v/"+videoCode+"&hl=en_US&fs=1&\"></param>";
        embeddedVideo += "<param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param>";
        embeddedVideo += "<embed src=\"http://www.youtube.com/v/"+videoCode+"&hl=en_US&fs=1&\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"235\" height=\"160\"></embed>";
        embeddedVideo += "</object>";
        embeddedVideo += "</div>";

        /*
        script1 = "<script type=\"text/javascript\">";
        script1 += "var flashvars ={};var params = {};var attributes = {styleclass:\"video\"};"
        script1 += " swfobject.embedSWF(src=\"http://www.youtube.com/v/" + videoCode + "&hl=en_US&fs=1&rel=0\", \"youtubeVideo\", \"235\", \"160\", \"8.0.0\");";
        script1 += "</script>";

        var flashvars = {};
        var params = {};
        var attributes = {};
        $(this).before(script1);
        */
        
        $(this).replaceWith(embeddedVideo);
    });
});

// 