//------------------------------------------------------------------------------------------
//
//                page_link.js    ( version    v1.0.6 )
//
//                function  
//                             
//		    	          
//                 
//                																  prg by pyc 
//------------------------------------------------------------------------------------------
//======================== destroy ============================
function DestorypageLink( top_Div,ndZindex) {
	var i ;
	if (top_Div) {
		for(i=top_Div.childNodes.length - 1 ; i >-1 ; i--) {
			var oChild = top_Div.children(i);
			if (oChild.style.zIndex == ndZindex ){
				 top_Div.removeChild(oChild) ;
			}	 
		}
	}
	 
}


//--------------------------------------Â÷·Ê ----------------------------------------------

function  chkInfo1PageGoLink(){
	var sp = g_cpage - g_spage;
	if ( sp >= 0 ) {
		if ( g_info1Page[sp] )  pageGoLink(sp,0);
	}
	if ( g_info1Page[sp+1] )  	pageGoLink(sp+1,1);
}	




function  pageGoLink(sp,mode){
	var ndArea = g_info1Page[sp];
	var ndStyle= g_pulinkStyle[1][0];
	var ndZindex = 11;
	var left = g_bxl1;

	if (b_direct =='0'){
		if(mode==1) 	left = g_bxl2;
	}else{
		if(mode==0) 	left = g_bxl2;
	}
	createPageLink(parent_plMDiv,ndArea,ndStyle,ndZindex,left,sp);
	
}	


function createPageLink(top_Div,ndArea,ndStyle,ndZindex,sleft,sp){
	var i ;
	for (i=0 ; i < ndArea.length ; i++ ) {
		var cNewDiv = document.createElement("Div");
		with (cNewDiv ) {
			with ( style ) {
				cssText = ndStyle ;
				position = "absolute";
				visibility = "visible" ;
				left = ndArea[i].left + sleft;
				
				//top = ndArea[i].top+g_top;
				top = ndArea[i].top+g_top + Math.round((g_by - g_pageY[sp])/2);  //2008.3.8 ¼öÁ¤
				width = ndArea[i].width ;
				height = ndArea[i].height ;
				zIndex = ndZindex ;
			}
			onmousedown = onMouseDownPLink;
			onmouseover = onMouseOverPLink;
			onmouseout = onMouseOutPLink;
			//title = "1¸¶¿ì½º¸¦ Å¬¸¯ÇÏ½Ã¸é\n"+ndArea[i].gopage +" page·Î ÀÌµ¿ ÇÕ´Ï´Ù." ;
			innerHTML = "<input type=\"hidden\" value=\"" + ndArea[i].gopage + "\">" ;
		}
		top_Div.appendChild(cNewDiv);
		 g_info1PageFlag = true;
	}
}
	

//---------------------------- large link ---------------------------------------------
function  pageGoLinkLdisp(sp,rx,ry){

	var ndArea = g_info1Page[sp];
	var ndStyle= g_pulinkStyle[1][0];
	var ndZindex = 65;
	createPageLLink(parent_plLDiv,ndArea,ndStyle,ndZindex,rx,ry);
	
}	


function createPageLLink(top_Div,ndArea,ndStyle,ndZindex,rx,ry){
       // LargeImgTop = top;
       // LargeImgLeft = left;
	var i ;
	for (i=0 ; i < ndArea.length ; i++ ) {
		var cNewDiv = document.createElement("Div");
		with (cNewDiv ) {
			with ( style ) {
				cssText = ndStyle ;
				position = "absolute";
				visibility = "visible" ;
				left = ndArea[i].left * rx + 4;
				top = ndArea[i].top * ry + 4;
				width = ndArea[i].width * rx;
				height = ndArea[i].height * ry;
				zIndex = ndZindex ;
			}
			onmousedown = onMouseDownPLink;
			onmousewheel=onLargeMouseWheel;
			onmouseover = onMouseOverPLink;
			onmouseout = onMouseOutPLink;
			//title = "2¸¶¿ì½º¸¦ Å¬¸¯ÇÏ½Ã¸é\n"+ndArea[i].gopage +" page·Î ÀÌµ¿ ÇÕ´Ï´Ù" ;
			innerHTML = "<input type=\"hidden\" value=\"" + ndArea[i].gopage + "\">" ;
					
		}
		top_Div.appendChild(cNewDiv);
		 g_info1PageLFlag = true;
	}
}



