﻿// JScript File
function popup(page){
	vHeight = 400;
	vWidth = 600;
	winDef = 'status=no,resizable=no,scrollbars=yes,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(page, '_blank', winDef);
}
function popupSize(page, width, height){
	vHeight = height;
	vWidth = width;
	winDef = 'status=no,resizable=no,scrollbars=yes,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(page, '_blank', winDef);
}
function newpage(page)
{
    var x=document.getelementbyid("ddLink");
    window.open('page.ddl.x.item(x.selectedIndex).valu e');
    window.location.replace();
}
function addLoadEvent(func) {
  var oldOnload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      oldOnload();
      func();
    }
  }
}
// Javascript hien thi Image dung kich co cua cua so Popup.

function openImage(ImageName) {

  PopUpWindow=window.open("","ImagePreview","status=no,resizable=no,scrollbars=yes,width=90,height=110,top=10,left=10");     

  	  // open the new window with just the title and status bar and name it 'PopUpWindow'

  PopUpWindow.document.writeln('<html>');

  PopUpWindow.document.writeln('<head>');

  PopUpWindow.document.writeln('<title>www.vnmedia.vn</title>');   

  	  // put the name of the pic in the title bar

  PopUpWindow.document.writeln('</head>');



  if (navigator.appName == "Microsoft Internet Explorer") 

  	  // in IE resizeTo give the outer of the window

     PopUpWindow.document.writeln('<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onLoad="window.resizeTo(document.images[0].width+20,document.images[0].height+ 40)">');   

		      // resize the window to match the picture



   else

       PopUpWindow.document.writeln('<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onLoad="window.resizeTo(document.images[0].width,document.images[0].height+ 20)">');   

          // resize the window to match the picture

  PopUpWindow.document.writeln('<center><a href="/" onClick=window.close()><img src="'+ImageName+' " border="0">');

  PopUpWindow.document.writeln("</body></html>");



// load the image in the window

  PopUpWindow.document.writeln('</body>');

  PopUpWindow.document.writeln('</html>');

  PopUpWindow.document.close();

  PopUpWindow.focus();  // place the window in front

}

