//var previewopen=false;

function openPreview(imageID,pOrientation,pUser,pMaxshow) {
	//alert(pOrientation);
	//var preview;
	/*if(previewopen==true) {
		preview.self.close();
		previewopen=false;
		//alert('1');
	}*/
	if(pOrientation=="quer" || pOrientation=="quadrat") {
		var height=620;
		var width=720;
	} else {
		var height=720;
		var width=910;
	}
	var y=(screen.availHeight-height)/2;
	var x=(screen.availWidth-width)/2;
	preview=window.open('preview.php?id='+imageID+'&pUser='+pUser+'&orientation='+pOrientation+'&max_show='+pMaxshow,imageID,'width='+width+',height='+height+',scrollbars=yes,screenX='+x+',screenY='+y+',left='+x+',top='+y);
	//previewopen=true;
	//preview.focus();
}

function hover(pID,pDir) {
	if(pDir==1) {
		//document.getElementById(pID).style.background="#EEEDED";
		document.getElementById(pID).style.border="1px solid #F7AD1E";
	} else {
		//document.getElementById(pID).style.background="#FFFFFF";
		document.getElementById(pID).style.border="1px solid #FFFFFF";
	}
}

function gotoPage(pAmount) {
	document.forms.frmJumpPage["start"].value=pAmount;
	document.forms.frmJumpPage.submit();
}

function addToBoxes() {
	var where=document.forms.frmAddToBoxes.addWhere.value;
	var height=100;
	var width=300;
	var y=(screen.availHeight-height)/2;
	var x=(screen.availWidth-width)/2;
	window.open('addtoboxes.php','boxes','width='+width+',height='+height+',scrollbars=yes,screenX='+x+',screenY='+y+',left='+x+',top='+y);
	document.forms.frmAddToBoxes.target="boxes";
	document.forms.frmAddToBoxes.action="addtoboxes.php?where="+where;
	document.forms.frmAddToBoxes.submit();
}

function addCart(pID) {
	var height=100;
	var width=300;
	var y=(screen.availHeight-height)/2;
	var x=(screen.availWidth-width)/2;
	window.open('addtoboxes.php?where=cart&id='+pID,'boxes','width='+width+',height='+height+',scrollbars=yes,screenX='+x+',screenY='+y+',left='+x+',top='+y);
}

function addLightbox(pID) {
	var height=100;
	var width=300;
	var y=(screen.availHeight-height)/2;
	var x=(screen.availWidth-width)/2;
	window.open('addtoboxes.php?where=lightbox&id='+pID,'boxes','width='+width+',height='+height+',scrollbars=yes,screenX='+x+',screenY='+y+',left='+x+',top='+y);
}

