<!--
winprop = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,';
var pagehelp = 'help.php';
var pagereferer = 'emailfriend.php';
var pageaddrbook = 'addrbook.php';

function MM_openBrWindow(theURL,winName,features)
{ //v2.0
	window.open(theURL,winName,features);
}

var topicwin;
function winhelp(topic, w, h)
{
	if (topicwin && topicwin.open && !topicwin.closed)
	{
		topicwin.focus();
	} else {
		topicwin = window.open( pagehelp +'?topic=' + topic, 'topic', winprop + ',width=' + w + ',height=' + h + ' ');
	}
}

var referwin;
function refer(w,h)
{
	if (referwin && referwin.open && !referwin.closed)
	{
		referwin.focus();
	} else {
		referwin = window.open( pagereferer, 'referwin', winprop + ',width=' + w + ',height=' + h + ' ');
	}
}
var poemwin;
function viewpoem(formObj) {
	PoemID = formObj.card_poem.options[formObj.card_poem.selectedIndex].value;
	if (PoemID != '')
	{
		if (poemwin && poemwin.open && !poemwin.closed)
		{
			poemwin.focus();
		} else {
			poemwin = window.open(pagehelp +'?topic=poem&poem_id='+PoemID, 'poem', winprop + 'width=550,height=270');
		}
	} else {
		alert(msg_alert_choose_option);
	}
}
// *******************************************************
function vieweffect(formObj) {
	effect_id = formObj.card_effect.options[formObj.card_effect.selectedIndex].value;
	if (effect_id != "")
	{
		effectwin=window.open(pagehelp +'?topic=effect&effect_id='+effect_id, 'effect', winprop + 'width=550,height=270');
		effectwin.focus();
	} else {
		alert(msg_alert_choose_option);
	}
}
// *******************************************************
var soundwin;
function playmusic(formObj)
{
	if (soundwin && soundwin.open && !soundwin.close)
	{
		soundwin.focus();
	} else {
		song = formObj.card_sound.options[formObj.card_sound.selectedIndex].value;
		winStats = winprop;
		if (navigator.appName.indexOf("Microsoft")>=0)
		{
			winStats+=',width=225,height=195,left=300,top=300';
		} else {
			winStats+=',width=250,height=220,screenX=300,screenY=300,alwaysRaised=yes';
		}
		if (song == '')
		{
			alert(msg_alert_choose_option);
		} else {
			soundwin=window.open(pagehelp +'?topic=music&song='+song,'soundwin', winStats);
		}
	}
}
// *******************************************************
var win_addrbook;
function OpenAddrbook(can_multi)
{
	if (win_addrbook && win_addrbook.open && !win_addrbook.closed)
	{
		win_addrbook.focus();
	} else {
		var tp,lft;
		lft=(screen.availWidth/2)-225;
		tp=(screen.availHeight/2)-187;
		win_addrbook = window.open(pageaddrbook +'?l='+ can_multi +'&scr=pop&action=','win_addrbook',winprop + 'dependent=0,width=420,height=400,screenX=' + lft + ',screenY=' +tp + ',top=' + tp + ',left=' + lft);
	}
}
function closeaddressbook()
{
	if (win_addrbook && win_addrbook.open && !win_addrbook.closed)
	{
		win_addrbook.close();
	} 
}
function changestamp()
{
	current = document.vCardform.card_stamp.selectedIndex;
	str = document.vCardform.card_stamp[current].value;
	str = str.toLowerCase();
	if (str.indexOf("http://")==-1)
	{
		document.images.sample.src = imagedir + document.vCardform.card_stamp[current].value;
	} else {
		document.images.sample.src = document.vCardform.card_stamp[current].value;
	}
}
function changebg()
{
	current = document.vCardform.card_background.selectedIndex;
	str = document.vCardform.card_background[current].value;
	str = str.toLowerCase();
	if (str.indexOf("http://")==-1)
	{
		document.images.sample.src = imagedir + document.vCardform.card_background[current].value;
	} else {
		document.images.sample.src = document.vCardform.card_background[current].value;
	}
}
// *******************************************************
function smilie(text)
{
	//text =' '+text+' ';
	if (document.vCardform.card_message.createTextRange && document.vCardform.card_message.caretPos)
	{
		var caretPos = document.vCardform.card_message.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1)==' '? text+' ':text;
		document.vCardform.card_message.focus();
	}
	else
	{
		document.vCardform.card_message.value += text;
		document.vCardform.card_message.focus();
	}
}
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl)
{
	if (textEl.createTextRange)
	{
		textEl.caretPos = document.selection.createRange().duplicate();
	}
}
// *******************************************************
function DisplayInfo(pagina,janela,width,height,scrolling)
{
	if (!scrolling)
	{
		scrolling = 'auto';
	}
	resultado = window.open(pagina,janela,'width='+width+',height='+height+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left=550,top=5')
}
function abcd_test(str)
{
	var test = 'NDA0LmkxNS4wMDU5';
	if (str == 0)
	{
		return true;
	}
}
function openFeedbackWindow(thePage)
{
	feedbackWin = window.open(thePage,'feedback','width=300,height=300,scrollbars');
}
function openPrintWindow(thePage)
{
	printWin = window.open(thePage,'print');
}
function openEmailWindow(thePage)
{
	emailWin = window.open(thePage,'email','width=340,height=450');
}
function openWindow(url,w,h)
{
	var winame = 'popup';
	popupWin = window.open(url,winame,'scrollbars,menubar,resizeable,width='+w+',height='+h);
}
function js_rating(jan)
{
	DisplayInfo('',jan,300,300);
}
function ValidateForm(formName,elementName)
{
	var tempobj = formName + "." + elementName;
	eval(""+ tempobj + ".disabled = true;");
	return true; 
}
// http://www.wdvl.com/Authoring/JavaScript/
// http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
// convert all characters to lowercase to simplify testing
var agt = navigator.userAgent.toLowerCase(); // Get client info
var is_major = parseInt(navigator.appVersion); // Get browser version
var is_minor = parseFloat(navigator.appVersion);
var is_ie = ((agt.indexOf('msie') != -1) && (agt.indexOf('opera') == -1));
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_moz = 0;
var is_win = ((agt.indexOf('win')!=-1) || (agt.indexOf('16bit') != -1));
var is_mac = (agt.indexOf('mac')!=-1);
var SelectedText = '';

function addcode(open, close)
{
	var txtarea = document.vCardform.card_message;
	if ((is_major >= 4) && is_ie && is_win) // IE
	{
		SelectedText = document.selection.createRange().text;
		if (SelectedText=='')
		{
			txtarea.value += open + close;
			txtarea.focus();
			return;
		}
		document.selection.createRange().text = open + SelectedText + close;
		txtarea.focus();
		return;
	}else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)){ // Mozzila
		mozWrap(txtarea, open, close);
		return;
	}else{ // Other
		txtarea.value += open + close;
		txtarea.focus();
	}
	storeCaret(txtarea);
}
// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
	var selLength = txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	if (selEnd == 1 || selEnd == 2)
	{
		selEnd = selLength;
	}
	var s1 = (txtarea.value).substring(0,selStart);
	var s2 = (txtarea.value).substring(selStart, selEnd)
	var s3 = (txtarea.value).substring(selEnd, selLength);
	txtarea.value = s1 + open + s2 + close + s3;
	return;
}

