﻿function expand(s)
{
	var td = s;
	var d = td.getElementsByTagName("div").item(0);

	td.className = "menuHover cssBorrderLeft";
	d.className = "menuHover cssBorrderLeft";
}

function collapse(s)
{
	var td = s;
	var d = td.getElementsByTagName("div").item(0);

	td.className = "menuNormal cssBorrderLeft";
	d.className = "menuNormal cssBorrderLeft";
}

function redirect(sPageName)
{
	window.location.href=sPageName;
}

var IE = document.all?true:false
if (!IE) document.addEventListener(Event.MOUSECLICK)
document.onmouseclick = getMouseXY;
var tempX = 0
var tempY = 0

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  window.scrollTo(tempX,tempY);
  return true
}

function UnitilityMenu(){
    var sSource="";
    sSource+="<table cellpadding='0' cellspacing='0' border='0' width='500px' style='margin-top: 20px'><tr>"
    sSource+="<td><img alt='' src='../UIImage/Icon/Print.gif' style='margin-right: 3px; vertical-align:middle' /><a style='color:red' href='javascript:window.print();'>In trang này</a></td>";
    sSource+="<td><img alt='' src='../UIImage/Icon/next.gif' style='margin-right: 3px; vertical-align:middle' /><a style='color:red' href='javascript:window.history.go(-1);'>Về trang trước</a></td>";
    sSource+="<td><img alt='' src='../UIImage/Icon/prev.gif' style='margin-right: 3px; vertical-align:middle' /><a style='color:red' href='javascript:window.history.go(1);'>Quay lại trang sau</a></td>";
    sSource+="<td><img alt='' src='../UIImage/Icon/Top.gif' style='margin-right: 3px; vertical-align:middle' /><a style='color:red' href='javascript:window.scrollTo(0,0);'>Lên đầu trang</a></td>"
    sSource+="</tr></table>"
    document.write(sSource);
}

function showbigimage(imgPath){
    window.open( "viewImage.html?"+imgPath, "",  "resizable=1,height=200,width=200");
}

function ViewAdsFlash(ContainerName, iWidth, iHeight, sPath){
    var sObjFlash="";
    sObjFlash+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' style='z-index: -1'"; 
    sObjFlash+="codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' ";
    sObjFlash+="width='"+iWidth+"' height='"+iHeight+"'>";
    sObjFlash+="<param name='movie' value='../AppImage/Flash/"+sPath+"' />";
    sObjFlash+="<param name='WMode' value='Transparent'>";
    sObjFlash+="<param name='quality' value='high' />"
    sObjFlash+="<embed src='../AppFile/Flash/"+sPath+"' quality='high' ";
    sObjFlash+="pluginspage='http://www.macromedia.com/go/getflashplayer' ";
    sObjFlash+="type='application/x-shockwave-flash' width='"+iWidth+"' height='"+iHeight+"' wmode='transparent' style='z-index: -1'></embed></object>";
    document.getElementById(ContainerName).innerHTML=sObjFlash;
}