function makeupDefaultViewYS() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // test for MSIE x.x;
	{
		var ieversion = new Number(RegExp.$1); // capture x.x portion and store
		// as a number
		if (ieversion == 7) {
			// get height of the dRelations div
			if (jQuery("#dRelations").length > 0) {
				var mdvysheight = jQuery("#dRelations").height()
						- getButtonsDivHeight();
				// alert('dRelations' + jQuery("#dRelations").height());
				// alert('getButtonsDivHeight' + getButtonsDivHeight());
				if (jQuery("#dDocumentTitles").length > 0) {
					mdvysheight = mdvysheight / 2;
					var mdvysheight1 = mdvysheight;
					if (jQuery("#hrSubtitles").length > 0) {
						// mdvysheight1 = mdvysheight1 -
						// jQuery("#hrSubtitles").height();
						mdvysheight1 = mdvysheight1 - 2;
						// alert('hrSubtitles' +
						// jQuery("#hrSubtitles").height());
					}
					if (jQuery("#dSubtitlesTitle").length > 0) {
						// mdvysheight1 = mdvysheight1 -
						// jQuery("#dSubtitlesTitle").height();
						mdvysheight1 = mdvysheight1 - 25;
						// alert('dSubtitlesTitle' +
						// jQuery("#dSubtitlesTitle").height());
						mdvysheight1 = mdvysheight1;// outputtext
					}
					jQuery("#dDocumentTitles").css('height', mdvysheight1 - 8);
					// alert('dDocumentTitles' + mdvysheight1);
				}
				if (jQuery("#dRelationsMessage").length > 0) {
					jQuery("#dRelationsMessage").css('height', mdvysheight);
					// alert('dRelationsMessage' + mdvysheight);
				}
			}
			return;
		}
	}
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mdvysheight = jQuery("#dRelations").height()
				- getButtonsDivHeight();
		// alert('dRelations' + jQuery("#dRelations").height());
		// alert('getButtonsDivHeight' + getButtonsDivHeight());
		if (jQuery("#dDocumentTitles").length > 0) {
			mdvysheight = mdvysheight / 2;
			var mdvysheight1 = mdvysheight;
			if (jQuery("#hrSubtitles").length > 0) {
				// mdvysheight1 = mdvysheight1 -
				// jQuery("#hrSubtitles").height();
				mdvysheight1 = mdvysheight1 - 2;
				// alert('hrSubtitles' + jQuery("#hrSubtitles").height());
			}
			if (jQuery("#dSubtitlesTitle").length > 0) {
				// mdvysheight1 = mdvysheight1 -
				// jQuery("#dSubtitlesTitle").height();
				mdvysheight1 = mdvysheight1 - 25;
				// alert('dSubtitlesTitle' +
				// jQuery("#dSubtitlesTitle").height());
				mdvysheight1 = mdvysheight1;// outputtext
			}
			jQuery("#dDocumentTitles").css('height', mdvysheight1);
			// alert('dDocumentTitles' + mdvysheight1);
		}
		if (jQuery("#dRelationsMessage").length > 0) {
			jQuery("#dRelationsMessage").css('height', mdvysheight);
			// alert('dRelationsMessage' + mdvysheight);
		}
	}
}

function makeupDefaultViewNS() {
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mdvnsheight = jQuery("#dRelations").height()
				- getButtonsDivHeight();
		if (jQuery("#dRelationsMessage").length > 0) {
			jQuery("#dRelationsMessage").css('height', mdvnsheight - 5);
		}
	}
}

