<!--

function MD_Void() {
	return;
}

// --------------------------------------------------------------------------

function flashTopLogin(act) {

	if(act == 'login') {
		setTimeout('flashTopLogin(\'green\');', 300);
		setTimeout('flashTopLogin(\'blank\');', 600);
		setTimeout('flashTopLogin(\'green\');', 900);
		setTimeout('flashTopLogin(\'blank\');', 1200);
		setTimeout('flashTopLogin(\'green\');', 1500);
		setTimeout('flashTopLogin(\'blank\');', 1800);
		setTimeout('flashTopLogin(\'green\');', 2100);
		setTimeout('flashTopLogin(\'blank\');', 2400);
		setTimeout('flashTopLogin(\'green\');', 2700);
		setTimeout('flashTopLogin(\'blank\');', 3000);
	}
	
	if(act == 'logout') {
		setTimeout('flashTopLogin(\'red\');', 300);
		setTimeout('flashTopLogin(\'blank\');', 600);
		setTimeout('flashTopLogin(\'red\');', 900);
		setTimeout('flashTopLogin(\'blank\');', 1200);
		setTimeout('flashTopLogin(\'red\');', 1500);
		setTimeout('flashTopLogin(\'blank\');', 1800);
		setTimeout('flashTopLogin(\'red\');', 2100);
		setTimeout('flashTopLogin(\'blank\');', 2400);
		setTimeout('flashTopLogin(\'red\');', 2700);
		setTimeout('flashTopLogin(\'blank\');', 3000);
	}	
	
	if(act == 'green') {
		document.getElementById('header-logo-login').style.backgroundColor = '#DDFBC8';
	}
	
	if(act == 'red') {
		document.getElementById('header-logo-login').style.backgroundColor = '#FBD7D7';
	}
	
	if(act == 'blank') {
		document.getElementById('header-logo-login').style.backgroundColor = '';
	}	
	
}

// --------------------------------------------------------------------------

var sessionPingStarted = false;
function MD_DoSessionPing(firstStart) {

	if(firstStart) {
		if(!sessionPingStarted) {
			sessionPingStarted = true;
			setTimeout('MD_DoSessionPing(false);', 1000*30);
		}
	} else {
		if(sessionPingStarted) {
			setTimeout('MD_DoSessionPing(false);', 1000*60);
			var newSessImg;
			newSessImg = new Image();
			newSessImg.src = '/dr/account_session_ping.aspx?' + escape(new Date());	
		}
	}
	
}

// --------------------------------------------------------------------------

function MD_OpenWin(theURL, winName, features) {
	window.open(theURL, winName, features);
}

// --------------------------------------------------------------------------

function MD_OpenNpGallery(galId) {
	MD_OpenWin('/dr/gallery/default.aspx?gid=' + galId, '', 'width=700,height=665')
}

function MD_NpSurveyVote(s, a) {
	location.href = '/dr/surveys?action=vote&s=' + s + '&a=' + a;
}

function MD_NpReportPost(itemType, itemId, commentId) {
	MD_OpenWin('/dr/report-post?itemType=' + escape(itemType) + '&itemId=' + itemId + '&commentId=' + commentId, 'ReportCommentWindow', 'width=475,height=470,scrollbars=yes');
}

// --------------------------------------------------------------------------

function MD_OpenTermsOfUse() {
	MD_OpenWin('/dr/terms-of-use', 'TermsOfUseWindow', 'width=475,height=470,scrollbars=yes');
}

function MD_OpenPostingRules() {
	MD_OpenWin('/dr/posting-rules', 'PostingRulesWindow', 'width=475,height=470,scrollbars=yes');
}

// --------------------------------------------------------------------------

function rightColPropertyPage(whatPage) {

	var i;
	
	for(i=1;i<=5;i++) {
		if(i == whatPage) {
			document.getElementById('rightColPropertyPageBtn' + i).className = 'rstate-num-on';
		} else {
			document.getElementById('rightColPropertyPageBtn' + i).className = 'rstate-num-off';
		}
	}
	
	for(i=1;i<=15;i++) {
		if(document.getElementById('rightColProperty' + i)) {
			if(i > ((whatPage-1)*3) && i <= (((whatPage-1)*3)+3)) {
				document.getElementById('rightColProperty' + i).className = 'right-col-rstate-item';
				document.getElementById('rightColPropertyImage' + i).src = document.getElementById('rightColPropertyImage' + i).alt;
			} else {
				document.getElementById('rightColProperty' + i).className = 'right-col-rstate-item-off';
			}
		}
	}
	
}

// --------------------------------------------------------------------------

function startPrint() {
	window.print();
}

// --------------------------------------------------------------------------