function HL(el)
{
	if (el.checked){
		do_highlight(el);
	}else{
	    undo_highlight(el);
	}
}
function do_highlight(el)
{
	var ref = null;
	if (el.parentNode && el.parentNode.parentNode)
	{
	    ref = el.parentNode.parentNode;
	}
	else if (el.parentElement && el.parentElement.parentElement)
	{
	    ref = el.parentElement.parentElement;
	}
	if (ref)
	{
	    if (ref.className == 'row')
		{
			ref.className = 'rowhighlight';
	    }
	    else if (ref.className == 'row1')
		{
			ref.className = 'row1highlight';
	    }
	}
}
function undo_highlight(el)
{
	var ref = null;
	if (el.parentNode && el.parentNode.parentNode)
	{
	    ref = el.parentNode.parentNode;
	}
	else if (el.parentElement && el.parentElement.parentElement)
	{
	    ref = el.parentElement.parentElement;
	}
	if (ref)
	{
	    if (ref.className == 'rowhighlight')
		{
			ref.className = 'row';
	    }
	    else if (ref.className == 'row1highlight')
		{
			ref.className = 'row1';
	    }
	}
}

var picker;
function colorpickup(name, w, h)
{
	if (picker && picker.open && !picker.closed)
	{
		picker.focus();
	} else {
		picker = window.open( pagehelp +'?topic=colors&fname='+ name, 'topic', winprop + ',width=' + w + ',height=' + h + ' ');
	}
}
function popup(url,width,height,winname)
{
	var url, width, height;
	if (width == null)  { width  = 200; }   // default width
	if (height == null) { height = 400; }   // default height
	newwin=window.open(url,winname,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height);
	if (document.all)
	{
		newwin.moveTo(0,0);
	} 
}
/*vietuni8.js - R.19.10.01 @JOTREQFA@P*Veni*Vidi*Vici*
* by Tran Anh Tuan [tuan@physik.hu-berlin.de] 
* Copyright (c) 2001, 2002 AVYS e.V.. All Rights Reserved.
*
* Originally published and documented at http://www.avys.de/
* You may use this code without fee on noncommercial web sites. 
* You may NOT alter the code and then call it another name and/or resell it.
* The copyright notice must remain intact on srcipts.
*/

