installCheck = function(rpx,xml,modal){
	try{
		var obj = new ActiveXObject("RXProPlus.Viewer");
		ViewerReport(rpx,xml,modal);
	}catch(e){
		if(confirm("ReportExpress ºä¾î°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n¼³Ä¡ ÆÄÀÏÀ» ´Ù¿î·ÎµåÇÏ½Ã°Ú½À´Ï±î?")){
			DownloadInstallFile();
			return;
		}else{
			alert("¼³Ä¡¸¦ Ãë¼ÒÇÏ¿´½À´Ï´Ù. ºä¾î¸¦ ÀÌ¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
			return;
		}
	}
}

DownloadInstallFile = function(){
   var FileName = "http://dev.cabsoftware.com:8088/cdoc/rxpp/vista/cab/rxpp_setup.exe";
   alert("¼³Ä¡ ¿Ï·á ÈÄ¿¡´Â [»õ·Î°íÄ§] ÈÄ ´Ù½Ã ½ÃµµÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
   window.open(FileName,"","width=10,height=10,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,left=0,top=0");
}


function ViewerReport(rpx,xml,modal) {
    var hostip = window.location.host;
    var hostpath = window.location.pathname;
    hostpath = hostpath.substring(0,hostpath.lastIndexOf("/")+1);
    if (hostpath.substr(0,1) != "/" ) hostpath = "/" + hostpath;
    
    var Viewer1 = document.getElementById('Viewer1');
    try {
        Viewer1.Initialize();
        Viewer1.Server = "http://" + hostip + hostpath ;
        Viewer1.ReportLayout = rpx;
        if (xml == "xmldata"){
            Viewer1.xml = xmldata.xml ;
        }            
        else if (xml == "oxmldata") {
        	Viewer1.xml = opener.xmldata.xml ;
        }
        else if (xml == "pxmldata") {
        	Viewer1.xml = parent.xmldata.xml ;
        }
        else if (xml == "formxmldata") {
        	Viewer1.ReportLayout = reportform.rpx.value ;
        	Viewer1.xml = reportform.xmldata.value ;
        }
        else if (xml == "oformxmldata") {
        	Viewer1.ReportLayout = opener.reportform.rpx.value ;
        	Viewer1.xml = opener.reportform.xmldata.value ;
        }
        else if (xml == "oformfileurl") {
        	Viewer1.ReportLayout = opener.reportform.rpx.value ;
        	Viewer1.FileUrl = "http://" + hostip + hostpath + "xml/" + opener.reportform.fileurl.value ;
        }
        else if (xml != "") {
        	Viewer1.FileUrl="http://" + hostip + hostpath + "xml/" + xml;
        }
        Viewer1.Modal = modal;		//  ¸ð´ÞÃ¢À¸·Î ¶ç¿ì±â
        if (modal == 1) 
        	Viewer1.style.display = "none" ;
        else {
        	Viewer1.style.display = "" ;
        }
        Viewer1.Export = 1;		    // ³»º¸³»±â ±â´É »ç¿ëÀ¯¹«
        Viewer1.ViewToolBar = 1;	// µµ±¸¹Ù º¸¿©ÁÖ±â ±â´É À¯¹«
        Viewer1.debugging = 1;		// ¿¡·¯ º¸ÀÌ±â
        Viewer1.SetZoom = 100;       // º¸°í¼­ º¸±â »óÅÂ
        Viewer1.RunViewer();
    } catch(e) {
        alert("ReportExpress¢â Pro Plus Viewer°¡ Á¤»óÀûÀ¸·Î µ¿ÀÛÇÏÁö ¾Ê½À´Ï´Ù.\n\n(Error: "+ e.description +")");
    }
}
