﻿// File JScript
var selected;
var tab;
var myimages=new Array();

function selectTab()
{
    if (tab==null)
        return;
    selected = tab;
    if (tab.id=="menu_home")
    {
        tab.className="menu_selected_sx";
        return;
    }
    if (tab.id=="menu_pubblicita")
    {
        tab.className="menu_selected_dx";
        return;
    }
    tab.className="menu_selected";
} 

    
function preloadimages()
{
    for (i=0;i<preloadimages.arguments.length;i++)
    {
        myimages[i]=new Image(146,28);
        myimages[i].src=preloadimages.arguments[i];
    }
}



function redirectPage(item, hidden)
{
    if(hidden.value=="False")
    {
        if (item.id=="ctl00_second_label")
            parent.location='suweb.aspx';
        if (item.id=="ctl00_third_label")
            parent.location='ppec.aspx';
        if (item.id=="ctl00_fourth_label")
            parent.location='partner.aspx';
        if (item.id=="ctl00_fifth_label")
            parent.location='convenzioni.aspx';
    }
    else
    {
        if (item.id=="ctl00_second_label")
            parent.location='professionisuweb.aspx';
        if (item.id=="ctl00_third_label")
            parent.location='suweb.aspx';
        if (item.id=="ctl00_fourth_label")
            parent.location='ppec.aspx';
        if (item.id=="ctl00_fifth_label")
            parent.location='partner.aspx';
        if (item.id=="ctl00_sixth_label")
            parent.location='convenzioni.aspx';
    }
}

function deselect(item)
{
    item.style.backgroundColor = "white";
    item.style.color = "black";
}

function select(item)
{
    item.style.backgroundColor = "blue";
    item.style.color = "white";
}

        
function changeAspectTab(actual)
{
    if (selected == actual)
        return;
    if (actual.id=="menu_home")
    {
        actual.className="menu_notselected_sx";
        return;
    }
    if (actual.id=="menu_pubblicita")
    {
        actual.className="menu_notselected_dx";
        return;
    }
    actual.className="menu_notselected";
}

function copyValue(listEl, target)
{
//    if (who == "nascita")
//        document.getElementById("ctl00_ContenutoPrincipale_text_provincianascita").value = (listEl.innerHTML);
//    if (who == "residenza")
//        document.getElementById("ctl00_ContenutoPrincipale_text_provincia").value = (listEl.innerHTML);
//    if (who == "società")
//        document.getElementById("ctl00_ContenutoPrincipale_text_provinciasoc").value = (listEl.innerHTML);
        target.value = listEl.innerHTML;
}