function makupHierarchyYSYSYS() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // test for MSIE x.x;
	{
		var ieversion = new Number(RegExp.$1); // capture x.x portion and store
		// as a number
		if (ieversion == 7) {
			// get height of the dRelations div
			if (jQuery("#dRelations").length > 0) {
				var mhysysysheight = jQuery("#dRelations").height()
						- getButtonsDivHeight();
				if (jQuery("#dDocumentTitles").length > 0) {
					mhysysysheight = mhysysysheight / 2;
					var mhysysysheight1 = mhysysysheight;
					if (jQuery("#hrSubtitles").length > 0) {
						// mhysysysheight1 = mhysysysheight1 -
						// jQuery("#hrSubtitles").height();
						mhysysysheight1 = mhysysysheight1 - 2;
					}
					if (jQuery("#dSubtitlesTitle").length > 0) {
						// mhysysysheight1 = mhysysysheight1 -
						// jQuery("#dSubtitlesTitle").height();
						mhysysysheight1 = mhysysysheight1 - 17;
					}
					jQuery("#dDocumentTitles").css('height',
							(mhysysysheight1 - 19));
				}
				if (jQuery("#dSuperActs").length > 0) {
					mhysysysheight = mhysysysheight / 2;
					var mhysysysheight2 = mhysysysheight;
					if (jQuery("#dSuperActsTitle").length > 0) {
						// mhysysysheight2 = mhysysysheight2 -
						// jQuery("#dSuperActsTitle").height();
						mhysysysheight2 = mhysysysheight2 - 15;
					}
					jQuery("#dSuperActs").css('height', mhysysysheight2 - 9);
				}
				if (jQuery("#dSubActs").length > 0) {
					if (jQuery("#hrSubActs").length > 0) {
						// mhysysysheight = mhysysysheight -
						// jQuery("#hrSubActs").height();
						mhysysysheight = mhysysysheight - 2;
					}
					if (jQuery("#dSubActsTitle").length > 0) {
						// mhysysysheight = mhysysysheight -
						// jQuery("#dSubActsTitle").height();
						mhysysysheight = mhysysysheight - 15;
					}
					jQuery("#dSubActs").css('height', mhysysysheight - 9);
				}
			}
			return;
		}
	}
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mhysysysheight = jQuery("#dRelations").height()
				- getButtonsDivHeight();
		if (jQuery("#dDocumentTitles").length > 0) {
			mhysysysheight = mhysysysheight / 2;
			var mhysysysheight1 = mhysysysheight;
			if (jQuery("#hrSubtitles").length > 0) {
				// mhysysysheight1 = mhysysysheight1 -
				// jQuery("#hrSubtitles").height();
				mhysysysheight1 = mhysysysheight1 - 2;
			}
			if (jQuery("#dSubtitlesTitle").length > 0) {
				// mhysysysheight1 = mhysysysheight1 -
				// jQuery("#dSubtitlesTitle").height();
				mhysysysheight1 = mhysysysheight1 - 17;
			}
			jQuery("#dDocumentTitles").css('height', (mhysysysheight1 - 12));
		}
		if (jQuery("#dSuperActs").length > 0) {
			mhysysysheight = mhysysysheight / 2;
			var mhysysysheight2 = mhysysysheight;
			if (jQuery("#dSuperActsTitle").length > 0) {
				// mhysysysheight2 = mhysysysheight2 -
				// jQuery("#dSuperActsTitle").height();
				mhysysysheight2 = mhysysysheight2 - 15;
			}
			jQuery("#dSuperActs").css('height', mhysysysheight2);
		}
		if (jQuery("#dSubActs").length > 0) {
			if (jQuery("#hrSubActs").length > 0) {
				// mhysysysheight = mhysysysheight -
				// jQuery("#hrSubActs").height();
				mhysysysheight = mhysysysheight - 2;
			}
			if (jQuery("#dSubActsTitle").length > 0) {
				// mhysysysheight = mhysysysheight -
				// jQuery("#dSubActsTitle").height();
				mhysysysheight = mhysysysheight - 15;
			}
			jQuery("#dSubActs").css('height', mhysysysheight);
		}
	}
}

