function readXDF_1(LibCertURL, URL, page_num, find_word, title)
{	
	if(URL.toUpperCase().search("/FILE") == -1)
	{
		URL = "/FILE=\"" + URL + "\"";
	}
	
	if(page_num || page_num !="") 
	{
		URL = URL + " /PAGE="+page_num+"\""
	}

	if(title !="" || title) 
	{
		URL = URL + " /TITLE=\"" + title + "\"";
	}

	if(find_word || find_word !="")
	{
		URL = URL + " /WORD=\"" + find_word + "\"";	
	}

	document.AgentActiveX.StartReaderCert(LibCertURL, URL);
} 

function readXDF(URL, find_word, title)
{
	if( !find_word || find_word == "" )
	{
		// title Ãß°¡ 
		if ( title != "" || title)
		{
			URL = "/FILE=\"" + URL + "\" /TITLE=\"" + title + "\"";
		}
		document.AgentActiveX.StartReader(URL);
		return;
	}

	if( URL.toUpperCase().search("/FILE") > -1 )
	{
		URL = URL + " /WORD=\"" + find_word + "\" ";

	}
	else
	{
		URL = "/FILE=\"" + URL + "\" /WORD=\"" + find_word + "\"";
	}

	// title Ãß°¡ 
	if ( title != "" || title)
	{
		URL = URL + " /TITLE=\"" + title + "\" ";
	}

	document.AgentActiveX.StartReader(URL);
} 
function openpreview(URL, title, book_num)
{

	var frm = document.frmbingogan;
	frm.action = "./inc/content/action_ok_.asp?mode=readcount&book_num="+book_num;
	frm.target = "bingogan";
	frm.submit();

	   if(URL.toUpperCase().search("/FILE") == -1)

	   {
				 URL = "/FILE=\"" + URL + "\"";
	   }

	   if(title !="" || title) 

	   {
				 URL = URL + " /TITLE=\"" + title + "\"";
	   }

	   document.AgentActiveX.StartReader(URL);

}

function readNODRM(URL, find_word, title)
{
	if( !find_word || find_word == "" )
	{
		// title Ãß°¡ 
		if ( title != "" || title)
		{
			URL = "/FILE=\"" + URL + "\" /TITLE=\"" + title + "\"";
		}
		document.AgentActiveX.StartReader(URL);
		return;
	}

	if( URL.toUpperCase().search("/FILE") > -1 )
	{
		URL = URL + " /WORD=\"" + find_word + "\" ";

	}
	else
	{
		URL = "/FILE=\"" + URL + "\" /WORD=\"" + find_word + "\"";
	}

	// title Ãß°¡ 
	if ( title != "" || title)
	{
		URL = URL + " /TITLE=\"" + title + "\" ";
	}

	document.AgentActiveX.StartReader(URL);
} 
 
function Install()
{
	try
	{
		var obj = new ActiveXObject("ESPRESSOAGENT.EspressoAgentCtrl.1");
		if (!obj)
		{
			alert("Espresso Agent°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
			return;
		}
	}
	catch (e)
	{
			alert("Espresso Agent ¼³Ä¡ È®ÀÎ¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.");
			return;
	}

	document.AgentActiveX.StartReader("");
}

//20100104 ÆË¾÷À¸·Î ¶ç¿ì±â
function readXDFdown(URL, title, find_word)
{
	if( !find_word || find_word == "" )
	{
		// title Ãß°¡ 
		if ( title != "" || title)
		{
			URL = "/FILE=\"" + URL + "\" /TITLE=\"" + title + "\"";
		}
		document.AgentActiveX.StartReader(URL);
		return;
	}

	if( URL.toUpperCase().search("/FILE") > -1 )
	{
		URL = URL + " /WORD=\"" + find_word + "\" ";

	}
	else
	{
		URL = "/FILE=\"" + URL + "\" /WORD=\"" + find_word + "\"";
	}

	// title Ãß°¡ 
	if ( title != "" || title)
	{
		URL = URL + " /TITLE=\"" + title + "\" ";
	}

	document.AgentActiveX.StartReader(URL);
	self.close();
} 


function Install_Check()
{
	try
	{
		var obj = new ActiveXObject("ESPRESSOAGENT.EspressoAgentCtrl.1");
		if (!obj)
		{
			check_install = "NO";
			alert("Espresso Agent°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
			return;
		}
	}
	catch (e)
	{
			check_install = "NO";
			alert("Espresso Agent ¼³Ä¡ È®ÀÎ¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.");
			return;
	}  
	check_install = "YES";
}