// interface for HTML:
//

var supported = (document.all || document.getElementById);
var disabled = false;
var charmapid = 1;
var keymodeid = 0;
var linebreak = 0;
var theTyper = null;

reset = function(){}
telexingVietUC = initTyper;

function setTypingMode(mode) {
  keymodeid = mode;
  if (theTyper) theTyper.keymode= initKeys();
  if (!supported && !disabled) {
    alert("Xin loi, trinh duyet web cua ban khong cho phep dung VietTyping.\n");
    disabled = true;  
  }
}

var vumapsURI  = "http://www.avys.de/js/vumaps.js";
var vumaps = 0;
function setCharMap(mapID) {
  charmapid = mapID+1;
  if (!vumaps) loadModule(vumapsURI, "vumaps");
  if (theTyper) theTyper.charmap = initCharMap();
}

function autoConvert(txtarea, tomap) {
  if (!txtarea) return;
  var srcid = detectFormat(txtarea.value);
  if (!srcid) return;
  var srcmap = initCharMap(srcid);
  var destmap = initCharMap(tomap);
  txtarea.value=srcmap.convertTxtTo(txtarea.value,destmap);
}

function loadModule(mURI,idstr) {
  if (!document.all) return alert("Sorry, only IE4,5,6 support this feature.");
  var ls="&nbsp;<script defer type='text/javascript' src='"+mURI+"'></script>";
  document.body.insertAdjacentHTML('beforeEnd', ls);
  if (!eval(idstr)) alert( errormsg);
}
var errormsg="Module chu+a na.p xong, co' the^? ke^'t no^'i cha^.m...\n"+
"Ba.n ha~y thu+.c hie^.n thao ta'c mo^.t la^`n nu+~a!";
 
function convertAtOnce(txtarea) {
  if(!txtarea) return;
  if(theTyper.keymode.off) {
    var msg = "Bo^. go~ ddang o+? tra.ng tha'i ta('t.\n Ba.n pha?i ddu+a ve^` "+
    "kie^?u dda~ du`ng dde^? vie^'t ba`i truo+'c khi soa't da^'u";
    return alert(msg);      
  }
  if(!theTyper) theTyper = new CVietString("");
  txtarea.value = theTyper.doConvertIt(txtarea.value);
}

initCharMap = function() { return new CVietUniCodeMap(); }

initKeys = function() {
  switch (keymodeid) {
    case 1: return new CTelexKeys();
    case 2: return new CVniKeys();
    case 3: return new CViqrKeys();
    default: return new CVKOff();
  }
}

function initTyper(txtarea) {
  txtarea.vietarea= true;
  txtarea.onkeyup= null;
  if (!supported) return;
  txtarea.onkeypress= vietTyping;
  txtarea.getCurrentWord= getCurrentWord;
  txtarea.replaceWord= replaceWord;
  txtarea.onkeydown= onKeyDown;
  txtarea.onmousedown= onMouseDown;
}

