﻿/*
MUSICA IN RETE                                                              
Designed & powered by (B) Solutionz all rights reserved.                   
(B) Solutionz by Luca Bassanini | www.lucabassanini.com                      
*/

function myWindowsOpener(myItemId) {
    radopen("Risorse/Viewers/Immagine.aspx?id=" + myItemId, "RadWindow1");
}
function myVideoWindowsOpener(myItemId) {
    radopen("Risorse/Viewers/Video.aspx?id=" + myItemId, "RadWindow1");
}
function myFormazioneWindowsOpener(myItemId) {
    radopen("Risorse/Viewers/Immagine.aspx?id=" + myItemId + "&corso=1", "RadWindow1");
}
function myFormazioneVideoWindowsOpener(myItemId) {
    radopen("Risorse/Viewers/Video.aspx?id=" + myItemId + "&corso=1", "RadWindow1");
}
function aggiornaPreview(myId, myTitle, myImg, myAlt) {
    var myImg = document.getElementById(myImg);
    myImg.src = "Public/Immagini/" + myId + ".jpg";
    myImg.alt = myAlt;
    var myStrong = document.getElementById(myTitle);
    myStrong.innerHTML = myAlt;
}
function myCounter(textBox, spanContatore, nCaratteri) {
    var caratteri;
    caratteri = document.getElementById(textBox).value.length;
    document.getElementById(spanContatore).innerHTML = caratteri + "/" + nCaratteri;
    if (document.getElementById(textBox).value.length >= nCaratteri) {
        document.getElementById(spanContatore).style.color = "Red";
        document.getElementById(spanContatore).style.fontWeight = "bold";
    } else if (document.getElementById(textBox).value.length < nCaratteri) {
        document.getElementById(spanContatore).style.color = "Black";
        document.getElementById(spanContatore).style.fontWeight = "normal";
    }
}