function MD_WFlash(fileUrl, divDestination, sizeX, sizeY, useWmode) {

	var swfHtml;
	swfHtml = '';
	swfHtml += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + sizeX + '" height="' + sizeY + '">';
	swfHtml += '<param name="movie" value="' + fileUrl + '">';
	swfHtml += '<param name="quality" value="high">';

	if(useWmode) {
		swfHtml += '<param name="wmode" value="transparent">';
	}

	if(useWmode) {
		swfHtml += '<embed src="' + fileUrl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + sizeX + '" height="' + sizeY + '" wmode="transparent">';
	} else {
		swfHtml += '<embed src="' + fileUrl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + sizeX + '" height="' + sizeY + '">';
	}	
		
	swfHtml += '</embed></object>';

	if(document.getElementById(divDestination)) {
		document.getElementById(divDestination).innerHTML = swfHtml;
	} else {
		document.write(swfHtml);
	}

}

// --------------------------------------------------------------------------

function MD_GetClientSize() {

	var clwidth = 0;
	var clheight = 0;

	try {
		if(typeof(window.innerWidth) == 'number') {
			clwidth = window.innerWidth;
			clheight = window.innerHeight;
		} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			clwidth = document.documentElement.clientWidth;
			clheight = document.documentElement.clientHeight;
		} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
			clwidth = document.body.clientWidth;
			clheight = document.body.clientHeight;
		}
	} catch(ex) {
		clwidth = 0;
		clheight = 0;
	}
	
	if(clwidth < 0) { clwidth = 0; }
	if(clheight < 0) { clheight = 0; }	
	return [clwidth, clheight];
	
}

function MD_GetClientScroll() {

	var scrX = 0;
	var scrY = 0;
	
	try {
		if(typeof(window.pageYOffset) == 'number') {
			scrY = window.pageYOffset;
			scrX = window.pageXOffset;
		} else if( document.body && (document.body.scrollLeft || document.body.scrollTop)) {
			scrY = document.body.scrollTop;
			scrX = document.body.scrollLeft;
		} else if( document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
			scrY = document.documentElement.scrollTop;
			scrX = document.documentElement.scrollLeft;
		}
	} catch(ex) {
		scrX = 0;
		scrY = 0;	
	}

	if(scrX < 0) { scrX = 0; }
	if(scrY < 0) { scrY = 0; }	
	return [scrX, scrY];
	
}

// --------------------------------------------------------------------------

function MD_BKPage() {
	if (window.sidebar && window.sidebar.addPanel) { 
		window.sidebar.addPanel(document.title, location.href,''); 
	} else if(window.external) {
		window.external.AddFavorite(location.href, document.title);
	} else {
		alert('Function not supported.');
	}
}

// --------------------------------------------------------------------------

function MD_InsertMailLink(p1, p2, htmlTemplate) {

	var emx;
	var atchar;
	atchar = '@';
	emx = p1 + atchar + p2;
	
	var genx;
	if(htmlTemplate.indexOf('$emx_here$') == -1) {
		window.status = 'htmlTemplate doesn\'t containe $emx_here$.';
	} else {
		genx = htmlTemplate.replace(/\$emx_here\$/g, emx);
	}

	document.write(genx);
	
}

// --------------------------------------------------------------------------

function MD_GCookie(cn) {
	var start = document.cookie.indexOf(cn + '=');
	var len = start + cn.length + 1;
	if((!start) && (cn != document.cookie.substring(0, cn.length))) return null;
	if(start == -1) return null;
	var end = document.cookie.indexOf(';', len);
	if(end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
}

function MD_SCookie(cn, cv, cp, cex, cd, cs) {
	var today = new Date();
	today.setTime(today.getTime());
	if (cex) cex = cex * 1000;
	var ex_date = new Date(today.getTime() + (cex));
	document.cookie = cn+'='+escape(cv) +
		((cex) ? ';expires='+ex_date.toGMTString() : '') +
		((cp) ? ';path=' + cp : '') +
		((cd) ? ';domain=' + cd : '') +
		((cs) ? ';secure' : '');
}

function MD_DCookie(cn, cp, cd) {
	if(_agbm_ckG(cn)) {
		document.cookie = cn + '=' +
			((cp) ? ';path=' + cp : '') +
			((cd) ? ';domain=' + cd : '') +
			';expires=Thu, 01-Jan-1970 00:00:01 GMT';
	}
}

function MD_DyToSec(dy) {
	return dy * 60 * 60 * 24;
}

function MD_MnToSec(mn) {
	return mn * 60;
}

// --------------------------------------------------------------------------

function MD_ToggleActiveStyleSheet(ttl) {

	var i;
	var c;

	for(i=0; (c = document.getElementsByTagName("link")[i]); i++) {
		if(c.getAttribute("rel").indexOf("style") != -1 && c.getAttribute("title")) {
			c.disabled = true;
			if(c.getAttribute("title") == ttl) {
				c.disabled = false;
			}
		}
	}
	
}

// --------------------------------------------------------------------------

function MD_err(msg, url, line) {
	try {	
		if(url.toLowerCase().indexOf('http://localhost') == -1 && url.toLowerCase().indexOf('http://192.') == -1) {
			var MD_ErrImg = new Image;
			MD_ErrImg.src = '/dr/jslogger/default.aspx?msg='+escape(msg)+'&url='+escape(url)+'&line='+escape(line);
			return true;
		} else {
			alert('JS Exception:\n' + msg + '\n' + url + '\n' + line)
		}
	} catch(e) {}	
}

window.onerror = MD_err;

-->