//*** CLASS PageViewer ******************************************************
function PageViewer(id) {
	this._id = id;
	this._domId = "PageViewer_" + id;
	this._isOpened = 0;
}

PageViewer.prototype._id;
PageViewer.prototype._isOpened;

PageViewer.prototype.setContent = function(contentXML) {
	//parse XML SOAP response
	//var pageTitle = "";
	//var pageContent = "";
	//$("page", contentXML).each( function() {
	//	pageTitle = $(this).children("title").text();
	//	pageContent = $(this).children("content").text();
	//});
	
	//display data in PageViewer
	//$("div#" + this._domId + "/div.page_viewer_title").empty().append(pageTitle);
	//$("div#" + this._domId + "/div.page_viewer_content").empty().append(pageContent);
	
	//use to show (untouched) html in PageViewer and append close buttons
	$("div#" + this._domId).empty().append(contentXML);
	$("div#" + this._domId + "//div.page_viewer_title").append("<div style=\"position: absolute; right: 10px; top: 40px;\">close | schließen</div>");
	$("div#" + this._domId + "//div.page_viewer_content").append("<br/><br/><div style=\"text-align: right\"><input id=\"ButtonClosePage\" type=\"button\" value=\"Close\" /></div>");
	//bind handlers for page content
	$("div#" + this._domId + "//a").bind("click", handleClickAnchor);
	$("div#" + this._domId + "//div.page_viewer_title").bind("click", handleClickPageViewerShadow);
	$("div#" + this._domId + "//input#ButtonClosePage").bind("click", handleClickPageViewerShadow);
}

PageViewer.prototype.openView = function() {
	stopAnimation();
	this._isOpened = 1;
	$("div#" + this._domId).show(); //slideDown("slow");
}

PageViewer.prototype.closeView = function() {
	$("div#" + this._domId).hide(); //slideUp();
	//restart current animation mode
	startAnimation();
	//close all opened items of current menu
	for(var i=0; i < MENU_STACK[ACTIVE_MENU_ID]._items.length; i++) {
		if(MENU_STACK[ACTIVE_MENU_ID]._items[i]._isOpened == 1) {
			MENU_STACK[ACTIVE_MENU_ID]._items[i].closeItem();
		}
	}
	this._isOpened = 0;
}
//*** END CLASS PageViewer **************************************************