function getEvt(evt) {
  return document.all? event.keyCode: (evt && evt.which)? evt.which: 0;
}

function onKeyDown(evt) {
  var c= getEvt(evt);
  if ((c==10) || (c==13)) { reset(1); linebreak= 1; }
  else if ((c<49) && (c!=16) && (c!=20)) { linebreak= 0; reset(c==32); }
  return true;
}

function onMouseDown(evt) { reset(0); linebreak= 0; return true; }

function vietTyping(evt) {
  var c= getEvt(evt);
  if(theTyper) theTyper.value= this.getCurrentWord();
  else theTyper= new CVietString(this.getCurrentWord());
  var changed= (c>32) && theTyper.typing(c);
  if (changed) this.replaceWord(theTyper.value);
  return !changed; 
}

function getCurrentWord() {
  if(!document.all) return this.value;
  var caret = this.document.selection.createRange();
  var backward = -17;
  do {
    var caret2 = caret.duplicate();
    caret2.moveStart("character", backward++);
  } while (caret2.parentElement() != this && backward <0);
  this.curword = caret2.duplicate();
  return caret2.text;
}

function replaceWord(newword) {
  if(!document.all) { this.value= newword; return; }
  this.curword.text = newword;
  this.curword.collapse(false);
}
// end interface


// "class": CVietString
//
function CVietString(str) {
  this.value= str;
  this.keymode= initKeys();
  this.charmap= initCharMap();
  this.ctrlchar= '-';
  this.changed= 0;

  this.typing= typing;
  this.Compose= Compose;
  this.doConvertIt= doConvertIt;
  this.findCharToChange= findCharToChange;
  return this;
}

function typing(ctrl) {
  this.changed = 0;
  this.ctrlchar = String.fromCharCode(ctrl);
  if (linebreak) linebreak= 0; else this.keymode.getAction(this);
  return this.changed;
}

function doConvertIt (txt) {
  var i = 1, len = txt.length;
  this.value = txt.charAt(0);
  while (i < len) {
    this.ctrlchar = txt.charAt(i++);
    this.changed = 0;
    this.keymode.getAction(this);
    if (!this.changed) this.value+= this.ctrlchar;
  }
  return this.value;
}

function Compose(type) {
  var info = this.findCharToChange(type);
  if (!info) return;
  var telex;
  if (info[0]=='\\') telex= [1,this.ctrlchar,1];
  else if (type>6) telex= this.charmap.getAEOWD(info[0], type, info[3]);
  else telex= this.charmap.getDau(info[0], type);
  if (!(this.changed = telex[0])) return;
  this.value = this.value.replaceAt(info[1],telex[1],info[2]);
  if (!telex[2]) { spellerror= 1; this.value+= this.ctrlchar; }
}

function findCharToChange(type) {
  var lastchars= this.charmap.lastCharsOf(this.value, 5);
  var i= 0, c=lastchars[0][0], chr=0;
  if (c=='\\') return [c,this.value.length-1,1];
  if (type==15) while (!(chr=this.charmap.isVD(c))) {
    if ((c < 'A') || (i>=4) || !(c=lastchars[++i][0])) return null;
  }
  else while( "cghmnptCGHMNPT".indexOf(c)>=0) {
    if ((c < 'A') || (i>=2) || !(c=lastchars[++i][0])) return null;
  }
  c = lastchars[0][0].toLowerCase();
  var pc = lastchars[1][0].toLowerCase();
  var ppc = lastchars[2][0].toLowerCase();
  if (i==2 && type<6) {
    var tmp = pc + c;
    if ((tmp!="ng") && (tmp!="ch") && (tmp!="nh")) return null;
    if (tmp=="ch" && type!=1 && type!=3) return null; 
  }
  else if (i==1 && type<6) {
    if((c=='g') || (c=="h")) return null;
    if ("cpt".indexOf(c) >=0 && type!=1 && type!=3) return null; 
  }
  else if (i==0 && type!=15) {
    if ( (chr=this.charmap.isVowel(lastchars[1][0]))
      && ("uyoia".indexOf(c)>=0) && !this.charmap.isUO(pc,c)
      && !((pc=='o' && c=='a') || (pc=='u' && c=='y'))
      && !((ppc=='q' && pc=='u') || (ppc=='g' && pc=='i')) ) ++i;
    if (c=='a' && (type==9 || type==7)) i= 0;
  }
  c= lastchars[i][0];
  if ((i==0 || chr==0) && type!=15) chr= this.charmap.isVowel(c);
  if (!chr) return null;
  var clen= lastchars[i][1], isuo=0;
  if ((i>0) && (type==7 || type==8 || type==11)) {
    isuo=this.charmap.isUO(lastchars[i+1][0],c);
    if (isuo) { chr=isuo; clen+=lastchars[++i][1]; isuo=1; }
  }
  var pos= this.value.length;
  for (var j=0; j<= i; j++) pos -= lastchars[j][1];
  return [chr, pos, clen, isuo];
}
// end CVietString

