// www.feelmultimedia.com
// viver ver1.0 beta

function viver(url) {
	
   if(document.getElementById('dark')) { document.body.removeChild(document.getElementById('dark')) };

   var dd = document.createElement('DIV');
   dd.id = 'dark';
   dd.style.textAlign = 'center';
   /*dd.style.filter="alpha(opacity=70)";
   dd.style.opacity = "0.7";*/
   opUp(dd, 0, 2);
   dd.style.backgroundImage="url(loader.gif)";
   //dd.style.zIndex = '100';
   dd.onclick = function() { this.style.display = 'none'; }   
   document.body.appendChild(dd);
   
   ifrInit(url);
   
}

function ifrInit(url) {

   var ifr = document.createElement('IFRAME');
   //ifr.style.marginTop = "100px";
   ifr.style.width = "600px";
   ifr.style.height = "400px";
   ifr.style.border = "5px black";
   ifr.scrolling = 'no';
   ifr.src = url;
   ifr.style.zIndex = "101";
   ifr.style.marginTop = "8%";
   document.getElementById('dark').appendChild(ifr);
   //opUp(ifr, 0, 10);
   
}



function opUp(el, start, time) {

el.style.opacity = start/100;
el.style.filter = 'alpha(opacity=' + start + ')';

start += 10;

	if(start < 100) {
			
		  var t = setTimeout( function() { opUp(el, start, time); }, time);
		
	}
	
}



function impCss() {
	var cs = document.createElement('LINK');
	cs.href = 'css/viver.css';
	cs.rel = 'stylesheet';
	document.body.appendChild(cs);
}

/*
function viverInit() {
	
	if(window.addEventListener)	{		
		window.addEventListener("load", impCss, false);		
		return true;
		
	} 
	
	else if(window.attachEvent) {		
		window.attachEvent("onload", impCss);		
		return true;
		
	} 
	
	else return false;
}

viverInit();

*/
