﻿$(function() {
	//margin sub menu        
        $(".tabsmenucontent").each(
        function(i)
        {
            var margin=0;
            switch(i)
            {
                case 3:
                    margin=80;
                    break;
                case 4:
                    margin=200;
                    break;
		case 5:
                    margin=240;
                    break;
		case 6:
                    margin=260;
                    break;
		case 7:
                    margin=400;
                    break;
		case 9:
		    margin=620;
			break;
		case 10:
                    margin=680;
                    break;
		case 11:
		    margin=780;
			break;
		case 12:
		    margin=880;
			break;
            }
            $(this).css('margin-left',margin+'px');
        }        
        );
        $(".body_detail p").each(
        function() {
        var elem = $(this);
        if (elem.text().length<=1 && elem.html().search(/img/i)==-1) {
          elem.remove();
        }
        });
        //
        $(".body_detail img[border]").each(function()
        {
            $(this).css("border-width",$(this).attr("border")+"px");
        });
        $(".body_detail table[cellpadding]").each(function()
        {
            $(this).css("padding",$(this).attr("cellpadding")+"px");
            $("td",this).css("padding",$(this).attr("cellpadding")+"px");
            $("th",this).css("padding",$(this).attr("cellpadding")+"px");
        });
        $(".body_detail table[border]").each(function()
        {
            $(this).css("border-collapse","collapse");
            $(this).css("border","solid "+$(this).attr("border")+"px black");
            $("td",this).css("border","solid "+$(this).attr("border")+"px black");
            $("th",this).css("border","solid "+$(this).attr("border")+"px black");
        });
        //
        $("#dvTopMenu").hover(function() { }, function() 
        {
            $(".menutop a").removeClass("selected");
            var activedMenu=$(".menutop a[rel*=selected]");
            var fireOnThis=activedMenu.get(activedMenu.length-1);
            if (document.createEvent) {
                var evObj = document.createEvent('MouseEvents');
                evObj.initMouseEvent('mouseover', true, false, window, 0, 12, 345, 7, 220, false, false, true, false, 0, null);
                fireOnThis.dispatchEvent(evObj);
            }
            else if (document.createEventObject)
            {
                var evObj = document.createEventObject();
                evObj.detail = 0;
                evObj.screenX = 12;
                evObj.screenY = 345;
                evObj.clientX = 7;
                evObj.clientY = 220;
                evObj.ctrlKey = false;
                evObj.altKey = false;
                evObj.shiftKey = true;
                evObj.metaKey = false;
                evObj.button = 0;
                evObj.relatedTarget = null;
                fireOnThis.fireEvent('onmouseover', evObj);
            }
            return;
        });
        //
        var currentKey='';
        $(".ads").each(function()
        {
            if($(this).attr("title")!=currentKey)
            {
                currentKey=$(this).attr("title");
                $(this).removeClass("hide").addClass("firstAds");
            }
        });
        
        setInterval("swapAds()",10000);
        //
        });
        
        
        //
        function swapAds()
        {
            $(".ads:not(.hide)").each(
            function()
            {
                if($(this).nextAll(".ads").length<=0)
                    $(this).prevAll(".firstAds").removeClass("hide");
                else
                    $(this).next(".ads").removeClass("hide");
                $(this).addClass("hide");
               
            });
        }
	function setHomepage(){if (document.all){document.body.style.behavior='url(#default#homepage)';document.body.setHomePage(window.location);}else if (window.sidebar)       {       if(window.netscape)       {            try            {                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");              }              catch(e)              {     alert("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");            }       }        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);       prefs.setCharPref('browser.startup.homepage',window.location);    }   }	
	//////////////TOOL TIP
	/***********************************************
        * Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
        * This notice MUST stay intact for legal use
        * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
        ***********************************************/

        var offsetfromcursorX = 12 //Customize x offset of tooltip
        var offsetfromcursorY = 10 //Customize y offset of tooltip

        var offsetdivfrompointerX = 10 //Customize x offset of tooltip DIV relative to pointer image
        var offsetdivfrompointerY = 14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

        document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
        document.write('<img id="dhtmlpointer" src="/images/arrow2.gif">') //write out pointer image

        var ie = document.all
        var ns6 = document.getElementById && !document.all
        var enabletip = false
        if (ie || ns6)
            var tipobj = document.all ? document.all["dhtmltooltip"] : document.getElementById ? document.getElementById("dhtmltooltip") : ""

        var pointerobj = document.all ? document.all["dhtmlpointer"] : document.getElementById ? document.getElementById("dhtmlpointer") : ""

        function ietruebody() {
            return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
        }

        function ddrivetip(thetext, thetitle, theimages, thewidth, thecolor) {
            if (ns6 || ie) {
                if (typeof thewidth != "undefined") tipobj.style.width = thewidth + "px"
                if (typeof thecolor != "undefined" && thecolor != "") tipobj.style.backgroundColor = thecolor
                if (theimages != "no images") {
                    tipobj.innerHTML = '<div>' + '<img style="float:left;margin-right:4px;" src=/Controls/ThumbnailSizeWidthHeight.aspx?imageurl=' + theimages + '>' + '</div>' + '<div><p align="left" class="title_toptip">' + thetitle + '</p></div><div><p align="justify" class="text_toptip">' + thetext + '</p></div>'


                }
                else {

                    tipobj.innerHTML = '<div><p align="left" class="title_toptip">' + thetitle + '</p></div><div><p align="justify" class="text_toptip">' + thetext + '</p></div>'
                }

                enabletip = true
                return false
            }
        }

        function positiontip(e) {
            if (enabletip) {
                var nondefaultpos = false
                var curX = (ns6) ? e.pageX : event.clientX + ietruebody().scrollLeft;
                var curY = (ns6) ? e.pageY : event.clientY + ietruebody().scrollTop;
                //Find out how close the mouse is to the corner of the window
                var winwidth = ie && !window.opera ? ietruebody().clientWidth : window.innerWidth - 20
                var winheight = ie && !window.opera ? ietruebody().clientHeight : window.innerHeight - 20

                var rightedge = ie && !window.opera ? winwidth - event.clientX - offsetfromcursorX : winwidth - e.clientX - offsetfromcursorX
                var bottomedge = ie && !window.opera ? winheight - event.clientY - offsetfromcursorY : winheight - e.clientY - offsetfromcursorY

                var leftedge = (offsetfromcursorX < 0) ? offsetfromcursorX * (-1) : -1000

                //if the horizontal distance isn't enough to accomodate the width of the context menu
                if (rightedge < tipobj.offsetWidth) {
                    //move the horizontal position of the menu to the left by it's width
                    tipobj.style.left = curX - tipobj.offsetWidth + "px"
                    nondefaultpos = true
                }
                else if (curX < leftedge)
                    tipobj.style.left = "5px"
                else {
                    //position the horizontal position of the menu where the mouse is positioned
                    tipobj.style.left = curX + offsetfromcursorX - offsetdivfrompointerX + "px"
                    pointerobj.style.left = curX + offsetfromcursorX + "px"
                }

                //same concept with the vertical position
                if (bottomedge < tipobj.offsetHeight) {
                    tipobj.style.top = curY - tipobj.offsetHeight - offsetfromcursorY + "px"
                    nondefaultpos = true
                }
                else {
                    tipobj.style.top = curY + offsetfromcursorY + offsetdivfrompointerY + "px"
                    pointerobj.style.top = curY + offsetfromcursorY + "px"
                }
                tipobj.style.visibility = "visible"
                if (!nondefaultpos)
                    pointerobj.style.visibility = "visible"
                else
                    pointerobj.style.visibility = "hidden"
            }
        }

        function hideddrivetip() {
            if (ns6 || ie) {
                enabletip = false
                tipobj.style.visibility = "hidden"
                pointerobj.style.visibility = "hidden"
                tipobj.style.left = "-1000px"
                tipobj.style.backgroundColor = ''
                tipobj.style.width = ''
            }
        }
        document.onmousemove = positiontip
	////
	function ShowDate(strLang) {
    var d, day, month, date, x, y, h;
    if (strLang == 'vn') {
        var x = new Array("Chủ nhật", "Thứ hai", "Thứ ba");
        var x = x.concat("Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy");
    }
    else {
        var x = new Array("Sun", "Mon", "Tue");
        var x = x.concat("Wed", "Thus", "Fri", "Sat");
    }
    //var x = x.concat("Thứ bảy");
    var y = new Array("1", "2", "3");
    var y = y.concat("4", "5", "6");
    var y = y.concat("7", "8", "9");
    var y = y.concat("10", "11", "12");
    d = new Date();
    day = d.getDay();
    year = d.getFullYear();
    month = d.getMonth();
    date = d.getDate();
    document.write('<b><font class=font_welcome>');
    document.write(x[day]);
    document.write(', ' + date + '/' + y[month] + '/' + year + '&nbsp;&nbsp;');
    document.write('</font></b>');
}
//Mouseover Tabs Menu: By http://www.dynamicdrive.com
//** Aug 4th, 08': Script creation date

var mouseovertabsmenu={

disappeardelay: 250, //set delay in miliseconds before sub menu disappears onmouseout
ajaxloadingmsg: 'Loading Sub Menu Contents...', //Message to show inside sub menu while fetching contents

///////No need to edit beyond here//////////////////////

tabsmenutree:{},

initializetabs:function(tabsmenuid, submenuid, tabcontentsLength, disappearBool){
	var tabmenu=document.getElementById(tabsmenuid)
	var tablinks=tabmenu.getElementsByTagName("a")
	var submenu=document.getElementById(submenuid)
	var selected=null, tablinks_count=0
	for (var i=0; i<tablinks.length; i++){
	  	tablinks[i]._parentid=tabsmenuid
		var relattr=tablinks[i].getAttribute("rel")
		if (/^gotsubmenu/i.test(relattr) && tablinks_count<tabcontentsLength){ //if "rel" attribute starts with="gotsubmenu" and a tab content exists for this tab based on its order
			tablinks[i]._pos=tablinks_count //remember position of this tab relative to its active peers
			if (relattr.indexOf("[selected]")!=-1){
				selected=tablinks_count
			}
			this.addEvent(tablinks[i], function(){
				var tabsmenutree=mouseovertabsmenu.tabsmenutree[this._parentid]
				mouseovertabsmenu.clearhidetimer(tabsmenutree.submenu.hidetimer)
				mouseovertabsmenu.showsubmenu(this)
				}, "mouseover")
			tablinks_count++
			this.tabsmenutree[tabsmenuid].tabs.push(tablinks[i]) //add this tab to tab collection
		}
		else{ //else for regular tab links (with no "rel" attribute)
			this.addEvent(tablinks[i], function(){
				mouseovertabsmenu.hidesubmenu(this._parentid)
			}, "mouseover")
		}
	}
	this.addEvent(submenu, function(e){
		mouseovertabsmenu.clearhidetimer(this.hidetimer)
		}, "mouseover")
	if (disappearBool==true){
		this.addEvent(submenu, function(e){ //hide submenu contents when mouse rolls out of submenu DIV
			if (!mouseovertabsmenu.isContained(this, e)){
				var cursubmenuobj=this
				this.hidetimer=setTimeout(function(){mouseovertabsmenu.hidesubmenu(cursubmenuobj._parentid)}, mouseovertabsmenu.disappeardelay)
			}
		}, "mouseout")
	}
	var urlselected=this.urlparamselect(tabsmenuid)
	//return position of selected tab (relative to its peers), or null
	return typeof urlselected=="number"? urlselected : document.getElementById(urlselected)? document.getElementById(urlselected)._pos : selected
},

ajaxload:function(tabsmenuid, submenuid, disappearBool, url){
	var page_request = false
	if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else
		return false
	var tabsmenutree=this.tabsmenutree[tabsmenuid]
	tabsmenutree.submenu.innerHTML=this.ajaxloadingmsg
	var ajaxfriendlyurl=url.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/") 
	page_request.onreadystatechange=function(){
		mouseovertabsmenu.ajaxpopulate(page_request, tabsmenuid, submenuid, disappearBool, ajaxfriendlyurl)
	}
	var bustcache=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', ajaxfriendlyurl+bustcache, true)
	page_request.send(null)
},

ajaxpopulate:function(page_request, tabsmenuid, submenuid, disappearBool, url){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		var tabsmenutree=this.tabsmenutree[tabsmenuid]
		tabsmenutree.submenu.innerHTML=page_request.responseText
		var innerdivs=tabsmenutree.submenu.getElementsByTagName("div")
		for (var i=0; i<innerdivs.length; i++){
			if (/tabsmenucontent/i.test(innerdivs[i].className)){
				tabsmenutree.submenu_divs.push(innerdivs[i])
			}
		}
		var selected=this.initializetabs(tabsmenuid, submenuid, tabsmenutree.submenu_divs.length, disappearBool)
		if (selected!=null && selected<tabsmenutree.submenu_divs.length){
			innerdivs[selected].style.display="block"
			this.css(tabsmenutree.tabs[selected], "selected", "add")
			tabsmenutree.submenu._prevselected=selected
		}
	}
},

showsubmenu:function(linkobj){
	var tabsmenutree=this.tabsmenutree[linkobj._parentid]
	this.hidesubmenu(linkobj._parentid)
	var selected=parseInt(linkobj._pos)
	tabsmenutree.submenu_divs[selected].style.display="block"
	this.css(tabsmenutree.tabs[selected], "selected", "add")
	tabsmenutree.submenu._prevselected=selected
},

hidesubmenu:function(tabsmenuid){
	var tabsmenutree=this.tabsmenutree[tabsmenuid]
	var prevselectedindex=tabsmenutree.submenu._prevselected
	if (typeof prevselectedindex!="undefined"){
		tabsmenutree.submenu_divs[prevselectedindex].style.display="none"
		this.css(tabsmenutree.tabs[prevselectedindex], "selected", "remove")
	}
},

clearhidetimer:function(timerid){
	if (timerid)
		clearTimeout(timerid)
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

urlparamselect:function(tabsmenuid){
	var result=window.location.search.match(new RegExp(tabsmenuid+"=(\\w+)", "i")) //check for "?tabsmenuid=id_or_pos_of_selected_tab" in URL
	var selectedtabstr=RegExp.$1
	return /^\d+$/.test(selectedtabstr)? parseInt(selectedtabstr) : selectedtabstr //return position or ID of selected tab (or null if niether found)
},


addEvent:function(target, functionref, tasktype){
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

init:function(tabsmenuid, submenuid, disappearBool){
	this.tabsmenutree[tabsmenuid]={} 
	this.tabsmenutree[tabsmenuid].tabs=[] //array referencing the active tab links in this menu (ones with a "rel=gotsubmenu" attr)
	this.tabsmenutree[tabsmenuid].submenu=null //reference submenu DIV for this menu
	this.tabsmenutree[tabsmenuid].submenu_divs=[] //array referencing the submenu contents (external DIVs with class="tabsmenucontent")
	var submenu=document.getElementById(submenuid)
	submenu._parentid=tabsmenuid
	this.tabsmenutree[tabsmenuid].submenu=submenu //remember this DIV as menu's submenu container
	var remoteurl=submenu.getElementsByTagName("a")[0].getAttribute("href")
	this.ajaxload(tabsmenuid, submenuid, disappearBool, remoteurl)
}

}

document.write('<style type="text/css">\n.tabsmenucontent{display:none}\n</style>')
//end mouse over tab
        var HttpRequest = false;
        if (window.XMLHttpRequest) // Internet Explorer
        {
            HttpRequest = new XMLHttpRequest();
            if (HttpRequest.overrideMimeType)
                HttpRequest.overrideMimeType('text/xml');
        }
        else  // Other browsers  
        {
            HttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
        }
        function getData(url, divID) {
            
                  
            var name = document.getElementById('txtName');
            if (name.value.length <= 0) {
                alert("Bạn phải nhập họ và tên");
                document.getElementById('txtName').focus();
                return;
            }
            var email = document.getElementById('txtEmail')
                if(!isEmail(email.value)){
	            alert("Xin vui lòng nhập đúng định dạng Email! ");
	            document.getElementById('txtEmail').focus();
	            return false;
	            }
            var address = document.getElementById('txtAddress')
            if (address.value.length <= 0) {
                alert("Bạn phải nhập địa chỉ");
                document.getElementById('txtAddress').focus();
                return;
            }
            var content = document.getElementById('txtAddedContent')
            if (content.value.length <= 0) {
                alert("Bạn phải nhập nội dung góp ý");
                document.getElementById('txtAddedContent').focus();
                return;
            }
            var code = document.getElementById('txtValidCode')
            if (code.value.length <= 0) {
                alert("Bạn phải nhập mã bảo vệ");
                document.getElementById('txtValidCode').focus();
                return;
            }
            var newscode = document.getElementById('ctl00_MainContent_NewsDetailControl_txtNewsCode')
            var newscode2=document.getElementById('ctl00_MainContent_NewsForumDetailControl_txtNewsCode')
              if (code.value != newscode.value) {
                alert("Mã bảo vệ không đúng");
                return;
            }
            var URLReturn = url + '&name=' + encodeURIComponent(name.value) + '&email=' + encodeURIComponent(email.value) + '&address=' + encodeURIComponent(address.value) + '&content=' + encodeURIComponent(content.value);
            showLoading(divID);
            if (HttpRequest != null) {
                HttpRequest.open("GET", URLReturn, true);
                HttpRequest.onreadystatechange = function() {

                    if ((HttpRequest.readyState == 4) || (HttpRequest.readyState == 0)) {
                        if (HttpRequest.status == 200) {

                            var Response = HttpRequest.responseText;
                            document.getElementById(divID).innerHTML = Response;

                        }
                    }

                }
                HttpRequest.send(null);

            }
            else {
                alert("Your browser does not support XMLHTTP.");
            }

        }
        function getData2(url, divID) {
            
                  
            var name = document.getElementById('txtName');
            if (name.value.length <= 0) {
                alert("Bạn phải nhập họ và tên");
                document.getElementById('txtName').focus();
                return;
            }
            var email = document.getElementById('txtEmail')
                if(!isEmail(email.value)){
	            alert("Xin vui lòng nhập đúng định dạng Email! ");
	            document.getElementById('txtEmail').focus();
	            return false;
	            }
            var address = document.getElementById('txtAddress')
            if (address.value.length <= 0) {
                alert("Bạn phải nhập địa chỉ");
                document.getElementById('txtAddress').focus();
                return;
            }
            var content = document.getElementById('txtAddedContent')
            if (content.value.length <= 0) {
                alert("Bạn phải nhập nội dung góp ý");
                document.getElementById('txtAddedContent').focus();
                return;
            }
            var code = document.getElementById('txtValidCode')
            if (code.value.length <= 0) {
                alert("Bạn phải nhập mã bảo vệ");
                document.getElementById('txtValidCode').focus();
                return;
            }
            
            var newscode2=document.getElementById('ctl00_MainContent_NewsForumDetailControl_txtNewsCode')
              if (code.value != newscode2.value) {
                alert("Mã bảo vệ không đúng");
                return;
            }
            var URLReturn = url + '&name=' + encodeURIComponent(name.value) + '&email=' + encodeURIComponent(email.value) + '&address=' + encodeURIComponent(address.value) + '&content=' + encodeURIComponent(content.value);
            showLoading(divID);
            if (HttpRequest != null) {
                HttpRequest.open("GET", URLReturn, true);
                HttpRequest.onreadystatechange = function() {

                    if ((HttpRequest.readyState == 4) || (HttpRequest.readyState == 0)) {
                        if (HttpRequest.status == 200) {

                            var Response = HttpRequest.responseText;
                            document.getElementById(divID).innerHTML = Response;

                        }
                    }

                }
                HttpRequest.send(null);

            }
            else {
                alert("Your browser does not support XMLHTTP.");
            }

        }
        function showLoading(divID) {
            var imgNode = document.createElement("img");
            imgNode.src = "/images/loading.gif";
            var dvContent = document.getElementById(divID);
            while (dvContent.firstChild != null)
                dvContent.removeChild(dvContent.firstChild, true);
            dvContent.appendChild(imgNode);
        }
        //Kiem tra email
        function isEmail(email){
	        //If email is null
	        if(email==""){
		        return false;
	        }
	        //If email have space
	        if(email.indexOf(" ")>0){
		        return false;
	        }
	        //Neu email don't have @
	        if(email.indexOf("@") == -1){
		        return false;
	        }
        	
	        var i = 1;
	        var emailLength = email.length;
	        if(email.indexOf(".") == -1){
		        return false;
	        }
	        //Neu email la chuoi co hai dau . gan nhau
	        if(email.indexOf("..")!=-1){
		        return false;
	        }
	        //Neu email la chuoi co nhieu dau @
	        if(email.indexOf("@") != email.lastIndexOf("@")){
		        return false;
	        }
	        //Neu email la chuoi co dau . dau cung
	        if(email.lastIndexOf(".")==email.length-1){
		        return false;
	        }
	        //Neu email la chuoi co ky tu khong thuoc cac ky tu sau
	        var str="abcdefghijklmnopqrstuvwxyz-@._0123456789";
	        for(var j = 0; j<emailLength; j++){
		        if(str.indexOf(email.charAt(j))==-1)
		        {
			        return false;
		        }
	        }
	        return true;
        }
        
        ///////////////////////////////////////////////////////////////////////////////
// Flash Template
///////////////////////////////////////////////////////////////////////////////
function insert_flash( _url , _width , _height )
{
    var writeStr =  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + _width + '" height="' + _height + '" name="wmode">'
                  + '<param name="movie" value="' + _url + '">'
                  + '<param name="quality" value="high">'
                  + '<param name="wmode" value="transparent">'
                  + '<embed src="' + _url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + _width + '" height="' + _height + '"></embed>'
                  + '</object>';

    document.write( writeStr );
}

///////////////////////////////////////////////////////////////////////////////
// ZTransferX Template
///////////////////////////////////////////////////////////////////////////////
function ZTransferX_object( _downloadURL )
{
    var writeStr =  '<OBJECT width = "0" height = "0" ID="ZTransferX" CLASSID="CLSID:C7C7225A-9476-47AC-B0B0-FF3B79D55E67" codebase="' + _downloadURL + '/ZTransferX.cab#version=1,0,3,6" VIEWASTEXT>'
                  + '<PARAM NAME="download.Server" VALUE="'+ _downloadURL + '">'
                  + '<PARAM NAME="download.Port" VALUE="80">'
                  + '<PARAM NAME="download.Instruction" VALUE="OzViewer.idf">'
                  + '<PARAM NAME="install.Base" VALUE="<PROGRAMS>/Forcs">'
                  + '<PARAM NAME="install.Namespace" VALUE="GSCONST">'
                  + '</OBJECT>';

    document.write( writeStr );

}

///////////////////////////////////////////////////////////////////////////////
// OZ Template
///////////////////////////////////////////////////////////////////////////////
function OZView_object( _server , _port , _reportname , _parms )
{
    var writeStr = '';
    
    writeStr = '<OBJECT id="objOZView" CLASSID="CLSID:0FF44578-C130-4A1F-AEE2-E902A7CDC3EC" width="100%" height="100%" border="0" VIEWASTEXT>'
             + '<param name="mayscript" value="true">'
             + '<param name="applet.configmode" value="html">'
             + '<param name="applet.isapplet" value="false">'
             + '<param name="applet.isframe" VALUE="false">'
             + '<param name="applet.smartframesize" value="true">'
             + '<param name="applet.usestatusbar" value="false">'
             + '<param name="language" value="ko/KR">'
             + '<param name="connection.compressedForm" value="true">'
             + '<param name="connection.compresseddatamodule" value="true">'
             + '<param name="FiresScriptEvents" value="true">'
             + '<param name="toolbar.all" value="true">'
             + '<param name="print.command" value="true">';

    // Form Location
    writeStr += '<param name="connection.server" value="' + _server + '">';
    writeStr += '<param name="connection.port" value="' + _port + '">';
    writeStr += '<param name="connection.reportname" value="' + _reportname + '">'

    // Parameters
    writeStr += '<param name="connection.pcount" value="' + _parms.length + '">';
    for( var i=0 ; i < _parms.length ; i++)
    {
        writeStr += '<param name="connection.args' + (i+1) + '" value="' + _parms[i][0] + '=' + _parms[i][1] + '">';    
    }

    writeStr += '</OBJECT> ';
    
    document.write( writeStr );

}