function makupHierarchyNSYSYS() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // test for MSIE x.x;
	{
		var ieversion = new Number(RegExp.$1); // capture x.x portion and store
		// as a number
		if (ieversion == 7) {
			// get height of the dRelations div
			if (jQuery("#dRelations").length > 0) {
				var mhnsysysheight = jQuery("#dRelations").height()
						- getButtonsDivHeight();
				// alert('jQuery("#dRelations").height() ' +
				// jQuery("#dRelations").height());
				// alert('getButtonsDivHeight ' + getButtonsDivHeight());
				if (jQuery("#dSuperActs").length > 0) {
					mhnsysysheight = mhnsysysheight / 2;
					mhnsysysheight1 = mhnsysysheight;
					if (jQuery("#dSuperActsTitle").length > 0) {
						// mhnsysysheight = mhnsysysheight -
						// jQuery("#dSuperActsTitle").height();
						mhnsysysheight1 = mhnsysysheight1 - 18;
					}
					jQuery("#dSuperActs").css('height', mhnsysysheight1 - 8);
					// alert('superActs ' + mhnsysysheight1);
				}
				if (jQuery("#dSubActs").length > 0) {
					if (jQuery("#hrSubActs").length > 0) {
						// mhnsysysheight = mhnsysysheight -
						// jQuery("#hrSubActs").height();
						mhnsysysheight = mhnsysysheight - 2;
					}
					if (jQuery("#dSubActsTitle").length > 0) {
						// mhnsysysheight = mhnsysysheight -
						// jQuery("#dSubActsTitle").height();
						mhnsysysheight = mhnsysysheight - 18;
					}
					jQuery("#dSubActs").css('height', mhnsysysheight - 8);
					// alert('subActs ' + mhnsysysheight);
				}
			}
			return;
		}
	}
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mhnsysysheight = jQuery("#dRelations").height()
				- getButtonsDivHeight();
		// alert('jQuery("#dRelations").height() ' +
		// jQuery("#dRelations").height());
		// alert('getButtonsDivHeight ' + getButtonsDivHeight());
		if (jQuery("#dSuperActs").length > 0) {
			mhnsysysheight = mhnsysysheight / 2;
			mhnsysysheight1 = mhnsysysheight;
			if (jQuery("#dSuperActsTitle").length > 0) {
				// mhnsysysheight = mhnsysysheight -
				// jQuery("#dSuperActsTitle").height();
				mhnsysysheight1 = mhnsysysheight1 - 18;
			}
			jQuery("#dSuperActs").css('height', mhnsysysheight1);
			// alert('superActs ' + mhnsysysheight1);
		}
		if (jQuery("#dSubActs").length > 0) {
			if (jQuery("#hrSubActs").length > 0) {
				// mhnsysysheight = mhnsysysheight -
				// jQuery("#hrSubActs").height();
				mhnsysysheight = mhnsysysheight - 3;
			}
			if (jQuery("#dSubActsTitle").length > 0) {
				// mhnsysysheight = mhnsysysheight -
				// jQuery("#dSubActsTitle").height();
				mhnsysysheight = mhnsysysheight - 18;
			}
			jQuery("#dSubActs").css('height', mhnsysysheight);
			// alert('subActs ' + mhnsysysheight);
		}
	}
}

function makupHistoryYS() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // test for MSIE x.x;
	{
		var ieversion = new Number(RegExp.$1); // capture x.x portion and store
		// as a number
		if (ieversion == 7) {
			// get height of the dRelations div
			if (jQuery("#dRelations").length > 0) {
				var mhysheight = jQuery("#dRelations").height()
						- getButtonsDivHeight();
				if (jQuery("#dDocumentTitles").length > 0) {
					mhysheight = mhysheight / 2;
					var mhysheight1 = mhysheight;
					// if(jQuery("#hrSubtitles").length > 0)
					// {
					// //mhysheight1 = mhysheight1 -
					// jQuery("#hrSubtitles").height();
					// mhysheight1 = mhysheight1 - 2;
					// }
					// if(jQuery("#dSubtitlesTitle").length > 0)
					// {
					// // mhysheight1 = mhysheight1 -
					// jQuery("#dSubtitlesTitle").height();
					// mhysheight1 = mhysheight1 - 14;
					// }
					jQuery("#dDocumentTitles").css('height', mhysheight1 - 30);
				}
				// if(jQuery("#dHistory").lenght > 0)
				// {
				jQuery("#dHistory").css('height', mhysheight - 9);
				// }
			}
			return;
		}
	}
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mhysheight = jQuery("#dRelations").height() - getButtonsDivHeight();
		if (jQuery("#dDocumentTitles").length > 0) {
			mhysheight = mhysheight / 2;
			var mhysheight1 = mhysheight;
			// if(jQuery("#hrSubtitles").length > 0)
			// {
			// //mhysheight1 = mhysheight1 - jQuery("#hrSubtitles").height();
			// mhysheight1 = mhysheight1 - 2;
			// }
			// if(jQuery("#dSubtitlesTitle").length > 0)
			// {
			// // mhysheight1 = mhysheight1 -
			// jQuery("#dSubtitlesTitle").height();
			// mhysheight1 = mhysheight1 - 14;
			// }
			jQuery("#dDocumentTitles").css('height', mhysheight1 - 30);
		}
		// if(jQuery("#dHistory").lenght > 0)
		// {
		jQuery("#dHistory").css('height', mhysheight);
		// }
	}
}