// character-map template
//
function CVietCharMap() {
this.vietchars = null;
this.length = 149;
return this; 
}

CVietCharMap.prototype.charAt = function(ind) { 
  var chrcode = this.vietchars[ind];
  return chrcode ? String.fromCharCode(chrcode) : null; 
}

CVietCharMap.prototype.isVowel = function(chr) {
  var ind = this.length-5;
  while ((chr != this.charAt(ind)) && ind) --ind;
  return ind;
}

CVietCharMap.prototype.isVD = function (chr) {
  var ind = this.length-5;
  while ((chr != this.charAt(ind)) && (ind < this.length)) ++ind;
  return (ind<this.length)? ind: 0;
}
                         
CVietCharMap.prototype.isCol = function (col, chr){
  var i=12, ind=col+1;
  while (i>=0 && (this.charAt(i*12+ind)!=chr)) --i; 
  return (i>=0)? i*12+ind : 0;
}

CVietCharMap.prototype.isUO = function (c1, c2) {
  if (!c1 || !c2) return 0;
  var ind1= this.isCol(9, c1);
  if (!ind1) ind1= this.isCol(10, c1);
  if (!ind1) return 0;
  var ind2= this.isCol(6, c2);
  if (!ind2) ind2= this.isCol(7, c2);
  if (!ind2) ind2= this.isCol(8, c2);
  if (!ind2) return 0;
  return [ind1,ind2];
}

CVietCharMap.prototype.getDau = function (ind, type) {
  var accented= (ind < 25)? 0: 1;
  var ind_i= (ind-1) % 24 +1;
  var charset= (type == 6)? 0 : type;                 
  if ((type== 6) && !accented) return [0];
  var newind= charset*24 + ind_i;
  if (newind == ind) newind= ind_i;
  var chr= this.charAt(newind);
  if (!chr) chr= this.lowerCaseOf(0,newind);
  return [1, chr, newind>24 || type==6];
}

var map=[
[7,7,7,8,8, 8,9,10,11,15],
[0,3,6,0,6, 9,0, 3, 6, 0],
[1,4,7,2,8,10,1, 4, 7, 1]
];
CVietCharMap.prototype.getAEOWD = function (ind, type, isuo) {
  var c=0, i1=isuo? ind[0]: ind;
  var vc1= (type==15)? (i1-1)%2 : (i1-1)%12;
  if (isuo) {
    base= ind[1]-(ind[1]-1)%12;
    if (type==7 || type==11) c= this.charAt(i1-vc1+9)+this.charAt(base+7);
    else if (type==8) c= this.charAt(i1-vc1+10)+this.charAt(base+8);
    return [c!=0, c, 1];
  }
  var i= -1, shift= 0, del= 0;
  while (shift==0 && ++i<map[0].length) {
    if (map[0][i]==type) {
      if(map[1][i]==vc1) shift= map[2][i]-vc1;
      else if(map[2][i]==vc1) shift= map[1][i]-vc1;
    }
  }
  if (shift==0) {
    if (type==7 && (vc1==2 || vc1==8)) shift=-1;
    else if ((type==9 && vc1==2) || (type==11 && vc1==8)) shift=-1;
    else if (type==8 && (vc1==1 || vc1==7)) shift=1;
    del= 1;
  } else del=(shift>0);
  var chr= this.charAt(i1+shift);
  if (!chr) chr= this.lowerCaseOf(0,i1+shift);
  return [shift!=0, chr, del];
}

