document.write('<script type="text/javascript" src="/common/v3/js/him.js"></script>');
document.write('<script type="text/javascript" src="/common/v3/js/services.js"></script>');
document.write('<script type="text/javascript" src="/common/v3/js/ads.js"></script>');
document.write('<script type="text/javascript" src="/common/v3/js/ads_scrolling.js"></script>');
/*
document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');
document.write('<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>');
*/
function change_location(boxmenu) {
	var url = boxmenu[boxmenu.selectedIndex].value;
	if (url != '') {
		window.location = url;
	}
}

function open_window(boxmenu) {
	var url = boxmenu[boxmenu.selectedIndex].value;
	if (url != '') {
		window.open(url);
	}
}

function set_updated_time(time) {
	var _time = document.createTextNode('Cập nhật lúc ' + time);
	document.getElementById('updated_time').appendChild(_time);
}

function openImageNews(vLink, vHeight, vWidth) {
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;

	if (sLink == '') {
		return false;
	}

	winDef = 'status=no,resizable=yes,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
	newwin = open('', '_blank', winDef);

	newwin.document.writeln('<title>VietNamNet</title><body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
	newwin.document.writeln('<a href="" onClick="window.close(); return false;"><img src="', sLink, '" alt="', 'Dong lai', '" border=0></a>');
	newwin.document.writeln('</body>');

	if (typeof(vLink.href) != 'undefined') {
		return false;
	}
}

function openImage(sLink, vWidth, vHeight) {
	try {
		winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
		winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
		winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
		newwin = open('', '_blank', winDef);

		 newwin.document.writeln('<title>VietNamNet</title><body style="margin: 0;">');
		 newwin.document.writeln('<a href="javascript: window.close();"><img src="', sLink, '" alt="', 'Đóng lại', '" border=0></a>');
		 newwin.document.writeln('</body>');
	}
	catch (e) {}
	 return false;
}

function play_video(url) {
	if (!check_url(url)) {
		return false;
	}

	var html = '<embed width="@width" height="@height" flashvars="file=@url&autostart=@autostart" allowfullscreen="true" src="http://vietnamnet.vn/chuyenmuc/quangcao/flvconfig/flvvnn.swf" type="application/x-shockwave-flash"></embed>';

	var width = '320';
	var height = '260';
	var autostart = '1';

	html = html.replace(/@url/g, url)
		.replace(/@width/g, width)
		.replace(/@height/g, height)
		.replace(/@autostart/g, autostart);

	return open_window(html, width, height);
}

function check_url(url) {
	return true;
}

function open_window(html, width, height) {
	try {
		winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(height).concat(',').concat('width=').concat(width).concat(',');
		winDef = winDef.concat('top=').concat((screen.height - height) / 2).concat(',');
		winDef = winDef.concat('left=').concat((screen.width - width) / 2);
		mediaWin = open('', '_blank', winDef);
		html = '<title>VietNamNet</title><body style="margin: 0;">' + html;
		mediaWin.document.writeln(html);
	}
	catch (e) {}
	return false;
}