function removePreview()
{
	var PreviewHolder = document.getElementById('preview');
	PreviewHolder.style.visibility = 'hidden';
	
	var flash_mc = document.getElementById('aph');
	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 MOVE(direction, way)
{
	
	var S = document.getElementById(objscr);
	//alert(S.scrollTop);
	if(direction == 1)S.scrollTop+=way*35;else S.scrollLeft+=way*35;
	//S.style.filter='progid:DXImageTransform.Microsoft.BasicImage(rotation=2)';
	//S.style.filter='-moz-rotation: 2';
}
var objscr = ''; 
function TT(direction, way,  obj_name_)
{
	
	objscr = obj_name_;
	if(way == 0)
	{
		window.clearInterval(scrl_);
		return;
	}
	scrl_ = window.setInterval("MOVE("+(direction)+", "+(way)+")", 10);
}




function Preview(P, W, H, name, navig)
{
	//alert('hr');
	var flash_mc = document.getElementById('aph');
	
	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_H_a = '';
	var navigation_H_b = '';
	var navigation_W_a = '';
	var navigation_W_b = '';
	
	
if(navig){
	navigation_H_a += '<img style="cursor: pointer;" src="i/a.gif" onmouseout="TT(1, 0, \'scrll\')" onmouseover="TT(1, -1,  \'scrll\')">';
	navigation_H_b += '<img style="cursor: pointer;" src="i/b.gif" onmouseout="TT(1, 0, \'scrll\')" onmouseover="TT(1, 1,  \'scrll\')">';
	
	navigation_W_a += '<img style="cursor: pointer;" src="i/f.gif" onmouseout="TT(2, 0, \'scrll\')" onmouseover="TT(2, -1,  \'scrll\')">';
	navigation_W_b += '<img style="cursor: pointer;" src="i/d.gif" onmouseout="TT(2, 0, \'scrll\')" onmouseover="TT(2, 1,  \'scrll\')">';

}
	
	
var ppw=900;
	
	var html_value = '';
	
	html_value += '<div id="event_disabler" style="postion:absolute; filter: alpha(opacity = 55); -moz-opacity: 0.55; background-color:#000000; width:100%; height:100%;">';  
	html_value += '</div>';
	
	html_value += '<div id="picture_holder" style="top:10; 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:'+ppw+'; background-color: #e9dc98; padding-left:3px; padding-right:3px; padding-bottom:3px">';
	
	html_value += '<div style="text-align:right; background-color: #e9dc98; background-image: url(i/fsh.jpg); width:'+ppw+'; height:39px; padding-top: 4px"><div class="divtext">';
	
	html_value += name;

	
	html_value += '</div><img src="i/c.jpg" style="cursor: pointer;" onClick="removePreview()"></div>';
	
	//html_value += '<div style="position:absolute; height:600; width:'+ppw+';">';
	
	html_value += '<div style="z-index:104; position:absolute; text-align:left; padding-top:170px; height:100; width:100;">'+navigation_W_a+'</div>';
	html_value += '<div style="z-index:101; position: absolute; text-align:right; padding-top:170px; height:600; width:'+ppw+';">'+navigation_W_b+'</div>';
	html_value += '<div style="z-index:105; position: absolute; text-align:center; height:100; width:'+ppw+';">'+navigation_H_a+'</div>';
	html_value += '<div style="z-index:103; position: absolute; text-align:center; top:643px;  height:100; width:'+ppw+';">'+navigation_H_b+'</div>';
	
	//html_value += '</div>';
	
	html_value += '<div id="scrll" style="overflow: hidden; height:600; width:'+ppw+';"><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();
}


function RO()
{

	var HLD = document.getElementById('HLD')
	//alert(HLD._x);
	var CC = document.getElementById('RODIV');
	//CC.style.width = '100%';
	//CC.style.left = '0';
	//CC.style.align = 'center';
	CC.style.visibility = 'visible';
	
}

function RT()
{
	var CC = document.getElementById('RODIV');
	CC.style.visibility = 'hidden';
	
}

function ChangeBigPic(ww, hh, ORURL, URL)
{
	OR_CRR = ORURL;
	var HOLDER_ = document.getElementById('hold');	
	HOLDER_.innerHTML = '<a href="javascript: VIEWB('+ww+', '+hh+')"><img src="'+URL+'" border="0" width="466"></a>';

}


function PlayMovie(URL)
{
	//OR_CRR = ORURL;
	//var HOLDER_ = document.getElementById('hold');	
	
	var so = new SWFObject("i/mvv_player.swf", "flvvvv", "466", "280", "8", "#adadad");
							so.addVariable("MVV", URL);										
							so.write("hold");
}
function VIEWB(W, H)
{
	window.open(OR_CRR, 'stroycomers', 'width='+(W)+',height='+(H)+',left=0,top=0');
	//W__.Focus();	
}

function JSlink(url_)
{
	document.location = url_;
	
}