function makupHistoryNS() {
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mhnsheight = jQuery("#dRelations").height() - getButtonsDivHeight()
				- 5;
		if (jQuery("#dHistory").length > 0) {
			jQuery("#dHistory").css('height', mhnsheight);
		}
	}
}

function makeupDocumentsYS() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // test for MSIE x.x;
	{
		var ieversion = new Number(RegExp.$1); // capture x.x portion and store
		// as a number
		if (ieversion == 7) {
			// get height of the dRelations div
			if (jQuery("#dRelations").length > 0) {
				var mdysheight = jQuery("#dRelations").height()
						- getButtonsDivHeight();
				if (jQuery("#dDocumentTitles").length > 0) {
					mdysheight = mdysheight / 2;
					var mdysheight1 = mdysheight;
					// if(jQuery("#hrSubtitles").lenght > 0)
					// {
					// //mdysheight1 = mdysheight1 -
					// jQuery("#hrSubtitles").height();
					// mdysheight1 = mdysheight1 - 2;
					// }
					// if(jQuery("#dSubtitlesTitle").lenght > 0)
					// {
					// //mdysheight1 = mdysheight1 -
					// jQuery("#dSubtitlesTitle").height();
					// mdysheight1 = mdysheight1 - 14;
					// }
					jQuery("#dDocumentTitles").css('height', mdysheight1 - 30);
				}
				if (jQuery("#dRelDoc").length > 0) {
					jQuery("#dRelDoc").css('height', mdysheight - 9);
				}
			}
			return;
		}
	}
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mdysheight = jQuery("#dRelations").height() - getButtonsDivHeight();
		if (jQuery("#dDocumentTitles").length > 0) {
			mdysheight = mdysheight / 2;
			var mdysheight1 = mdysheight;
			// if(jQuery("#hrSubtitles").lenght > 0)
			// {
			// //mdysheight1 = mdysheight1 - jQuery("#hrSubtitles").height();
			// mdysheight1 = mdysheight1 - 2;
			// }
			// if(jQuery("#dSubtitlesTitle").lenght > 0)
			// {
			// //mdysheight1 = mdysheight1 -
			// jQuery("#dSubtitlesTitle").height();
			// mdysheight1 = mdysheight1 - 14;
			// }
			jQuery("#dDocumentTitles").css('height', mdysheight1 - 30);
		}
		if (jQuery("#dRelDoc").length > 0) {
			jQuery("#dRelDoc").css('height', mdysheight);
		}
	}
}

function makeupDocumentsNS() {
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mdnsheight = jQuery("#dRelations").height() - getButtonsDivHeight()
				- 5;
		if (jQuery("#dRelDoc").length > 0) {
			jQuery("#dRelDoc").css('height', mdnsheight);
		}
	}
}