//----------------------- page link mouse event --------------------------------------

	
function onMouseOverPLink(){
	var otmpDivs = this.children.tags("DIV") ;
	eval(g_pulinkStyle[0][1]);
	this.style.cursor ="hand" ;
}	

function onMouseOutPLink(){
	var otmpDivs = this.children.tags("DIV") ;
	eval(g_pulinkStyle[0][2]);
	this.style.cursor ="default" ;
}

function onMouseDownPLink(){
    	var mkey =  window.event.button;
	if ( mkey==1 ) {
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][3]);

		this.style.cursor ="hand" ;
		var oInput = this.children.tags("INPUT") ;
		var page =  parseInt(oInput(0).value) ;
         	ListPageGo(page);
	}else if(mkey==2){
       		  FullImg3Cancel();
	}	   
}



//================================================ url link =============================================
function  chkInfo3PageGoLink(){
	var sp = g_cpage - g_spage;
	if ( sp >= 0 ) {
		if ( g_info3Page[sp] )  urlGoLink(sp,0);
	}
	if ( g_info3Page[sp+1] )  	urlGoLink(sp+1,1);
}	




function  urlGoLink(sp,mode){
	var ndArea = g_info3Page[sp];
	var ndStyle= g_pulinkStyle[1][1];
	var ndZindex = 11;
	var lktype = "urlGoLink";
	var left = g_bxl1;
	
	if (b_direct =='0'){
		if(mode==1) 	left = g_bxl2;
	}else{
		if(mode==0) 	left = g_bxl2;
	}
	createUrlLink(parent_plMDiv,ndArea,ndStyle,ndZindex,lktype,left,sp);
}	


