/**
 * prova di inserimento effetto dissolvensa
 * 
 */
 
 var limite=10;
 var contatore=0;
 var trasp = 0;
 var step;
//  var timer;
 
function conta(limite,step){
var incre = 1 / (limite-1);
var element = getRawEl('iqueryLayer');
var element2 = getRawEl('iqueryLayer_shw');
var lim_trasp_element = new Array(1,100);
var lim_trasp_element2 = new Array(0.8,80);

if (contatore >= limite){
	
	element.style.MozOpacity = 1 * lim_trasp_element[0];
	element2.style.MozOpacity = 1 * lim_trasp_element2[0];
	element.style.filter = 'alpha(opacity=' + lim_trasp_element[1] + ')';
	element2.style.filter = 'alpha(opacity=' + lim_trasp_element2[1] + ')';
	contatore = 0;
	trasp = 0;
}else{
	element.style.MozOpacity = trasp * lim_trasp_element[0];
	element2.style.MozOpacity = trasp * lim_trasp_element2[0];
	element.style.filter = 'alpha(opacity='+ (trasp * lim_trasp_element[1]) +')';
	element2.style.filter = 'alpha(opacity='+ (trasp * lim_trasp_element2[1]) +')';
	contatore += 1;
	var timer = setTimeout("conta("+limite+","+step+")", step);
	trasp += incre;
}

}


/**
 * Returns the key-value-pairs of a form
 * as URL encoded string
 */
function getFormKVP(formid) {
    var htmlform = document.getElementById(formid);
    var el = htmlform.elements;
    var skvp = '';
    for (var i=0; i < el.length; i++) {
        if (el[i].name.length > 0) {
            skvp += (i>0?'&':'') + escape(el[i].name)  + '=' + escape(el[i].value);
        }
    }
    return skvp;
}

/**
 * inArray function
 * Returns true if the passed value is found in the
 * array.  Returns false if it is not.
 * Usage: if (myList.inArray('search term')) {
 */
Array.prototype.inArray = function (value)
{
    var i;
    for (i=0; i < this.length; i++) {
        // Matches identical (===), not just similar (==).
        if (this[i] === value) {
            return true;
        }
    }
    return false;
};


/*  Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
/*--------------------------------------------------------------------------*/
function $() {
    var elements = new Array();

    for (var i = 0; i < arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == 'string')
            element = document.getElementById(element);

        if (arguments.length == 1)
            return element;

        elements.push(element);
    }

    return elements;
}


/*
 * DOM generic functions
 ****************************/
function getRawEl(obj) {
    return document.getElementById(obj);
}

function rawLeft(obj) {
    return parseInt($(obj).style.left);
}

function rawTop(obj) {
    return parseInt($(obj).style.top);
}

function rawW(obj) {
    return parseInt($(obj).style.width);
}

function rawH(obj) {
    return parseInt($(obj).style.height);
}

function hideRaw(obj) {
    $(obj).style.visibility = 'hidden';
}

function showRaw(obj) {
    $(obj).style.visibility = 'visible';
}


function objLeft(obj) {	
    return parseInt(obj.style.left || obj.offsetLeft);
}

function objTop(obj) {
    return parseInt(obj.style.top || obj.offsetTop);
}

function objW(obj) {
	return parseInt( obj.style.width || obj.clientWidth );
}

function objH(obj) {		
    return parseInt( obj.style.height || obj.clientHeight);    
}

function hideObj(obj) {
    obj.style.visibility = 'hidden';
}

function showObj(obj,cond,obj2) {


if (cond == 'dissolvenza'){

/**Prova di inserimento dell'effeto comparsa graduale**/
obj.style.visibility = 'visible';
obj2.style.visibility = 'visible';
conta(10,30);

}else{  
obj.style.visibility = 'visible';
}
}
