﻿// JScript File
function popup (name,width,height) { 
     var options = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+width+",height="+height; 
     Cal2=window.open(name,"popup",options); 
}

function popup2 (name,width,height) { 
     var options = "toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1, width="+width+",height="+height; 
     Cal2=window.open(name,"popup",options); 
}



function _showGroup(id, c_show, c_hide)
{
	_showElement(id)
	_showElement(c_hide)
	_hideElement(c_show)
}

function _hideGroup(id, c_show, c_hide)
{
	_hideElement(id)
	_hideElement(c_hide)
	_showElement(c_show)
}

function _showElement(id)
{
	var element = document.getElementById(id);
	if(!element) return;
	var style = element.style;
	if(!style) return;
	style.display = "";
}

function _hideElement(id)
{
	var element = document.getElementById(id);
	if(!element) return;
	var style = element.style;
	if(!style) return;
	style.display = "none";
}
function _show_hide_Element(id)
{
    var element = document.getElementById(id);
    var style = element.style;
    if(style.display=="")
        style.display = "none";
    else
        style.display = "";
    
}
function button_set_focus(focusCtrlId)
{
	if(event.keyCode==13)
	{
		var focusCtrl = document.getElementById(focusCtrlId);
		if(focusCtrl) focusCtrl.focus();
	}
}
function searching()
{
    var search_keyword = document.getElementById('search_keyword');
    document.location.href = "/search.aspx?w=" + search_keyword.value;
}
function to_delete_url(url)
{
    if(confirm('Ban co muon xoa khong?'))
        window.location.href=url;
}

function writeToday()
{
var dayNames = new Array("Chủ Nhật","Thứ 2","Thứ 3","Thứ 4", "Thứ 5","Thứ 6","Thứ 7");
var monthNames = new Array(
"01","02","03","04","05","06","07", "08","09","10","11","12");

var now = new Date();
document.write(dayNames[now.getDay()] + ", Ngày " + now.getDate() + "/" + monthNames[now.getMonth()] + "/" + now.getFullYear());
}
function playClip(url)
{
  var div = document.getElementById('mediaspace');
  if(div) 
    div.innerHTML = "<object type='application/x-shockwave-flash' width='210' height='210' wmode='transparent' data='/player/player-viral.swf?file=" + url + "&autostart=true'> <param name='movie' value='/player/player-viral.swf?file=" + url + "&autostart=true' /> <param name='wmode' value='transparent' /><param value='true' name='allowfullscreen' /> </object> ";
}
function playClip_list(url)
{
  var div = document.getElementById('listmediaspace');
  if(div) 
    div.innerHTML = "<object type='application/x-shockwave-flash' width='400' height='300' wmode='transparent' data='/player/player-viral.swf?file=" + url + "&autostart=true'> <param name='movie' value='/player/player-viral.swf?file=" + url + "&autostart=true' /> <param name='wmode' value='transparent' /><param value='true' name='allowfullscreen' /></object> ";
}
 function to_delete_url(url)
{
    if(confirm('do you really want to delete?'))
        window.location.href=url;
}
    
function playClip2(url)
{
  var div = document.getElementById('radiopace');
  if(div)
    div.innerHTML = "<object type='application/x-oleobject' height='45' width='210'  classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'>   <param name='url' value='" + url + "'>  <embed type='application/x-mplayer2' id='mediaPlayer' name='mediaPlayer'  src='" + url + "' volume='100'> </object>";
}
function playClip2_list(url)
{
  var div = document.getElementById('listradiopace');
  if(div)
    div.innerHTML = "<object type='application/x-oleobject' height='300' width='400'  classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'>   <param name='url' value='" + url + "'>  <embed type='application/x-mplayer2' id='mediaPlayer' name='mediaPlayer'  src='" + url + "' volume='100'> </object>";
}

function _showElementTab(id)
{
	var element = document.getElementById(id);
	if(!element) return;
	var style = element.style;
	if(!style) return;
	style.display = "";
}
function _hideElementTab(id)
{
	var element = document.getElementById(id);
	if(!element) return;
	var style = element.style;
	if(!style) return;
	style.display = "none";
}




