


viewSource = new function()
{


	this.hide=function(a)
	{
		a.style.display = "none";
	}


	this.update=function(p)
	{
		var a=$('vsc');
		if (a.style.display=="block")
			this.show(a,p);

	}

	this.show=function(a,p)
	{
		
		var content = NF.util.dom.getNodesByClassName($('vsc'),"vs_item");
		for (var i=0;i<content.length;i++)
		{
			if (content[i].id==p.id)
				content[i].style.display="block";
			else
				content[i].style.display="";
		}

		$('vs_title_cust').innerHTML = p.show;

		a.style.display = "block";
		this.centerNodeInWindow(a);

					
		a = NF.util.dom.getNodesByClassName(a,"vs_container")[0];
		var anim1 = new NF.anim.styleAnim({backgroundColor:{start:'#fff',end:'#ddd'},borderColor:{start:'#fff',end:'#333'}});
		var clip = new NF.anim.clip([anim1],{frames:15,node:a});
		var p = new NF.anim.player(clip,15);
		p.play();
		
	
	}


	this.centerNodeInWindow=function(a)
	{
	
		var wd = this.getWindowDimensions();

		

		var qw = a.offsetWidth;
		var qh = a.offsetHeight;

		var d,st = 0,sl = 0;
		if (d = document.documentElement)
		{
			st = d.scrollTop;
			sl = d.scrollLeft;
		}


		a.style.top = (parseInt((wd.h-qh)/2)+st)+"px";
		a.style.left = (parseInt((wd.w-qw)/2)+sl)+"px";
		

	}



	this.getWindowDimensions=function()
	{

		var r={};
		if (window.innerHeight)
		{
			r.h = [window.innerHeight];
			r.w = window.innerWidth;

		}
		else
		{
			r.h = document.documentElement.clientHeight;
			r.w = document.documentElement.clientWidth;
		}
		
		return r;

	}


}

















