function swp(img_src,txt,wpic) {
	
	var dim=gpagsz();
	var scr=gpagscl();

	var a=document.getElementById('owl');
	
	a.style.height=dim[1]+'px';
	a.style.display='';

	document.getElementById('ifrm').style.display='none';
	
	var b=document.getElementById('lhbox');
	
	if(wpic>dim[0]-1) { // Move when big picture
		var marl=(dim[0]-1000-20)/2;
		b.style.marginLeft='-'+marl+'px';
	}	
	b.style.display='';
	b.innerHTML='';

	var vd=document.createElement('div');
	
	vd.className='pictc';
	b.appendChild(vd);

	var img=document.createElement('img');
	img.className='pictl';
	img.src=img_src;
	img.title=txt;
	img.onclick=clox;
	vd.appendChild(img);

	var cl=document.createElement('a');
	cl.href="#";
	cl.onclick=clox;
	cl.className='clox';

	vd.appendChild(cl);

	//b.style.top=scr[1]+'px';
	b.style.top='0px';
}

function clox(){
	document.getElementById('owl').style.display='none';
	document.getElementById('lhbox').style.display='none';
	document.getElementById('ifrm').style.display='block';
}


function gpagsz(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll=document.body.scrollWidth;
		yScroll=window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		xScroll=document.body.scrollWidth;
		yScroll=document.body.scrollHeight;
	} else {
		xScroll=document.body.offsetWidth;
		yScroll=document.body.offsetHeight;
	}
	xScr=xScroll;
	yScr=yScroll;
		
	var windowWidth, windowHeight;
	if (self.innerHeight) {
		windowWidth=self.innerWidth;
		windowHeight=self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { 
		windowWidth=document.documentElement.clientWidth;
		windowHeight=document.documentElement.clientHeight;
	} else if (document.body) { 
		windowWidth=document.body.clientWidth;
		windowHeight=document.body.clientHeight;
	}	
	
	if(yScroll < windowHeight){
		pageHeight=windowHeight;
	} else { 
		pageHeight=yScroll;
	}

	if(xScroll < windowWidth){	
		pageWidth=windowWidth;
	} else {
		pageWidth=xScroll;
	}


	arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight,xScr,yScr)
	return arrayPageSize;
}

function gpagscl(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll=self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){
		yScroll=document.documentElement.scrollTop;
	} else if (document.body) {
		yScroll=document.body.scrollTop;
	}

	arrayPageScroll=new Array('',yScroll);
	return arrayPageScroll;
}
