﻿RegisterNamespace("VP.ArticleDetail");

VP.ArticleDetail.ScrollToElement = function(id) {
	var theElement = $get(id);
	var selectedPosX = 0;
	var selectedPosY = 0;

	while (theElement != null) {
		selectedPosX += theElement.offsetLeft;
		selectedPosY += theElement.offsetTop;
		theElement = theElement.offsetParent;
	}

	window.scrollTo(selectedPosX, selectedPosY);
};

VP.ArticleDetail.PopupSection = function(sectionid) {
	$("#" + sectionid).jqm(
		{
			modal: true
		});

	$("#" + sectionid).css("width", 500);
	$("#" + sectionid).jqmShow();
	$("#btnCancle" + sectionid).click(function() {
		VP.ArticleDetail.CanclePopUp(sectionid);
	});
};

VP.ArticleDetail.CanclePopUp = function(sectionid) {
	$("#" + sectionid).jqmHide();
};
