﻿function openImageNews(vLink, vHeight, vWidth)
{
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;
	var sAlt = (typeof(vLink.alt) == 'undefined') ? '' : vLink.alt;		
	if (sLink == '')
	{
		return false;
	}

	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('', '_blank', winDef);
	newwin.document.writeln('<title>Kymdan </title><body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
	newwin.document.writeln('<div align="center"><a href="" onClick="window.close(); return false;"><img src="', sLink, '" alt="', 'Đóng lại', '" border=0></a>');
	newwin.document.writeln('<br><b>' ,sAlt , ' </b></div>');
	newwin.document.writeln('</body>');
	if (typeof(vLink.href) != 'undefined')
	{
		return false;
	}
}

function expandingWindow(website) {
var windowprops='width=100,height=100,scrollbars=no,status=yes,resizable=yes'
var heightspeed = 3; // vertical scrolling speed (higher = slower)
var widthspeed = 5;  // horizontal scrolling speed (higher = slower)
//var leftdist = 220;    // distance to left edge of window
//var topdist = 170;     // distance to top edge of window
var leftdist, topdist;

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var screen_width=window.screen.width;
var screen_height=window.screen.height;
var winwidth = 620;
var winheight = 600;
leftdist=(screen_width-winwidth)/2;
topdist=(screen_height-winheight)/2;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'mywindow');
}

function display(s,t,total)
{

	 MItem = document.all(total);


          if (MItem != null)
          {
              for (i=1; i<=MItem.value; i++)
              {

				   MItem1 = document.all(t+i);

		         MItem1.style.display = "none";


	           }
              
          }	

	MItem = document.all(t + s);
	MItem.style.display = ""
} 
function rollIn(elem,t,s)
{

    MItem = document.all(s);

    for (i=1; i<=MItem.value; i++)
	{

		MItem1 = document.all(t +i);

		MItem1.style.color = "#000000"


    }
	 
	elem.style.color = "#000000"		

}
function rollOut(elem)
{

}


function displayFlash(path, width, height) {
    var flashStr =
    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='" + width + "' height='" + height + "' align='middle'>" +
    "<param name='allowScriptAccess' value='always' />" +
    "<param name='movie' value='" + path + "' />" +
    "<param name='wmode' value='transparent' />" +
    "<param name='quality' value='high' />" +
    "<embed src='" + path + "' wmode='transparent' menu='false' quality='high' width='" + width + "' height='" + height + "' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
    "</object>";
    document.write(flashStr);
}

function displayDirector(path, width, height) {
    document.write('<OBJECT classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"');
    document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,0,11"');
    document.write(' ID="DirectorContent" WIDTH="' + width + '" HEIGHT="' + height + '">');
    document.write('<PARAM NAME=src VALUE="' + path + '">');
    document.write('<EMBED SRC="' + path + '"');
    document.write(' WIDTH="' + width + '" HEIGHT="' + height + '"');
    document.write(' TYPE="application/x-director" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveDirector">');
    document.write('</EMBED>');
    document.write('</OBJECT>');
}

function displayCustomEmbed(embed) {
    document.write(embed);
}