function createUrlLink(top_Div,ndArea,ndStyle,ndZindex,lktype,sleft,sp)
{
	var i ;
	for (i=0 ; i < ndArea.length ; i++ )
	{
		var cNewDiv = document.createElement("Div");
		with (cNewDiv )
		{
			with ( style )
			{
				cssText = ndStyle ;
				position = "absolute";
				visibility = "visible" ;
				left = ndArea[i].left + sleft;
				top = ndArea[i].top+g_top+ Math.round((g_by - g_pageY[sp])/2);  //2008.3.8 ¼öÁ¤
				width = ndArea[i].width ;
				height = ndArea[i].height ;
				zIndex = ndZindex ;
			}
			switch ( lktype )
			{
				case "urlGoLink" :
					onmouseover = onMouseOverUrlLink;
					onmouseout = onMouseOutUrlLink;
					//title = "3¸¶¿ì½º¸¦ Å¬¸¯ÇÏ½Ã¸é\n"+ndArea[i].url+"\n\""+ndArea[i].mess+"\"";
					switch ( ndArea[i].wopen )
					{
						case "audio" :
							onmousedown = onMouseDownAudioLink;
							//title +="  Audio°¡ play µË´Ï´Ù" ;
							if ( ndArea[i].para )	var callVal = ndArea[i].url+"?"+ndArea[i].para;
							else					var callVal = ndArea[i].url;
							innerHTML = "<input type=\"hidden\" value=\"" + callVal + "\">" ;
						break;
						case "video" :
							onmousedown = onMouseDownVideoLink;
							//title += "  Video°¡ play µË´Ï´Ù" ;
							if ( ndArea[i].para )	var callVal = ndArea[i].url+"?"+ndArea[i].para;
							else					var callVal = ndArea[i].url;
							innerHTML = "<input type=\"hidden\" value=\"" + callVal + "\">" ;
						break;
						case "mail" :
							onmousedown = onMouseDownMailLink;
							//title += "  ¸ÞÀÏÀ» º¸³¾ ¼ö ÀÖ½À´Ï´Ù." ;
							innerHTML = "<input type=\"hidden\" name=rname value=\"" + ndArea[i].para + "\">" ;
							innerHTML +="<input type=\"hidden\" name=remail value=\"" + ndArea[i].url + "\">"
						break;
						case "ebook" :
							onmousedown = onMouseDowneBookLink;
							//title += " eºÏÀ» º¼ ¼ö ÀÖ½À´Ï´Ù." ;
							if (ndArea[i].url.indexOf("http://",0) == -1)	var tURL =  'http://'+ndArea[i].url;
							else											var tURL =  ndArea[i].url;
							var formbody = "<form name=ebook method="+ ndArea[i].method+" action="+tURL+"  target=hiddenframe>";
							if( ndArea[i].para )
							{
								var para = ndArea[i].para.split("&");
								for(var j=0; j <para.length ; j++)
								{
									formbody += "<input type=hidden name="+para[j].split("=")[0]+" value=\"" + para[j].split("=")[1] + "\">"
								}	
								formbody += "</form>";
							}	
							innerHTML = formbody ;
						break;
						case "pop" :
							onmousedown = onMouseDownPopLink;
							//title += " ÆË¾÷À» º¼ ¼ö ÀÖ½À´Ï´Ù." ;
							if (ndArea[i].url.indexOf("http://",0) == -1)	var tURL =  'http://'+ndArea[i].url;
							else											var tURL =  ndArea[i].url;
							innerHTML = "<input type=\"hidden\" name=ppap value=\"" + ndArea[i].para + "\">" ;
							innerHTML +="<input type=\"hidden\" name=purl value=\"" + tURL + "\">"
							innerHTML +="<input type=\"hidden\" name=pwsize value=\"" + ndArea[i].pwsize + "\">"
							innerHTML +="<input type=\"hidden\" name=phsize value=\"" + ndArea[i].phsize + "\">"							
						break;
						case "open" :
						case "close" :
							onmousedown = onMouseDownUrlLink;
							//title += " ·Î ÀÌµ¿ ÇÕ´Ï´Ù" ;
							if (ndArea[i].url.indexOf("http://",0) == -1)	var tURL =  'http://'+ndArea[i].url;
							else											var tURL =  ndArea[i].url;
							if ( ndArea[i].wopen == 'open')					var target = "OpenUrl";
							else if ( ndArea[i].wopen == 'close')			var target = "CloseUrl";
							var formbody = "<form  method="+ ndArea[i].method+" action="+tURL+"  target="+target+">";
							if( ndArea[i].para )
							{
								var para = ndArea[i].para.split("&");
								for(var j=0; j <para.length ; j++)
								{
									formbody += "<input type=hidden name="+para[j].split("=")[0]+" value=\"" + para[j].split("=")[1] + "\">"
								}	
								formbody += "</form>";
							}	
							innerHTML = formbody ;
						break;
					}
				break;
			}
		}
		//alert(top_Div);
		top_Div.appendChild(cNewDiv);
		g_info3PageFlag = true;
	}
}
	


//---------------------------- large url  link ---------------------------------------------
function  urlGoLinkLdisp(sp,rx,ry){
	var ndArea = g_info3Page[sp];
	var ndStyle= g_pulinkStyle[1][1];
	var ndZindex = 65;
	var lktype = "urlGoLink";
    createUrlLLink(parent_plLDiv,ndArea,ndStyle,ndZindex,lktype,rx,ry);
}


