function removePreview()
{
	var PreviewHolder = document.getElementById('preview');
	PreviewHolder.style.visibility = 'hidden';
	
	var flash_mc = document.getElementById('flashcontent1');
	if(flash_mc != null)flash_mc.style.visibility = 'visible';
}

//window.attachEvent('onresize', function () {setPositions();});

var crr = 0;
var pcs = new Array();

function NextP()
{
	//alert(pcs[crr][0]);
	crr++;
	if(crr == pcs.length)crr = 0;
	removePreview();
	Preview(pcs[crr][0], pcs[crr][1], pcs[crr][2], '', true);
}

function PrevP()
{
	crr--;
	//alert(pcs[crr][0]);
	if(crr == -1)crr = pcs.length-1;
	removePreview();
	Preview(pcs[crr][0], pcs[crr][1], pcs[crr][2], '', true);
}

function Preview(P, W, H, name, navig)
{
	
	var flash_mc = document.getElementById('flashcontent1');
	
	if(flash_mc != null)flash_mc.style.visibility = 'hidden';
	
	//var tblHld = document.getElementById('th');
var PreviewHolder = document.getElementById('preview');	
	PreviewHolder.style.width = '100%';
	PreviewHolder.style.height = document.body.scrollHeight;
	PreviewHolder.style.top = 0;
	PreviewHolder.style.left = 0;
	//alert(document.body.scrollTop);
	
	
	var navigation = '';
	
	if(navig){navigation += '<img src="i/prv.jpg" onClick="PrevP()">&nbsp;';}
			  navigation += name;
	if(navig){navigation += '&nbsp;<img src="i/nxt.jpg" onClick="NextP()">';}
	
	

	
	var html_value = '';
	
	html_value += '<div id="event_disabler" style="postion:absolute; filter: alpha(opacity = 66); -moz-opacity: 0.1; background-color:#000000; width:100%; height:100%;">';  
	html_value += '</div>';
	
	html_value += '<div id="picture_holder" style="top:'+document.body.scrollTop+'; left:0; position:absolute; width:100%; padding-top:10px;">';
	
	html_value += '<table cellspacing="0" width="100%" height="1px" cellpadding="0" border="0"><tr><td align="center">';
	html_value += '<div style=" width:'+W+'; background-color: #996665;padding-left:3px;padding-right:3px;padding-bottom:3px">';
	
	html_value += '<div  style="text-align:right; background-color: #996665 ;width:'+Number(W)+';"><div class="divtext">';
	
	html_value += navigation;
	
	html_value += '</div><img src="i/c.gif" onClick="removePreview()"></div>';
	
	html_value += '<div style=" width:'+W+';"><img src="'+P+'" border="0"></div>';
	html_value += '</div>';
	

	html_value += '</td>';
	html_value += '</tr></table></div>';
	
	
	
	PreviewHolder.innerHTML = html_value;
	//html_value;
	
	PreviewHolder.style.visibility = 'visible';
	//document.location = "#top";
}

function PrintThis(URL)
{
	
	//alert(URL);
	window.open(URL,"my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=400, height=423");

	//window.print();
}