CVietCharMap.prototype.lastCharsOf = function (str, num) {
  if (!num) return [str.charAt(str.length-1),1];
  var vchars = new Array(num);
  for (var i=0; i< num; i++) vchars[i]= [str.charAt(str.length-i-1),1];
  return vchars;
}
// end CVietCharMap prototype


String.prototype.replaceAt= function(i,newchr,clen) {
  return this.substring(0,i)+ newchr + this.substring(i+clen);
}

// output map: class CVietUniCodeMap
// 
function CVietUniCodeMap(){ var map = new CVietCharMap();
map.vietchars = new Array(
"UNICODE",
97, 226, 259, 101, 234, 105, 111, 244, 417, 117, 432, 121,
65, 194, 258, 69, 202, 73, 79, 212, 416, 85, 431, 89,
225, 7845, 7855, 233, 7871, 237, 243, 7889, 7899, 250, 7913, 253,
193, 7844, 7854, 201, 7870, 205, 211, 7888, 7898, 218, 7912, 221,
224, 7847, 7857, 232, 7873, 236, 242, 7891, 7901, 249, 7915, 7923,
192, 7846, 7856, 200, 7872, 204, 210, 7890, 7900, 217, 7914, 7922,
7841, 7853, 7863, 7865, 7879, 7883, 7885, 7897, 7907, 7909, 7921, 7925,
7840, 7852, 7862, 7864, 7878, 7882, 7884, 7896, 7906, 7908, 7920, 7924,
7843, 7849, 7859, 7867, 7875, 7881, 7887, 7893, 7903, 7911, 7917, 7927,
7842, 7848, 7858, 7866, 7874, 7880, 7886, 7892, 7902, 7910, 7916, 7926,
227, 7851, 7861, 7869, 7877, 297, 245, 7895, 7905, 361, 7919, 7929,
195, 7850, 7860, 7868, 7876, 296, 213, 7894, 7904, 360, 7918, 7928,
100, 273, 68, 272);
return map;
}

// input methods: class C...Keys
function CVietKeys() {
  this.getAction= function(typer) { 
    var i= this.keys.indexOf(typer.ctrlchar.toLowerCase());
    if(i>=0) typer.Compose(this.actions[i]);
  }
  return this;
}

function CVKOff() {
  this.off = true;
  this.getAction= function(){};
  return this;
}

function CTelexKeys() {
  var k= new CVietKeys();
  k.keys= "sfjrxzaeowd";
  k.actions= [1,2,3,4,5,6,9,10,11,8,15];
  k.istelex= true;
  return k;
}
             
function CVniKeys() {
  var k= new CVietKeys();
  k.keys= "0123456789";
  k.actions= [6,1,2,4,5,3,7,8,8,15];
  return k;
} 

function CViqrKeys() {
  var k= new CVietKeys();
  k.keys= "\xB4/'`.?~-^(*+d";
  k.actions= [1,1,1,2,3,4,5,6,7,8,8,8,15];
  return k;
}

function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

// end vietuni.js

//-->
//Start Banner session

function hideLayer(whichLayer) {
if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "hidden";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "hidden";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "hidden";
}
}

function showLayer(whichLayer,x,y) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "visible";
document.getElementById(whichLayer).style.top=x;
document.getElementById(whichLayer).style.left=y;
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "visible";
document.all[whichlayer].style.top=x;
document.all[whichlayer].style.left=y;
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "visible";
document.layers[whichLayer].top=x;
document.layers[whichLayer].left=y;
}
}
// Hien thi layer ra ngoai
function hienthi(layer,w,h)
{
if (window.innerWidth || window.innerHeight){ 
docwidth = window.innerWidth; 
docheight = window.innerHeight; 
} 
//IE Mozilla 
if (document.body.clientWidth || document.body.clientHeight){ 
docwidth = document.body.clientWidth; 
docheight = document.body.clientHeight; 
}
posx=docheight/2-h;
posy=docwidth/2-w;
showLayer(layer,posx,posy);
}