function createUrlLLink(top_Div,ndArea,ndStyle,ndZindex,lktype,rx,ry){
       // LargeImgTop = top;
       // LargeImgLeft = left;
	var i ;
	for (i=0 ; i < ndArea.length ; i++ ) {
		var cNewDiv = document.createElement("Div");
		with (cNewDiv ) {
			with ( style ) {
				cssText = ndStyle ;
				position = "absolute";
				visibility = "visible" ;
				left = ndArea[i].left * rx + 4;
				top = ndArea[i].top * ry + 4;
				width = ndArea[i].width * rx;
				height = ndArea[i].height * ry;
				zIndex = ndZindex ;
			}
			switch ( lktype ) {
			        case "urlGoLink" :
					onmouseover = onMouseOverUrlLink;
					onmouseout = onMouseOutUrlLink;
					onmousewheel=onLargeMouseWheel;
					//title = "4¸¶¿ì½º¸¦ Å¬¸¯ÇÏ½Ã¸é\n"+ndArea[i].url+"\n"+ndArea[i].mess;
				       	switch ( ndArea[i].wopen ){
				       		case "audio" :
							onmousedown = onMouseDownAudioLink;
							//title +="  Audio°¡ play µË´Ï´Ù" ;
							if ( ndArea[i].para )  var callVal = ndArea[i].url+"?"+ndArea[i].para;
							else var callVal = ndArea[i].url;
							innerHTML = "<input type=\"hidden\" value=\"" + callVal + "\">" ;
							break;
						case "video" :
							onmousedown = onMouseDownVideoLink;
							title += "  Video°¡ play µË´Ï´Ù" ;
							if ( ndArea[i].para )  var callVal = ndArea[i].url+"?"+ndArea[i].para;
							else var callVal = ndArea[i].url;
							innerHTML = "<input type=\"hidden\" value=\"" + callVal + "\">" ;
							break;
						case "mail" :
							onmousedown = onMouseDownMailLink;
							title += "  ¸ÞÀÏÀ» º¸³¾ ¼ö ÀÖ½À´Ï´Ù." ;
							innerHTML = "<input type=\"hidden\" name=rname value=\"" + ndArea[i].para + "\">" ;
							innerHTML +="<input type=\"hidden\" name=remail value=\"" + ndArea[i].url + "\">"
							break;
						case "ebook" :
							onmousedown = onMouseDowneBookLink;
							//title += " eºÏÀ» º¼ ¼ö ÀÖ½À´Ï´Ù." ;
						       	if (ndArea[i].url.indexOf("http://",0) == -1)   var tURL =  'http://'+ndArea[i].url;
						       	else var tURL =  ndArea[i].url;
							var formbody = "<form name=ebook method="+ ndArea[i].method+" action="+tURL+"  target=hiddenframe>";
							if( ndArea[i].para ) {
								var para = ndArea[i].para.split("&");
								for(var j=0; j <para.length ; j++){
									formbody += "<input type=hidden name="+para[j].split("=")[0]+" value=\"" + para[j].split("=")[1] + "\">"
								}	
								formbody += "</form>";
							}	
							innerHTML = formbody ;
						break;
						case "pop" :
							onmousedown = onMouseDownPopLink;
							//title += " ÆË¾÷À» º¼ ¼ö ÀÖ½À´Ï´Ù." ;
							if (ndArea[i].url.indexOf("http://",0) == -1)	var tURL =  'http://'+ndArea[i].url;
							else											var tURL =  ndArea[i].url;
							innerHTML = "<input type=\"hidden\" name=ppap value=\"" + ndArea[i].para + "\">" ;
							innerHTML +="<input type=\"hidden\" name=purl value=\"" + tURL + "\">"
							innerHTML +="<input type=\"hidden\" name=pwsize value=\"" + ndArea[i].pwsize + "\">"
							innerHTML +="<input type=\"hidden\" name=phsize value=\"" + ndArea[i].phsize + "\">"							
						break;
						case "open" :
						case "close" :
							onmousedown = onMouseDownUrlLink;
							//title += " ·Î ÀÌµ¿ ÇÕ´Ï´Ù" ;
						       	if (ndArea[i].url.indexOf("http://",0) == -1)   var tURL =  'http://'+ndArea[i].url;
						       	else var tURL =  ndArea[i].url;
					       		if ( ndArea[i].wopen == 'open')      	var target = "OpenUrl";
					       		else if ( ndArea[i].wopen == 'close')    	var target = "CloseUrl";
							var formbody = "<form  method="+ ndArea[i].method+" action="+tURL+"  target="+target+">";
							if( ndArea[i].para ) {
								var para = ndArea[i].para.split("&");
								for(var j=0; j <para.length ; j++){
									formbody += "<input type=hidden name="+para[j].split("=")[0]+" value=\"" + para[j].split("=")[1] + "\">"
								}	
								formbody += "</form>";
							}	
							innerHTML = formbody ;
							break;
					}
					break;
			}
					
		}
		//alert(top_Div);
		top_Div.appendChild(cNewDiv);
		 g_info3PageLFlag = true;
	}
}


