

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// EASY LIBRARY / NEGORA © 2007
	//
	// Description: Strict functions to make it easier to do certain operations with Negora libraries, avoiding many steps.
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// EASY
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	function Easy () {
	}
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// IT MAKES AN ANIMATED BUTTON FROM AN IMAGE
	//
	// _img					Image																						O
	// ? _down				The image has a frame for "onmousedown" events								b
	// ? _ti					Time interval between which the vanishing effect will be executed				i
	// ? _qi					Opacity which will be applied on every time interval								d
	//
	// Note 1: The original image file must be named, for example, "name0.png", whereas the rest should be named
	// "name1.png" and "name2.png". "name" is used as root of the images path.
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	Easy.buttonVanish = function (_img, _down, _ti, _qi) {
		
		if (_down == null) _down = false;
		if (_ti == null) _ti = 0;
		if (_qi == null) _qi = 100.0;
		
		
		// EFFECT BUILDING
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		// It gets the base name and extension for the images.
		var src_base = _img.src.substring (0, _img.src.lastIndexOf (".") - 1);
		var src_ext = _img.src.substring (_img.src.lastIndexOf ("."));
		
		// It builds a pile of images inside of a layer.
		var div_img;
		if (_down) {
			div_img = VFXBuild.pileImg (_img, [src_base + "1" + src_ext, src_base + "2" + src_ext], "div_" + _img.id);
		} else {
			div_img = VFXBuild.pileImg (_img, [src_base + "1" + src_ext, src_base + "1" + src_ext], "div_" + _img.id);
		}
		
		// It applies the vanishing effect.
		VFXSens.vanish (div_img, _ti, _qi);
		
		return (div_img);
		
	}
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// IT MAKES A MOVING BUTTON FROM AN IMAGE
	//
	// _img					Image																					O
	// _xo						Initial relative position in the X axys												i
	// _yo						Initial relative position in the Y axys												i
	// _xf						Final relative position in the X axys													i
	// _yf						Final relative position in the Y axys													i
	//
	// Note 1: Coordinates are relative to the original position of the image.
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	Easy.buttonMove = function (_img, _xo, _yo, _xf, _yf) {
		
		// It wraps the image with a layer.
		var div_img = VFXBuild.wrapperDiv (_img, {"position": "relative", "left": _xo + "px", "top": _yo + "px", "cursor": "pointer"}, "div_" + _img.id);
		
		// It applies the motion effect.
		VFXSens.move (div_img, 15, 3, _xf, _yf);
		
		return (div_img);
		
	}
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// IT MAKES A LOOP ANIMATION FROM AN IMAGE
	//
	// _img					Image																					O
	// _num_frame			Number of frames																		i
	//
	// Note 1: The original image file must be named, for example, "name0.png", whereas the rest should be named
	// "name1.png" and "name2.png". "name" is used as root of the images path.
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	Easy.vanishLoop = function (_img, _num_frame) {
		
		// It gets the base name and extension for the images.
		var src_base = _img.src.substring (0, _img.src.lastIndexOf (".") - 1);
		var src_ext = _img.src.substring (_img.src.lastIndexOf ("."));
		
		// It makes an array of source URLs of every image.
		var arr_src = new Array ();
		for (var i = 0; i < _num_frame; i++) {
			arr_src [i] = src_base + (i + 1) + src_ext;
		}
		
		// It builds a pile of images inside of a layer.
		var div_img = VFXBuild.pileImg (_img, arr_src, "div_" + _img.id);
		
		// It applies the vanishing loop effect.
		VFXVanishLoop.conf (div_img, 25, 15);
		
		return (div_img);
		
	}
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// IT MAKES AN ELEMENT TO LOAD A DOCUMENT ON CLICK
	//
	// _elem					Element																		O
	// _url						Target URL																	S
	// ?_ frame				Target frame																O
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	Easy.clickGo = function (_elem, _url, _frame) {
		
		if (_frame == null) _frame = CliElem.getWin (_this);
		
		// It sets the target URL.
		_elem.$easy_go_url = _url;
		_elem.$easy_go_frame = _frame;
		_elem.style ["cursor"] = "pointer";
		
		
		// ELEMENT EVENT: ON CLICK / ON KEY PRESS
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		CliElem.addEvent (_elem, "onclick",
			function (_eve, _this) {
				_this.$easy_go_frame.location.href = _this.$easy_go_url;
			}
		);
		CliElem.addEvent (_elem, "onkeypress",
			function (_eve, _this) {
				if (CliEvent.getKey (_eve) == CliEvent.KEY_ENTER) {
					CliElem.fireEvent (_this, "onclick", _eve);
					_this.focus ();
				}
			}
		);
		
	}
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// IT MAKES AN ELEMENT TO LOAD A DOCUMENT INTO A NEW WINDOW ON CLICK
	//
	// _elem					Element																		O
	// _url						Target URL																	S
	// ? _attrib				Window attributes															S
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	Easy.clickOpen = function (_elem, _url, _attrib) {
		
		// If no attributes have been specified, it takes the ones below by default.
		if (_attrib == null) _attrib = "width=800, height=600, resizable=yes, scrollbars=yes";
		
		// It sets the target URL and window attributes.
		_elem.$easy_open_url = _url;
		_elem.$easy_open_attrib = _attrib;
		_elem.style ["cursor"] = "pointer";
		
		
		// ELEMENT EVENT: ON CLICK / ON KEY PRESS
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		CliElem.addEvent (_elem, "onclick",
			function (_eve, _this) {
				CliWin.openAligned (_this.$easy_open_url, "win_" + _this.id, _this.$easy_open_attrib, "screen", "center", "middle");
			}
		);
		CliElem.addEvent (_elem, "onkeypress",
			function (_eve, _this) {
				if (CliEvent.getKey (_eve) == CliEvent.KEY_ENTER) {
					CliElem.fireEvent (_this, "onclick", _eve);
					_this.focus ();
				}
			}
		);

	}
	
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// IT MAKES AN ELEMENT TO EXECUTE THE DESIRED FUNCTION ON CLICK
	//
	// _elem					Element																		O
	// _func					Function																		O
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	Easy.clickFunc = function (_elem, _func) {
		
		// It sets the target URL and window attributes.
		_elem.$easy_func = _func;
		_elem.style ["cursor"] = "pointer";
		

		// ELEMENT EVENT: ON CLICK / ON KEY PRESS
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		CliElem.addEvent (_elem, "onclick",
			function (_eve, _this) {
				_this.$easy_func (_eve, _this);
			}
		);
		CliElem.addEvent (_elem, "onkeypress",
			function (_eve, _this) {
				if (CliEvent.getKey (_eve) == CliEvent.KEY_ENTER) {
					CliElem.fireEvent (_this, "onclick", _eve);
					_this.focus ();
				}
			}
		);
		
	}
	
	