function makeupActPartYS() {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // test for MSIE x.x;
	{
		var ieversion = new Number(RegExp.$1); // capture x.x portion and store
		// as a number
		if (ieversion == 7) {
			// get height of the dRelations div
			if (jQuery("#dRelations").length > 0) {
				var mapysheight = jQuery("#dRelations").height()
						- getButtonsDivHeight();
				if (jQuery("#dDocumentTitles").length > 0) {
					mapysheight = mapysheight / 2;
					var mapysheight1 = mapysheight;
					// if(jQuery("#hrSubtitles").length > 0)
					// {
					// //mapysheight1 = mapysheight1 -
					// jQuery("#hrSubtitles").height();
					// mapysheight1 = mapysheight1 - 2;
					// }
					// if(jQuery("#dSubtitlesTitle").length > 0)
					// {
					// //mapysheight1 = mapysheight1 -
					// jQuery("#dSubtitlesTitle").height();
					// mapysheight1 = mapysheight1 - 14;
					// }
					jQuery("#dDocumentTitles").css('height', mapysheight1 - 30);
				}
				if (jQuery("#dActPart").length > 0) {
					jQuery("#dActPart").css('height', mapysheight - 9);
				}
			}
			return;
		}
	}
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mapysheight = jQuery("#dRelations").height()
				- getButtonsDivHeight();
		if (jQuery("#dDocumentTitles").length > 0) {
			mapysheight = mapysheight / 2;
			var mapysheight1 = mapysheight;
			// if(jQuery("#hrSubtitles").length > 0)
			// {
			// //mapysheight1 = mapysheight1 - jQuery("#hrSubtitles").height();
			// mapysheight1 = mapysheight1 - 2;
			// }
			// if(jQuery("#dSubtitlesTitle").length > 0)
			// {
			// //mapysheight1 = mapysheight1 -
			// jQuery("#dSubtitlesTitle").height();
			// mapysheight1 = mapysheight1 - 14;
			// }
			jQuery("#dDocumentTitles").css('height', mapysheight1 - 30);
		}
		if (jQuery("#dActPart").length > 0) {
			jQuery("#dActPart").css('height', mapysheight);
		}
	}
}

function makeupActPartNS() {
	// get height of the dRelations div
	if (jQuery("#dRelations").length > 0) {
		var mapnsheight = jQuery("#dRelations").height()
				- getButtonsDivHeight() - 5;
		if (jQuery("#dActPart").length > 0) {
			jQuery("#dActPart").css('height', mapnsheight);
		}
	}
}

function getButtonsDivHeight() {
	var btnHeight = jQuery("button").outerHeight(); // calculate height of
	// button
	// var btnMargin = jQuery("button").outerHeight(true);
	var btnMargin = 4;
	var numOfBtns = 0;
	if (document.getElementById('btnHier') != null) {
		++numOfBtns;
	}
	if (document.getElementById('btnHis') != null) {
		++numOfBtns;
	}
	if (document.getElementById('btnDoc') != null) {
		++numOfBtns;
	}
	if (document.getElementById('btnAct') != null) {
		++numOfBtns;
	}

	return (btnHeight + btnMargin) * ((numOfBtns < 3) ? 1 : 2);
}

function loadAndAnchor(url, containerid, anchor) {
	setPageAnchor(anchor);
	var oldUrlSplit = document.getElementById('mainForm:hidCurrentDocUrl').innerHtml
			.split('/');
	var oldFile = oldUrlSplit[oldUrlSplit.length - 1];
	var urlSplit = url.split('/');
	var file = urlSplit[urlSplit.length - 1];
	if (file != oldFile) {
		if (jQuery("#" + containerid).length > 0) {
			loadpagefromsubtitle(url, containerid, "false");
		}
		// 2in1
		// if (jQuery("#dCurrentDocContent").length > 0)
		// {
		// loadpagefromsubtitle(url,"dCurrentDocContent","false");
		// }
		//
	} else {
		anchorPage();
	}

	return false;
}

function replaceAnchor(from, to) {
	var relDiv = document.getElementById("wpfRelatedDocument");
	if (relDiv != null) {
		if (BrowserDetect.browser == "Explorer" && BrowserDetect.version == 7) {
			relDiv.innerHTML = relDiv.innerHTML.replace(from, to);
		} else {
			var array = relDiv.getElementsByTagName("a");
			for ( var i = 0; i < array.length; i++) {
				if (array[i].name == from) {
					// alert(from);
					array[i].name = to;
					break;
				}
			}
		}
		return true;
	}
	return false;
}

function anchor(o) {
	window.location.hash = o;
}