/*** Ajax ***/
// Questo è per i post
function xmlhttpPost(strURL)
{
    var xmlHttpReq = false;
    var self = this;

    if (window.XMLHttpRequest) {
        // Xhr per Mozilla/Safari/Ie7
        self.xmlHttpReq = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        // Per tutte le altre versioni di IE
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    return self;
}

function updatepage(str, resultId)
{
    if (str.indexOf('__captcha') != -1) {
        var now = new Date();
        document.getElementById('captchaerror').innerHTML = str.substr(17);
        document.getElementById('captchaimg').src = '/captcha.php?' + now.getTime();
        document.getElementById('caricamento').style.display = 'none';
        document.getElementById(resultId).style.display = '';
    } else if (str.indexOf('__string') != -1 && str.indexOf('__string') == 0) {
        document.getElementById(resultId).innerHTML = str.substr(8);
        document.getElementById(resultId).style.display = '';
        document.getElementById('caricamento').style.display = 'none';
    } else if (str.indexOf('__redirect') != -1 && str.indexOf('__redirect') == 0) {
        window.location.assign(str.substr(10));
    }

}

function getquerystring(formId)
{
    var formObj = document.getElementById(formId);
    var num = formObj.elements.length;
    qstr = '';

    for (var i = 0; i < num; i++)
    {
        var chiave = formObj.elements[i].name;
        var valore = formObj.elements[i].value;
        var tipo = formObj.elements[i].type;

        if ((tipo == "submit") || (tipo == "image")){}
        else {
            if (valore != '')
                qstr += chiave + "=" + escape(valore) + "&";
        }
    }

    return qstr;
}

// Questo è per i get
function tokiCall(strURL, resultId, formId)
{
    xmlObj = xmlhttpPost(strURL, formId, resultId);
    xmlObj.xmlHttpReq.onreadystatechange = function()
    {
        if (xmlObj.xmlHttpReq.readyState == 4)
            updatepage(xmlObj.xmlHttpReq.responseText, resultId);
    }

    xmlObj.xmlHttpReq.send(getquerystring(formId));
}
function validate_form(frm)
{
    var value = '';
    var errFlag = new Array();
    var _qfGroups = {};
    _qfMsg = '';
    value = frm.elements['privacy'].checked? '1': '';
    if (!frm.elements['numerocell'].value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
        alert('Sono consentiti solo numeri di cellulari');
        frm.elements['numerocell'].focus();

        return false;
    }
    if (value == '' && !errFlag['privacy']) {
        errFlag['privacy'] = true;
        _qfMsg = _qfMsg + '\n - Devi accettare le condizioni della privacy per poter continuare!';
    }
    if (_qfMsg != '') {
        _qfMsg = 'Sono state inserite delle informazioni non valide.' + _qfMsg;
        _qfMsg = _qfMsg + '\nCorreggere gli errori.';
        alert(_qfMsg);

        return false;
    }
    return true;
}

function validate_form_new(frm, controllo_check, checkGoogle)
{
    var value = '';
    var errFlag = new Array();
    var _qfGroups = {};
    _qfMsg = '';
    value = frm.elements['privacy'].checked? '1': '';
    if (!frm.elements['numerocell'].value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
        alert('Sono consentiti solo numeri di cellulari');
        frm.elements['numerocell'].focus();

        return false;
    }

    var oper_tim = document.getElementById('oper_tim');
    var oper_vod = document.getElementById('oper_vod');
    var oper_win = document.getElementById('oper_win');
    var oper_tre = document.getElementById('oper_tre');
    if (oper_tim.checked == false && oper_vod.checked == false && oper_win.checked == false && oper_tre.checked == false) {
        alert('Devi selezionare un operatore per poter continuare!');

        return false;
    }

    if (checkGoogle == 'yes' && (controllo_check == '0' || controllo_check == '')) {
        value = 'noCheck';
    }

    if (value == '' && !errFlag['privacy']) {
        errFlag['privacy'] = true;
        _qfMsg = _qfMsg + '\n - Devi accettare le condizioni della privacy per poter continuare!';
    }
    if (_qfMsg != '') {
        _qfMsg = 'Sono state inserite delle informazioni non valide.' + _qfMsg;
        _qfMsg = _qfMsg + '\nCorreggere gli errori.';
        alert(_qfMsg);

        return false;
    }
    return true;
}

function validate_form_new2(frm, controllo_check_google, checkGoogle, submFrom, alice, controllo_check_facebook, checkFacebook)
{
    var value = '';
    var errFlag = new Array();
    var _qfGroups = {};
    _qfMsg = '';
    value = frm.elements['privacy'].checked? '1': '';

    var tastoInvio = document.getElementById('invio');
    
    if (tastoInvio) {
    	tastoInvio.disabled = true;
    }

    if (!alice || alice != '1') {
        if (!frm.elements['numerocell'].value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
            if (submFrom != 'puls') {
                var alrt = 'Sono consentiti solo numeri di cellulari';
                
                if (document.getElementById('numerocell').value == 'Il tuo numero di cellulare')
                    document.getElementById('numerocell').value = '';
                    
                alert(alrt);
            }            
            frm.elements['numerocell'].focus();
            
            if (tastoInvio)
    	    	tastoInvio.disabled = false;
    
            return false;
        }
    }

    var oper_tim = document.getElementById('oper_tim');
    var oper_vod = document.getElementById('oper_vod');
    var oper_win = document.getElementById('oper_win');
    var oper_tre = document.getElementById('oper_tre');
    
    if (oper_tim && oper_vod && oper_win && oper_tre) {
        if (!document.getElementById('oper_tim').checked && !document.getElementById('oper_vod').checked && !document.getElementById('oper_win').checked && !document.getElementById('oper_tre').checked) {
            alert('Devi selezionare un operatore per poter continuare!');
    
            if (tastoInvio)
    	    	tastoInvio.disabled = false;
            
            return false;
        }
    }

    // GOOGLE SYSTEM
    if (checkGoogle == 'yes' && (controllo_check_google == '0' || controllo_check_google == '')) {
        return true;
    }
    
    // FACEBOOK SYSTEM
    if (checkFacebook == 'yes' && (controllo_check_facebook == '0' || controllo_check_facebook == '')) {
        return true;
    }

    if (!frm.elements['privacy'].checked) {
        alert('Devi accettare le condizioni della privacy per poter continuare!');

        if (tastoInvio)
	    	tastoInvio.disabled = false;
        
        return false;
    }

    if (tastoInvio) {
    	tastoInvio.disabled = true;
    }
    
    return true;
}

function validate_form_new4(frm, controllo_check_google, checkGoogle, submFrom, alice, controllo_check_facebook, checkFacebook)
{
    var value = '';
    var errFlag = new Array();
    var _qfGroups = {};
    _qfMsg = '';
    value = frm.elements['privacy'].checked? '1': '';

    var tastoInvio = document.getElementById('invio');
    
    if (tastoInvio) {
    	tastoInvio.disabled = true;
    }

    if (!alice || alice != '1') {
        if (!frm.elements['numerocell'].value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
            if (submFrom != 'puls') {
                var alrt = 'Sono consentiti solo numeri di cellulari';
                
                if (document.getElementById('numerocell').value == 'Il tuo numero di cellulare')
                    document.getElementById('numerocell').value = '';
                    
                alert(alrt);
            }            
            frm.elements['numerocell'].focus();
            
            if (tastoInvio)
    	    	tastoInvio.disabled = false;
    
            return false;
        }
    }

    var oper_tim = document.getElementById('oper_tim');
    var oper_vod = document.getElementById('oper_vod');
    var oper_win = document.getElementById('oper_win');
    var oper_tre = document.getElementById('oper_tre');
    
    if (oper_tim && oper_vod && oper_win && oper_tre) {
        if (!document.getElementById('oper_tim').checked && !document.getElementById('oper_vod').checked && !document.getElementById('oper_win').checked && !document.getElementById('oper_tre').checked) {
            alert('Devi selezionare un operatore per poter continuare!');
    
            if (tastoInvio)
    	    	tastoInvio.disabled = false;
            
            return false;
        }
    }

    // GOOGLE SYSTEM
    if (checkGoogle == 'yes' && (controllo_check_google == '0' || controllo_check_google == '')) {
        return true;
    }
    
    // FACEBOOK SYSTEM
    if (checkFacebook == 'yes' && (controllo_check_facebook == '0' || controllo_check_facebook == '')) {
        return true;
    }

    if (!frm.elements['privacy'].checked) {
        alert('Devi accettare le condizioni della privacy per poter continuare!');

        if (tastoInvio)
	    	tastoInvio.disabled = false;
        
        return false;
    }

    if (tastoInvio) {
    	tastoInvio.disabled = true;
    }
    
    return true;
}

function validate_policy(frm)
{
    var value = '';
    var errFlag = new Array();
    var _qfGroups = {};
    _qfMsg = '';
    value = frm.elements['privacy'].checked? '1': '';
    if (value == '' && !errFlag['privacy']) {
        errFlag['privacy'] = true;
        _qfMsg = _qfMsg + '\n - Devi accettare le condizioni della privacy per poter continuare!';
    }
    if (frm.elements['codice'].value == '') {
        alert('Inserire il PIN');
        frm.elements['codice'].focus();
        return false;
    }
    if (_qfMsg != '')
    {
        _qfMsg = 'Sono state inserite delle informazioni non valide.' + _qfMsg;
        _qfMsg = _qfMsg + '\nCorreggere gli errori.';
        alert(_qfMsg);

        return false;
    }
    return true;
}


function change_content_reload(URLID_NUOVO, URLID_ATTUALE, par)
{
    var loc = window.location.href;

    var parz = '?';
    if (loc.indexOf("?contenuto=") != -1 || loc.indexOf("&contenuto=") != -1) {
        var str_cont_attuale    = 'contenuto=' + URLID_ATTUALE;
        var str_cont_nuovo      = 'contenuto=' + URLID_NUOVO;

        if (loc.indexOf("?contenuto=") != -1)
            var parz = '?';
        else if (loc.indexOf("&contenuto=") != -1) 
            var parz = '&';

        if (URLID_ATTUALE == "NULL") {
            loc = loc.replace(parz + 'contenuto=', '');
            var str_loc = loc.replace(str_cont_attuale, str_cont_nuovo);

            window.location.href = str_loc;
        } else if (URLID_ATTUALE == "CLEAR")
            window.location.href = loc + parz + 'contenuto=' + URLID_NUOVO;
        else {
            var str_loc = loc.replace(str_cont_attuale, str_cont_nuovo);

            window.location.href = str_loc;
        }
    } else {
        if (loc.indexOf("?") != -1)
            window.location.href = loc + '&contenuto=' + URLID_NUOVO;
        else
            window.location.href = loc + '?contenuto=' + URLID_NUOVO;
    }
}

function change_preview_click(URLID, extension)
{
    var div_prev = document.getElementById('preview_click');

    if (div_prev)
        //div_prev.innerHTML = '<img src="/images/splashpages/cover_album/80x80/' + URLID + '.' + extension + '" border="0" alt="" title="" />';
        div_prev.innerHTML = '<img src="/images/covers/80x80/' + URLID + '.' + extension + '" border="0" alt="" title="" />';
}

function displayPolicy(idDisplay, disp)
{
	var policies = document.getElementById(idDisplay);

	policies.style.display = disp;
}

function change_preview_click2(URLID, extension, title, dir, manufacturer)
{
    var div_prev = document.getElementById('preview_img');
    var div_tit = document.getElementById('preview_title');
    var div_manufacturer = document.getElementById('preview_author');

    if (!dir || dir == '')
    	//dir = 'splashpages/cover_album/80x80/';
    	dir = 'covers/80x80/';
	if (!manufacturer || manufacturer == '')
		manufacturer = '';

    if (div_prev)
        div_prev.innerHTML = '<img src="/images/' + dir + URLID + '.' + extension + '" border="0" alt="" title="" />';
        
    if (div_tit)
        div_tit.innerHTML = title;
        
    if (div_manufacturer)
    	div_manufacturer.innerHTML = manufacturer;
}

function bg_concorso_li(iteration, form, n_iterations, prefix)
{
    for (k = 1; k <= n_iterations; ++k) {
        if (k == iteration)
            document.getElementById(prefix + k).style.display = 'block';
        else
            document.getElementById(prefix + k).style.display = 'none';
    }
}

function scroll_covergallery(typescr, downpix)
{
    var scroll_clipper = document.getElementById('cover_gallery');

    if (typescr == 'up') {
        scroll_clipper.scrollTop = 0;
        document.getElementById('freccia_up').style.visibility = 'hidden';
        document.getElementById('freccia_down').style.visibility = 'visible';
    } else if (typescr == 'down') {
        scroll_clipper.scrollTop = downpix;
        document.getElementById('freccia_up').style.visibility = 'visible';
        document.getElementById('freccia_down').style.visibility = 'hidden';
    }
}

function checkDiv(obJ, divDisplay, arrayCampi, event)
{
	var div_appear = document.getElementById(divDisplay);

	var campoError = "";
	var contr = "yes";
	for (k = 0; k < arrayCampi.length; ++k) {
		if (arrayCampi[k] == 'numerocell' && !document.getElementById(arrayCampi[k]).value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
			contr = "no";
			campoError = arrayCampi[k];
		} else if (arrayCampi[k] == 'nominativo' && (document.getElementById(arrayCampi[k]).value == '' || document.getElementById(arrayCampi[k]).value.length < 2)) {
			contr = "no";
			campoError = arrayCampi[k];
		} else {
			if (document.getElementById(arrayCampi[k]).value == '') {
				contr = "no";
				campoError = arrayCampi[k];
			}
		}
	}

	if (!event || event == '') {
		if (contr == 'yes')
			div_appear.style.display = "block";
		else
			div_appear.style.display = "none";
	} else if (event == 'checkForm') {
		if (contr == 'no') {
			if (campoError && campoError != "" && document.getElementById(campoError))
				document.getElementById(campoError).focus();
				
			alert('Tutti i campi sono obbligatori!');

			return false;
		} else {
			return true;
		}
	}
}



function validate_form_new3(arrayCampi, controllo_check, checkGoogle, submFrom)
{
    var value = '';
    var privacy = document.getElementById('privacy');
    var numerocell = document.getElementById('numerocell');
    var tastoInvio = document.getElementById('invio');
    value = privacy.checked? '1': '';

    var campoError = "";
	var contr = "yes";
	for (k = 0; k < arrayCampi.length; ++k) {
		if (arrayCampi[k] == 'numerocell' && !document.getElementById(arrayCampi[k]).value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
			contr = "no";
			campoError = arrayCampi[k];
		} else if (arrayCampi[k] == 'nominativo' && (document.getElementById(arrayCampi[k]).value == '' || document.getElementById(arrayCampi[k]).value.length < 2)) {
			contr = "no";
			campoError = arrayCampi[k];
		} else {
			if (document.getElementById(arrayCampi[k]).value == '') {
				contr = "no";
				campoError = arrayCampi[k];
			}
		}
	}

	if (contr == 'no') {
		if (campoError && campoError != "" && document.getElementById(campoError))
			document.getElementById(campoError).focus();
			
		alert('Tutti i campi sono obbligatori!');

		return false;
	} else
		return true;

    /*if (numerocell && !numerocell.value.match(/^((00|\+)39[\.]??)??3\d{2}[\.]??\d{6,8}$/)) {
        if (submFrom != 'puls') {
        	alert('Sono consentiti solo numeri di cellulari');
    	}
        numerocell.focus();

        return false;
    }*/

    if (checkGoogle == 'yes' && (controllo_check == '0' || controllo_check == ''))
        return true;

    if (privacy && !privacy.checked) {
        alert('Devi accettare le condizioni della privacy per poter continuare!');

        return false;
    }

    if (tastoInvio)
        tastoInvio.disabled = true;

    return true;
}


function invioParametri(numeroCell, operatore, pinCode, prefixAddpars, parameters)
{
	var form = document.getElementById('frm_inv_n');
	var inputNumeroCell = document.getElementById('numerocell');
	var inputOperatore = document.getElementById('operatore');
	var inputPin = document.getElementById('codice');
	var spanCampiHidden = document.getElementById('flash_inputs');

	if (numeroCell == undefined)
		numeroCell = "";
		
	if (operatore == undefined)
		operatore = "";
	
	if (pinCode == undefined)
		pinCode = "";

	// Se sono nella fase di inserimento numero
	if (form && !pinCode) {
		if (form) {
			if (inputNumeroCell)
				inputNumeroCell.value = numeroCell;

			if (spanCampiHidden) {
				if (operatore != '')
					spanCampiHidden.innerHTML += "<input type='hidden' name='operatore' id='operatore' value='" + operatore + "' />";

				if (prefixAddpars != '' && parameters != '')
					spanCampiHidden.innerHTML += "<input type='hidden' name='" + prefixAddpars + "pars_add' id='pars_add' value='" + parameters + "' />";
			}
		}
	} else { // Se sono nella fase di inserimento codice pin
		if (form) {
			if (inputPin)
				inputPin.value = pinCode;
		}
	}

	form.submit();
}

function checkValueNumcell(inputObj, txt_default)
{
	if (inputObj.value == txt_default)
		inputObj.value = "";
}


function displayFormValori(idDisplay, disp, risposte, exp)
{
	var objDisp = document.getElementById(idDisplay);	
	
	objDisp.style.display = disp;
	
	/*
	if (typeof arr_id_disp == 'object') {        
        for (k = 0; k < arr_id_disp.length; ++k) {
            //alert('ID: ' + arr_id_disp[k] + ' VALUE: ' + arr_disp[k]);
            
            var objDisp = document.getElementById(arr_id_disp[k]);
            	
            objDisp.style.display = arr_disp[k];
        }
    } else if (typeof arr_id_disp == 'string') {
        var objDisp = document.getElementById(arr_id_disp);
            	
        objDisp.style.display = arr_disp;
    }
	*/
	
	var var_agg = document.getElementById('var_agg');
	var arr_pars = new Array();
	if (risposte != '' && var_agg) {
		if (exp && exp != '') {
			explode = risposte.split('|');
			for (k = 0; k < explode.length; ++k) {
				arr_pars[k] = explode[k];
			}
		} else {
			if (typeof risposte == 'string')
				arr_pars[0] = risposte;
			else {
				for (k = 0; k < risposte.length; ++k) {
					arr_pars[k] = risposte[k];
				}
			}
		}
		var_agg.innerHTML += "<input type='hidden' name='addpar_valori' id='addpar_valori' value='" + arr_pars + "' />";
	}
}

function displayObject(arr_idDisplay, arr_styleDisplay)
{
	var n_arr_idDisplay = 1;
	var n_arr_styleDisplay = 1;
	
	var type_arr_idDisplay = typeof arr_idDisplay;
	var type_arr_styleDisplay = typeof arr_styleDisplay;
	
	if (type_arr_idDisplay != 'string')
		var n_arr_idDisplay = arr_idDisplay.length;
		
	if (type_arr_styleDisplay != 'string')
		var n_arr_styleDisplay = arr_styleDisplay.length;
	
	// Se "arr_idDisplay" è un array e "arr_styleDisplay" è un array
	if (n_arr_idDisplay > 1 && n_arr_styleDisplay > 1) {
		for (k = 0; k < n_arr_idDisplay; ++k) {
			var obj = document.getElementById(arr_idDisplay[k]);
			obj.style.display = arr_styleDisplay[k];
		}
	} else if (n_arr_idDisplay > 1 && n_arr_styleDisplay == 1) { // Se "arr_idDisplay" è un array e "arr_styleDisplay" è una stringa sola
		for (k = 0; k < n_arr_idDisplay; ++k) {
			var obj = document.getElementById(arr_idDisplay[k]);
			obj.style.display = arr_styleDisplay;
		}
	} else { // Se "arr_idDisplay" è un solo id
		var obj = document.getElementById(arr_idDisplay);
		if (n_arr_styleDisplay > 1) { // Se "arr_styleDisplay" è un array
			obj.style.display = arr_styleDisplay[0];
		} else { // Se "arr_styleDisplay" è una sola stringa
			obj.style.display = arr_styleDisplay;
		}					
	}				
}

function zIndexObject(arr_idZindex, arr_zindexValue)
{
    var n_arr_idZindex = 1;
	var n_arr_zindexValue = 1;
	
	var type_arr_idZindex = typeof arr_idZindex;
	var type_arr_zindexValue = typeof arr_zindexValue;
	
	if (type_arr_idZindex != 'string')
		var n_arr_idZindex = arr_idZindex.length;
		
	if (type_arr_zindexValue != 'string')
		var n_arr_zindexValue = arr_zindexValue.length;
	
	// Se "arr_idZindex" è un array e "arr_zindexValue" è un array
	if (n_arr_idZindex > 1 && n_arr_zindexValue > 1) {
		for (k = 0; k < n_arr_idZindex; ++k) {
			var obj = document.getElementById(arr_idZindex[k]);
			obj.style.zIndex = arr_zindexValue[k];
		}
	} else if (n_arr_idZindex > 1 && n_arr_zindexValue == 1) { // Se "arr_idZindex" è un array e "arr_zindexValue" è una stringa sola
		for (k = 0; k < n_arr_idZindex; ++k) {
			var obj = document.getElementById(arr_idZindex[k]);
			obj.style.zIndex = arr_zindexValue;
		}
	} else { // Se "arr_idZindex" è un solo id
		var obj = document.getElementById(arr_idZindex);
		if (n_arr_zindexValue > 1) { // Se "arr_zindexValue" è un array
			obj.style.zIndex = arr_zindexValue[0];
		} else { // Se "arr_zindexValue" è una sola stringa
			obj.style.zIndex = arr_zindexValue;
		}					
	}
}

function insertNum(id_num, val)
{
	var objZ = document.getElementById(id_num);
	if (objZ)
	   objZ.value = val;
}

function setValueObj(arr_idObjs, arr_valuesObjs)
{
	var n_arr_idObjs = 1;
	var n_arr_valuesObjs = 1;
	
	var type_arr_idObjs = typeof arr_idObjs;
	var type_arr_valuesObjs = typeof arr_valuesObjs;
	
	if (type_arr_idObjs != 'string')
		var n_arr_idObjs = arr_idObjs.length;
		
	if (type_arr_valuesObjs != 'string')
		var n_arr_valuesObjs = arr_valuesObjs.length;
		
	// Se "arr_idObjs" è un array e "arr_valuesObjs" è un array
	if (n_arr_idObjs > 1 && n_arr_valuesObjs > 1) {
		for (k = 0; k < n_arr_idObjs; ++k) {
			var obj = document.getElementById(arr_idObjs[k]);
			var obj_tagName = obj.tagName.toLowerCase();
			if (obj) {
    			switch (obj_tagName) {
    			    case 'input': // TAG Input
    			    case 'select': // TAG Select
                        obj.value = arr_valuesObjs[k];
                        break;
    			}
			}
		}
	} else if (n_arr_idObjs > 1 && n_arr_valuesObjs == 1) { // Se "arr_idObjs" è un array e "arr_valuesObjs" è una stringa sola
		for (k = 0; k < n_arr_idObjs; ++k) {
			var obj = document.getElementById(arr_idObjs[k]);
			var obj_tagName = obj.tagName.toLowerCase();
			if (obj) {
    			switch (obj_tagName) {
    			    case 'input': // TAG Input
    			    case 'select': // TAG Select
                        obj.value = arr_valuesObjs;
                        break;
    			}
			}
		}
	} else { // Se "arr_idObjs" è un solo id
		var obj = document.getElementById(arr_idObjs);
		if (n_arr_valuesObjs > 1) { // Se "arr_valuesObjs" è un array
		    var obj_tagName = obj.tagName.toLowerCase();
			if (obj) {
    			switch (obj_tagName) {
    			    case 'input': // TAG Input
    			    case 'select': // TAG Select
                        obj.value = arr_valuesObjs[0];
                        break;
    			}
			}
		} else { // Se "arr_valuesObjs" è una sola stringa
		    var obj_tagName = obj.tagName.toLowerCase();
			if (obj) {
    			switch (obj_tagName) {
    			    case 'input': // TAG Input
    			    case 'select': // TAG Select
                        obj.value = arr_valuesObjs;
                        break;
    			}
			}
		}
	}
}

function changeClassObj(class_name, id_object)
{
    if (class_name == '' || !class_name || class_name == undefined)
        class_name = '';
        
    if (id_object == '' || !id_object || id_object == undefined)
        id_object = 'preview';
    
    var obj = document.getElementById(id_object);
    
    if (obj)
        obj.className = class_name;
}
