jQuery(function() {
	jQuery("#artOnDisplay .buttons .previous").click(function() { NextOrPrevArtwork('previous'); return false; });
	jQuery("#artOnDisplay .buttons .next").click(function() { NextOrPrevArtwork('next'); return false; });

	jQuery("#artOnDisplay .buttons .enlarge").click(function() {
		jQuery("#artOnDisplay .art a").click();
	});

	//if(jQuery("#mainArea").height() < jQuery("#sidebar").outerHeight()) {
		//jQuery("#mainArea").height(jQuery("#sidebar").outerHeight());
	//}

});

function NextOrPrevArtwork(strDirection) {
	jQuery("#artOnDisplay .art").load("view_index_IFRAME_Art.php", { artwork_id: jQuery("#artwork_id").val(), direction: strDirection }, function() {
		tb_init("#artOnDisplay a.thickbox");

		//if(jQuery("#mainArea").height() < jQuery("#sidebar").outerHeight())
			//jQuery("#mainArea").height(jQuery("#sidebar").outerHeight());
	});
}

function PopupPage(strOpenMe)
{
    features =  'toolbar=no,location=no,directories=no' +
                ',status=no,menubar=no,' +
                'scrollbars=yes,resizable=yes,' +
                'width=360,height=500' ;

    dlg = window.open (strOpenMe,"",features);
}
function pageResized()
{
	//opera Netscape 6 Netscape 4x Mozilla
	if (window.innerWidth || window.innerHeight)
	{
		docwidth = window.innerWidth;
		docheight = window.innerHeight;
	}


	//IE Mozilla
	if (document.body.clientWidth || document.body.clientHeight)
	{
		docwidth = document.body.clientWidth;
		docheight = document.body.clientHeight;
	}
	var obj = document.getElementById("menu1");

	if (docwidth-316 > 460)
	{
		obj.style.left=docwidth-316;
	}
	else
	{
		obj.style.left=460;
	}
	obj.style.top=82;
	//obj.style.left=82;
	//alert(obj.style.left);

}
function BoardPictureClicked()
{
	document.location = '/Board/index.php';
}

function OpenEmailFriend(strOpenMe)
{
    features =  'toolbar=no,location=no,directories=no' +
                ',status=no,menubar=no,' +
                'scrollbars=yes,resizable=yes,' +
                'width=530,height=375' ;

    dlg = window.open (strOpenMe,"",features)
}