﻿document.write('<script src="/template/default/script/library.js" type="text/javascript" language="javascript"></script>');
document.write('<script src="/template/default/script/avim20071102.js" type="text/javascript" language="javascript"></script>');
document.write('<script src="/template/default/script/ads.js" type="text/javascript" language="javascript"></script>');


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>LanhDao</title><body style="margin: 0;">' + html;
	 mediaWin.document.writeln(html);
 }
	 catch (e) {}
	 return false;
}

function play(url) {
	if(!check_url(url)) {
	return false;
	}
	var html='<embed width="@width" height="@height" showstatusbar="1" mute="0" enablecontextmenu="1" autostart="@autostart" src="@url" file="" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" quality="high" type="application/x-mplayer2" ></embed>';
	var width='400';
	var height='300';
	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 GotoSite(url2)
{	 		
	 //window.location.href=url2;
	 var w,h,uid;
	 var p = url2.split("|");
	 uid = p[0];
	 w=p[1];
	 h=p[2];

	 if (url2 != '')
	 {
		if (w == 0) 
		{
			window.open('/vn/atv/' + uid + '/index.aspx','','',''); 
		}
		else
		{
			openfile('/vn/atv/' + uid + "/index.aspx",w,h);
		}
	 }
}

function part2url22(url2)
{	 		
	 var part2=url2.split("$$$");
	 return part2[1];	 	 
}

function is_empty(object) {
	if (object.value) {
		return false;
	}
	return true;
}

function check_keywords(object) {
	if ((object.keywords.value.length<3)) {
		alert('Phải nhập ít nhất 3 ký tự');
		return false;
	}
	return true;
}