//-----------------------url  link mouse event --------------------------------------
	
function onMouseOverUrlLink(){
	var otmpDivs = this.children.tags("DIV") ;
	eval(g_pulinkStyle[0][1]);
	this.style.cursor ="hand" ;
}	

function onMouseOutUrlLink(){
	var otmpDivs = this.children.tags("DIV") ;
	eval(g_pulinkStyle[0][4]);
	this.style.cursor ="default" ;
}

function onMouseDownAudioLink(){
    	var mkey =  window.event.button;
	if ( mkey==1 ) {
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][3]);

		this.style.cursor ="hand" ;
		var oInput = this.children.tags("INPUT") ;
		var URL =  oInput(0).value;
		window.location.href = URL;
		//DestoryAVplay();
		//createAudioplay(URL,1);
	}else if( mkey==2 ){
       		  FullImg3Cancel();
	}	   
}

function onMouseDownVideoLink(){
    	var mkey =  window.event.button;
	if ( mkey==1 ) {
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][3]);

		this.style.cursor ="hand" ;
		var oInput = this.children.tags("INPUT") ;
		var URL =  oInput(0).value;
		window.location.href = URL;
		//DestoryAVplay();
		//createVideoplay(URL,1);
	}else if(mkey==2){
       		  FullImg3Cancel();
	}	   
}

function onMouseDownMailLink()
{
	var mkey =  window.event.button;
	if ( mkey==1 )
	{
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][3]);
		
		this.style.cursor ="hand" ;
		var oInput = this.children.tags("INPUT") ;
		var rname = oInput(0).value;
		var remail = oInput(1).value;
		
		var para ='?rname='+rname+'&remail='+remail+'&title='+g_title+'&rurl='+retUrl;
		var width = 350;
		var height = 525;
		var top = Math.round((g_height-height)/2);
		var left = Math.round((g_width-width)/2);
		var nw=window.open("http://www.ezebook.net/mail/sendmail.php3"+para,"mail","top="+top+",left="+left+",width="+width+",height="+height+",status=no, scrolling=auto");
		nw.focus();
	}
	else if(mkey==2)
	{
		FullImg3Cancel();
	}	   
}

function onMouseDownPopLink()
{
	var mkey =  window.event.button;
	if ( mkey==1 )
	{
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][3]);
		
		this.style.cursor ="hand" ;
		var oInput = this.children.tags("INPUT") ;
		var ppara = oInput(0).value;
		var purl = oInput(1).value;
		var pwsize = oInput(2).value;
		var phsize = oInput(3).value;
	
		var para ='?'+ppara;
		var top = Math.round((g_height-phsize)/2);
		var left = Math.round((g_width-pwsize)/2);
		var Np=window.open(purl+para,"NewPopup","top="+top+",left="+left+",width="+pwsize+",height="+phsize+",status=no, scrolling=auto");
		Np.focus();
	}
	else if(mkey==2)
	{
		FullImg3Cancel();
	}	   
}


function onMouseDowneBookLink()
{
	var mkey =  window.event.button;
	if ( mkey==1 )
	{
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][5]);
		
		this.style.cursor ="hand" ;
		
		var oForm = this.children.tags("FORM") ;
		
		oForm(0).submit();	
	}
	else if(mkey==2)
	{
		FullImg3Cancel();
	}	   
}

