﻿var cbase = 'mviet/';
var MVOnButton = "<img name='onbutton' src='mviet/on.gif' onClick='MVietOnOffButton();' alt='Turn On'>";
var MVOffButton = "<img name='offbutton' src='mviet/off.gif' onClick='MVietOnOffButton();' alt='Turn Off'>";


var LoadChonDau  = "<APPLET code=VietInterfaceIE5.class height=1 width=1 NAME=VietInterface ARCHIVE = 'VT70.jar' ALT='Your browser understands the applet tag but is not displaying any applet.' codebase='"+cbase+"'><param name='code' value='VietInterfaceIE5.class'><param name='height' value='1'><param name='width' value='1'><param name='name' value='VietInterface'><param name='archive' value='VT70.jar'><param name='alt' value='our browser understands the applet tag but is not displaying any applet.'><param value='codebase' value='"+cbase+"'></APPLET>";


var MVMessage; 

function whatFile() {
window.location= 'file:///' + document.form1.cmuds.value;
} 

function mvsave(str)
{  
       	mywin = window.open("text/html","mywin","width=1,height=1");
	mywin.document.open();
       //	mywin.document.write("<plaintext>");
	mywin.document.write(str);
	mywin.document.execCommand("saveAs",true,".htm");
	mywin.document.close();
	mywin.close();
} 

function MVietOnOffButton (){
if (MVOff == 1) {MVietOnOff.innerHTML=MVOnButton; MVOff=0; } 
else { MVietOnOff.innerHTML=MVOffButton; MVOff=1;} 
}

// #000080
var Kh1 ="<table border='0' bgcolor='#606096' cellspacing='0' cellpadding='1'><tr><td width='100%'><table border='0' width='100%' cellspacing='0' cellpadding='0' height='36'><tr><td id='dragbar' style='cursor:hand' width='100%' height='17'><ilayer width='100%' nSelectStart='return false'><layer width='100%' onMouseover='dragswitch=1;if (ns4) drag_dropns(showimage)' onMouseout='dragswitch=0' id='mvlayer'><a href='http://mviet.cjb.net' target='0' style='text-decoration:none'><font face='Verdana' color='#FFFFFF'><strong><small>&nbsp;MViet</small></strong></font></a></layer></ilayer></td><td style='cursor:hand'><a href='#' onClick='hidebox();return false'><img src='mviet/close.gif' width='14' height='14' border=0 style='position:relative;left:-1'></a></td></tr><tr><td width='100%' class='mvtable' style='padding:4px' colspan='2'>";
var Kh2 ="</td></tr></table>";
var iFr1 ="<iframe src='mviet/"; 
var mvKG = "kieugo.htm' width=380 height=115 align=center";
var mvTK = "tocky.htm' width=400 height=150 align=center";
var mvHN = "hoinga.htm' width=400 height=115 align=center";
var mvTD = "tudien.htm' width=140 height=90 align=center";
var mvHC = "hoanchuyen.htm' width=220 height=95 align=center";
var mvTT = "timthe.htm' width=220 height=95 align=center";
var iFr2 = " frameborder='0' id='mvframe' marginwidth='0' marginheight='0' scrolling='no'></iframe>";

var Kh5="<table bgcolor='white' cellspacing='0' border='0' align='center'><tr><td width='370' height='45' nowrap align='center' valign='middle'>";
var mvKC  = "kieuchu.htm' width=370 height=40 align=center"; 


//Popup Box- By Jim Silver @ jimsilver47@yahoo.com
//http://www.dynamicdrive.com
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
var dragswitch=0
var nsx
var nsy
var nstemp


function GetFont(){ 

var PhongChuMV=getMV("PhongChuMV", "Verdana"); 
var CoChuMV=getMV("CoChuMV", "10pt");
var KieuChuMV=getMV("KieuChuMV", "normal");
var phongStr = '<font face="'+PhongChuMV + '" Size="4" color="#FF9900">' + PhongChuMV + '</font> ';
phongStr += '<font face="'+PhongChuMV + '" Size="3" color="#076C9F">' + CoChuMV + '</font> ';

//alert(phongStr);

   MVMessage.style.fontSize=CoChuMV;
   MVMessage.style.fontFamily=PhongChuMV; 
 phongStr += '<font face="'+PhongChuMV + '" Size="2" color="#ff550c">';   
   switch(KieuChuMV) {
     case '0':
       MVMessage.style.fontWeight='normal';
       MVMessage.style.fontStyle='normal';
       phongStr += 'thường</font>';
       break;
     case '1':
       MVMessage.style.fontWeight='bold';
       MVMessage.style.fontStyle='normal';
       phongStr += '<b>đậm</b></font>';
       break;
     case '2':
       MVMessage.style.fontWeight='normal';
       MVMessage.style.fontStyle='italic';
       phongStr += '<i>nghiêng</i></font>';
       break;
     case '3':
       MVMessage.style.fontWeight='bold';
       MVMessage.style.fontStyle='italic';
        phongStr += '<b><i>đậm&nghiêng</i><b></font>';
     
   } 
   return phongStr;
}

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////

function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage

var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"

while (firedobj.tagName!=topelement&&firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

function showbox(){
if (ie4||ns6)
crossobj.style.visibility="visible"
else if (ns4)
document.showimage.visibility="visible"
}

