function popup(which){

	day = new Date();
	id = day.getTime();
	height = screen.height/ 10;
	width = screen.width/10;
	eval("page" + id + " = window.open('popup/popup.php?uid=" + which + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + ",left=5,top=5');");
}

function newsize(high, wide){
	window.resizeTo(wide*1.255,high*1.346);
}

function popup1(which){

	day = new Date();
	id = day.getTime();
	height = screen.height/10;
	width = screen.width/10;
	eval("page" + id + " = window.open('popup/popup.php?num=" + which + "&dir=exhibition', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + ",left=5,top=5');");
}

function ReloadFrames(room){

	if(room != ''){
		leftLoc = 'add.php?mode=frame&Room=' + room;
		top.frames['leftFrame'].location.href=leftLoc;
		
		rightLoc = '../gallery/index.php?mode=admin&roomid=' + room;
		top.frames['rightFrame'].location.href=rightLoc;
	}

}

function Edit(picture, room){
	
	leftLoc = '../admin/add.php?mode=frame&Room=' + room + '&picture=' + picture;
	top.frames['leftFrame'].location.href=leftLoc;
}

function MovePicture(uid, direction){
	if(document.location.href.indexOf("Move") > -1){
		strNewLoc = document.location.href.substring(0, document.location.href.indexOf("Move") -1);
	}else{
		strNewLoc = document.location.href;
	}

	if(document.location.href.indexOf("#") == -1){
		strNewLoc = strNewLoc + '&Move=YES&uid=' + uid + '&dir=' + direction;
	}else{
		strNewLoc = strNewLoc.substring(0, strNewLoc -1);
		strNewLoc = strNewLoc + '&Move=YES&uid=' + uid + '&dir=' + direction;
	}

	document.location.href = strNewLoc;
}
