// -------------------------------------------------
// flash
// -------------------------------------------------

function FL_CloseFlash() {
	return CL_removePopup();
}

// ------------------------------------------
// contact form
// ------------------------------------------

var cu_children;
var cu_childControls = new Array();
var cu_isPostback = false;

function cu_showHideChildren() {
	var row = MM_findObj(cu_childControls[0]);

	if (cu_children && row) {
		var index = cu_children.selectedIndex;

		for (var i = 1; i < cu_childControls.length; i++) {
			var item = MM_findObj(cu_childControls[i]);
			if (item) {
				var cssClass = item.value == '' && cu_isPostback ? 'textinput2' : 'textinput';
				item.className = index >= i ? cssClass : 'hidden';
			}
		}
		row.className = index > 0 ? '' : 'hidden';
	}
}

function cu_registerChildren(id) {
	cu_children = MM_findObj(id);
}

// ------------------------------------------
// jquery RESELLER
// ------------------------------------------
$(document).ready(function() {
    $("#Reseller .mappingButton").click(function() {
        $("#Map").slideToggle("slow", function() {
            mappingButtonText();
        });
    });
    if ($("#Map").attr("detail") != "0") {
        $("#Map").css("display", "none");
    }
    mappingButtonText();
});
function mappingButtonText() {
    var open = "";
    var close = "";
    var lang = $("#Reseller .mappingButton span").attr("language");
    switch (lang) {
        case 'it':
            open = "Mostra mappa";
            close = "Chiudi mappa";
            break;
        case 'de':
            open = "Karte anzeigen";
            close = "Karte ausblenden";
            break;
        default:
            open = "Open map";
            close = "Hide map";
            break;       
    }
    if ($("#Map").css("display") == "none") {
        $("#Reseller .mappingButton span").html(open);
    } else {
        $("#Reseller .mappingButton span").html(close);
    }
}