function onMouseDownUrlLink()
{
	var mkey =  window.event.button;
	if ( mkey==1 )
	{
		var otmpDivs = this.children.tags("DIV") ;
		eval(g_pulinkStyle[0][5]);
		
		this.style.cursor ="hand" ;
		
		var oForm = this.children.tags("FORM") ;

		var height = 600;
		var width = 800;
		var top = Math.round((g_height-height)/2);
		var left = Math.round((g_width-width)/2);

		oForm(0).submit();	
/*		È²È«±¸ ¼öÁ¤	    		
		if( oForm(0).target == 'OpenUrl' )
		{   		
			var nw=window.open("about:blank","OpenUrl","top="+top+",left="+left+",width="+width+",height="+height+",location=yes,menubar=yes,status=yes, scrollbars=yes, resizable=yes");
			oForm(0).submit();	
		}
		else if( oForm(0).target == 'CloseUrl' )
		{  
			var nw=window.open("about:blank","CloseUrl","top="+top+",left="+left+",width="+width+",height="+height+",status=no, scrollbars=yes, resizable=yes");
			oForm(0).submit();	
		}	
		nw.focus();
*/
	}
	else if(mkey==2)
	{
		FullImg3Cancel();
	}	   
}







var g_pulinkStyle = new Array(2) ;
g_pulinkStyle[0] = new Array(6) ;
g_pulinkStyle[0][0] = "border-left:2 white solid; border-top:2 white solid; border-right: 2 white solid; border-bottom:2 black solid; background-color:red; filter:alpha(Opacity=10, FinishOpacity=10,Style=1, StartX=0, FinishX=80, StartY=15, FinishY=15)"
g_pulinkStyle[0][1] = "with(this.style) { " + "\n" +" borderLeft = \"1 white solid\" ; " + "\n" +" borderTop = \"1 white solid\" ; " + "\n" +" borderRight = \"1 black solid\" ; " + "\n" +" borderBottom= \"1 black solid\" ; " + "\n" +" filter = \"alpha(Opacity=40)\" ; " + "\n" +"} ";
g_pulinkStyle[0][2] = "with(this.style) { " + "\n" +"borderLeft = \"2 white solid\" ; " + "\n" +"borderTop = \"2 white solid\" ; " + "\n" +"borderRight = \"2 black solid\" ; " + "\n" +"borderBottom= \"2 black solid\" ; " + "\n" +" filter = \"alpha(Opacity=10)\" ; " + "\n" +"} ";
g_pulinkStyle[0][3] = "with(this.style) { " + "\n" +"borderLeft = \"2 black solid\" ; " + "\n" +"borderTop = \"2 black solid\" ; " + "\n" +"borderRight = \"2 white solid\" ; " + "\n" +"borderBottom= \"2 white solid\" ; " + "\n" +" filter = \"alpha(Opacity=40)\" ; " + "\n" +"} ";
g_pulinkStyle[0][4] = "with(this.style) { " + "\n" +"borderLeft = \"2 white solid\" ; " + "\n" +"borderTop = \"2 white solid\" ; " + "\n" +"borderRight = \"2 black solid\" ; " + "\n" +"borderBottom= \"2 black solid\" ; " + "\n" +" filter = \"alpha(Opacity=20)\" ; " + "\n" +"} ";
g_pulinkStyle[0][5] = "with(this.style) { " + "\n" +"borderLeft = \"2 white solid\" ; " + "\n" +"borderTop = \"2 white solid\" ; " + "\n" +"borderRight = \"2 black solid\" ; " + "\n" +"borderBottom= \"2 black solid\" ; " + "\n" +" filter = \"alpha(Opacity=40)\" ; " + "\n" +"} ";


g_pulinkStyle[1] = new Array(6) ;
g_pulinkStyle[1][0] = "border-left:1 whit solid; border-top:1 whit solid; border-right: 1 black solid; border-bottom:1 black solid;  filter:alpha(Opacity=10)"
g_pulinkStyle[1][1] = "border-left:1 white solid; border-top:1 white solid; border-right: 1 white solid; border-bottom:1 black solid;  filter:alpha(Opacity=10)"

var g_pulinkBgColor = new Array(10);
g_pulinkBgColor[0] ='#ffffff';
g_pulinkBgColor[1] ='#ffffff';
g_pulinkBgColor[2] ='#80ff80';
g_pulinkBgColor[3] ='#0080ff';
g_pulinkBgColor[4] ='#ff0000';
g_pulinkBgColor[5] ='#ffff00';
g_pulinkBgColor[6] ='#00ffff';
g_pulinkBgColor[7] ='#0080c0';
g_pulinkBgColor[8] ='#ff8000';
g_pulinkBgColor[9] ='#0000ff';

