﻿/** 
** myweb javascript library 
**  date: 07.07.2011
**   dev: James Mola
**
**  Create a spot with div
** 
**************/

function MakeSpot(div, time) {

    if (document.getElementById(div) != null) {
        document.getElementById(div).style.display = "block";
        $("#" + div).animate({
            opacity: 1,
            height: 'auto'
        }, 2000,
			function () {
			    // Animation complete.
			    setTimeout(myHandler, time);
			}
		);
    }

    // -- evento di chiusura spot -- //
    var myHandler = function () {
        $("#" + div).animate({
            opacity: 0.00,
            height: 'toggle'
        }, 5000,
			function () {
			    // Animation complete.
			    document.getElementById(div).style.display = "none";
			}
		);
    }
}
