/**
 * @author W3 Creation - info@w3creation.pl
 * @ All right reserved
 */
var BarLock = false;
var BarId = 'bar_0';
var blockNewUrl = false;
 function showBar (step,newHtml) {
 	var $ = document;


		var hidden = $.getElementById(barPrefix + "hidden");
		var view = $.getElementById(barPrefix + "view");

 	if (step == 0) {
		var html = newHtml.getElementsByTagName("div")[0].innerHTML;
		BarLock = true;
		BarId = newHtml.id;

		hidden.style.display = 'none';
		view.style.display = 'none';

		hidden.style.width = '70%';

		hidden.innerHTML = view.innerHTML;
		view.innerHTML = html;
		showBar(step + 5, newHtml);
	}
	else {
		if (step < 100) {
			hidden.style.display = 'block';
			view.style.display = 'block';
			hidden.style.width = (70 - (70 * (step / 100))) + '%';


			hidden.style.opacity = (((1) - (step / 100)) / 3);
			view.style.opacity = (step / 100);

			setTimeout(function(){
				showBar(step + 5, newHtml);
			}, 30);
		}
		else {
			BarLock = false;
			hidden.style.width = 0;
			view.style.opacity = 1;
			hidden.style.display = 'none';
			view.style.display = 'block';
		}
	}
 }



 function showUrl(url) {

		var div = document.getElementById('bar_patch').getElementsByTagName('div')[0];
		div.style.opacity = 0.7;
		div.innerHTML = 'Link:&nbsp;<input type="text" value="' + url + '" onClick="this.focus();this.select()" readonly>';
		blockNewUrl = true;
		setTimeout(function(){
			blockNewUrl = false;
		}, 900);

		setTimeout(function(){
			div.style.opacity = 0.5;
		}, 12050);
		setTimeout(function(){
			div.style.opacity = 0.3;
		}, 12050);
		setTimeout(function(){
			div.style.opacity = 0.1;
		}, 12100);
		setTimeout(function(){
			div.style.opacity = 0;
			div.innerHTML = '';
		}, 12150);

 }