//================== Init Base Book border =========================
function initBookBorder(){
	var cNewDiv = null;
	var cNewImg = null;
	var borderDiv = null;
	
	// left top corner	
	cNewDiv = createBorderDiv(0,0);
	cNewImg = createBorderImg("cbtl1.gif",0,0);
	cNewDiv.appendChild(cNewImg);
       borderDiv = document.all['layerl1'];
	borderDiv.appendChild(cNewDiv);


	cNewDiv = createBorderDiv(0,0);
	cNewImg = createBorderImg("cbtl1.gif",0,0);
	cNewDiv.appendChild(cNewImg);
       borderDiv = document.all['layerl2'];
	borderDiv.appendChild(cNewDiv);

	// left bottom corner
	cNewDiv = createBorderDiv(0,g_by-9);
	cNewImg = createBorderImg("cbbl1.gif",0,g_by-9);
	cNewDiv.appendChild(cNewImg);
	
       borderDiv = document.all['layerl1'];
	borderDiv.appendChild(cNewDiv);

	cNewDiv = createBorderDiv(0,g_by-9);
	cNewImg = createBorderImg("cbbl1.gif",0,g_by-9);
	cNewDiv.appendChild(cNewImg);
       borderDiv = document.all['layerl2'];
	borderDiv.appendChild(cNewDiv);

	// right top corner	
	cNewDiv = createBorderDiv(g_bx-8,0);
	cNewImg = createBorderImg("cbtr1.gif",g_bx-8,0);
	cNewDiv.appendChild(cNewImg);
       borderDiv = document.all['layerr1'];
	borderDiv.appendChild(cNewDiv);

	cNewDiv = createBorderDiv(g_bx-8,0);
	cNewImg = createBorderImg("cbtr1.gif",g_bx-8,0);
	cNewDiv.appendChild(cNewImg);
       borderDiv = document.all['layerr2'];
	borderDiv.appendChild(cNewDiv);

	// right bottom corner
	cNewDiv = createBorderDiv(g_bx-8,g_by-9);
	cNewImg = createBorderImg("cbbr1.gif",g_bx-8,g_by-9);
	cNewDiv.appendChild(cNewImg);
	
       borderDiv = document.all['layerr1'];
	borderDiv.appendChild(cNewDiv);

	cNewDiv = createBorderDiv(g_bx-8,g_by-9);
	cNewImg = createBorderImg("cbbr1.gif",g_bx-8,g_by-9);
	cNewDiv.appendChild(cNewImg);
       borderDiv = document.all['layerr2'];
	borderDiv.appendChild(cNewDiv);
}	

function createBorderDiv(x,y){
	var cDiv = document.createElement("Div");
		with (cDiv ) {
				with ( style ) {
					//cursor = "hand";
					position = "absolute";
					//visibility = "hidden" ;
					left = x;
					top = y;
					width = 8;
					height = 9;
					zIndex = 1; 
				}
		}
		return cDiv;	
}


	
function 	createBorderImg(iname,x,y){		
	var cImg = document.createElement("IMG");
		with (cImg ) {
				src = "icon2/"+iname;
				with ( style ) {
					position = "absolute";
					left = 0;
					top = 0;
					width = 8;
					height = 9;
					alt="";
				}
		}
		return cImg;
}


function DestBookBorder(){
	DestoryBorLink(document.all['layerl1']);
	DestoryBorLink(document.all['layerl2']);
	DestoryBorLink(document.all['layerr1']);
	DestoryBorLink(document.all['layerr2']);
}

function DestoryBorLink(top_Div) {
	var i,ndZindex=1;
		for(i=top_Div.childNodes.length - 1 ; i >-1 ; i--) {
			var oChild = top_Div.children(i);
			if (oChild.style.zIndex == ndZindex )
				 top_Div.removeChild(oChild) ;
		}
}
