function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
     }
  }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
} 
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

/*±âº» ·Ñ¿À¹ö½ºÅ©¸³Æ® ½ÃÀÛ*/
function imgrollover(img,overname){
	img.src = overname;	
}
function imgrollout(img,outname){
	img.src = outname;
}
/*±âº» ·Ñ¿À¹ö½ºÅ©¸³Æ® ³¡*/

function WriteEmbed(emb_id){ 
    document.write(document.getElementById(emb_id).value);
} 

//self.onError=null;
//currentX = currentY = 0; 
//whichIt = null; 
//lastScrollX = 0; lastScrollY = 0;
//NS = (document.layers) ? 1 : 0;
//IE = (document.all) ? 1: 0;
//
//var tmp1= tmp2= tmp3 =0;
//tmp1 = document.body.clientHeight;
//function heartBeat() {
//
//	tmp2 = document.body.clientHeight;
//	if(tmp1 != tmp2){
//	    tmp3 =  tmp2 - tmp1; 
//		tmp1 = tmp2;
//		if(tmp3<0){
//	  }
//	  }
//
//	if(IE) { 
//		diffY = document.body.scrollTop; 
//		diffX = 0;
//		}
//	if(NS) { 
//		diffY = self.pageYOffset;
//		diffX = self.pageXOffset; }
//    if(diffY != lastScrollY) {
//		percent = .1 * (diffY - lastScrollY);
//		if(percent > 0) 
//			percent = Math.ceil(percent);
//		else 
//			percent = Math.floor(percent);
//		
//		if(IE) 
//			document.all.floater.style.pixelTop += percent;
//		if(NS) 
//			document.floater.top += percent; 
//		
//		lastScrollY = lastScrollY + percent;
//	}
//
//	if(diffX != lastScrollX) {
//		percent = .1 * (diffX - lastScrollX);
//	
//		if(percent > 0) 
//			percent = Math.ceil(percent);
//		else 
//			percent = Math.floor(percent);
//		
//		if(IE) document.all.floater.style.pixelLeft += percent;
//		if(NS) document.floater.top += percent;
//		lastScrollY = lastScrollY + percent;
//	} 
//} 
//if(NS || IE) action = window.setInterval("heartBeat()",1);
//
////Footer Rolling Banner Script
//
//var downLayerId;
//var dropDegree = 10; //½ºÅ©·Ñ ¼Óµµ
//var doDirect;
//var DirectTerm = 3000; //½ºÅ©·Ñ Áö¿¬½Ã°£
//var curDropIdx = 0;

function DirectDown()
{
clearInterval(doDirect);
clearInterval(downLayerId);

for(i = curDropIdx ;i < document.all["DropHit"].length + curDropIdx;i++){
  document.all["DropHit"][i%document.all["DropHit"].length].style.posTop = document.all["DropHit"][i%document.all["DropHit"].length].style.posHeight * (-1*((i-curDropIdx)%document.all["DropHit"].length));
}
var temp = 'setInterval("DownLayer()",20)';
downLayerId = eval(temp);
direction = "down";
}
function DownLayer()
{
if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight){
  for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++){
   document.all["DropHit"][j%document.all["DropHit"].length].style.posTop += dropDegree;
  }
}else{
  clearInterval(downLayerId);
  for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++){
   document.all["DropHit"][j%document.all["DropHit"].length].style.posTop = document.all["DropHit"][j%document.all["DropHit"].length].style.posHeight *((-1*((j-curDropIdx)%document.all["DropHit"].length))+1);
  }
  curDropIdx = (curDropIdx + 1) ;
  curDropIdx = curDropIdx > document.all["DropHit"].length-1 ? curDropIdx%document.all["DropHit"].length:curDropIdx;
  var temp = 'setInterval("DirectDown()",DirectTerm)';
  doDirect = eval(temp);
}
}
function DirectUp()
{
clearInterval(doDirect);
clearInterval(downLayerId);
var tempIdx = 0;
for(i = 0;i<document.all["DropHit"].length;i++){
  tempIdx = (document.all["DropHit"].length + curDropIdx - i) %document.all["DropHit"].length;
  document.all["DropHit"][tempIdx].style.posTop = i*document.all["DropHit"][tempIdx].style.posHeight;
}
var temp = 'setInterval("UpLayer()",20)';
downLayerId = eval(temp);
direction = "up";
}
function UpLayer()
{
var tempIdx = 0;
if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight && document.all["DropHit"][curDropIdx].style.posTop > document.all["DropHit"][curDropIdx].style.posHeight * (-1)){
  for(j = 0 ;j < document.all["DropHit"].length;j++){
   tempIdx = (document.all["DropHit"].length + curDropIdx - j) %document.all["DropHit"].length;
   document.all["DropHit"][tempIdx].style.posTop -= dropDegree;
  }
}else{
  clearInterval(downLayerId);
  for(j = 0;j<document.all["DropHit"].length;j++){
   tempIdx = (document.all["DropHit"].length + curDropIdx - j) % document.all["DropHit"].length;
   document.all["DropHit"][tempIdx].style.posTop = (j-1)*(document.all["DropHit"][tempIdx].style.posHeight);
  }
  curDropIdx = (curDropIdx - 1) ;
  curDropIdx = curDropIdx < 0 ? document.all["DropHit"].length-1:curDropIdx;
  var temp = 'setInterval("DirectUp()",DirectTerm)';
  doDirect = eval(temp);
}
}

//PopImage View Script
function SourceView(pa,pb,pc,CType) {
    x = screen.width ;
    y = screen.height ;
	window.open("http://www.agribrand.co.kr/bh_tmp/PhotoView.html?img="+pa+"&x="+x+"&y="+y+"&CType="+CType,"New","left=0, top=0, width="+pb+", height="+pc+", resizable=yes, scrollbars=yes");
}



function UrlLink(link) {
 
//alert(link);
if(link == "bh0100") {
     location.href='http://www.agribrand.co.kr/bh0100/bh0105/bha050100/bha050100.html';
  }
else if(link == "bh0101") {
     location.href='http://www.agribrand.co.kr/bh0100/bh0101/bha010100/bha010100.html';
  }
else if(link == "bh0102") {
     location.href='http://www.agribrand.co.kr/bh0100/bh0102/bha020100/bha020100.html';
  }
else if(link == "bh0103") {
     location.href='http://www.agribrand.co.kr/bh0100/bh0103/bha030100/bha030100.html';
  }
else if(link == "bh0104") {
     location.href='http://www.agribrand.co.kr/bh0100/bh0104/bha040100/bha040100.html';
  }
else if(link == "bh0105") {
     location.href='http://www.agribrand.co.kr/bh0100/bh0105/bha050100/bha050100.html';
  }

else if(link == "bh0200") {
     location.href='http://www.agribrand.co.kr/bh0200/bh0201/bhb010100/bhb010100.html';
  }
  else if(link == "bh0201") {
     location.href='http://www.agribrand.co.kr/bh0200/bh0201/bhb010100/bhb010100.html';
  }
  else if(link == "bh0202") {
     location.href='http://www.agribrand.co.kr/bh0200/bh0202/bhb020100/bhb020100.html';
  }
  else if(link == "bh0203") {
     location.href='http://www.agribrand.co.kr/bh0200/bh0203/bhb030100/bhb030100.html';
  }
  else if(link == "bh0204") {
     location.href='http://www.agribrand.co.kr/bh0200/bh0204/bhb040100/bhb040100.html';
  }
  else if(link == "bh0205") {
     location.href='http://www.agribrand.co.kr/bh0200/bh0205/bhb050100/bhb050100.html';
  }
  else if(link == "bh0300") {
     location.href='http://www.agribrand.co.kr/bh0300/bh0301/bh0301.html';
  }
  else if(link == "bh0301") {
     location.href='http://www.agribrand.co.kr/bh0300/bh0301/bh0301.html';
  }
  else if(link == "bh0302") {
     location.href='http://www.agribrand.co.kr/bh0300/bh0302/bh0302.html';
  }
  else if(link == "bh0400") {
     location.href='http://www.agribrand.co.kr/bh0400/bh0401/bhd010100/bhd010100.html';
  }
  else if(link == "bh0401") {
     location.href='http://www.agribrand.co.kr/bh0400/bh0401/bhd010100/bhd010100.html';
  }
  else if(link == "bh0402") {
     location.href='http://www.agribrand.co.kr/bh0400/bh0402/bh0402.html';
  }
  else if(link == "bh0403") {
     location.href='http://www.agribrand.co.kr/bh0400/bh0403/bh0403.html';
  }
  else if(link == "bh0404") {
     location.href='http://www.agribrand.co.kr/bh0400/bh0404/bh0404.html';
  }
  else if(link == "bh0500") {
     location.href='http://www.agribrand.co.kr/bh0500/bh0501/bh0501.html';
  }
  else if(link == "bh0501") {
     location.href='http://www.agribrand.co.kr/bh0500/bh0501/bh0501.html';
  }
  else if(link == "bh0502") {
     location.href='http://www.agribrand.co.kr/bh0500/bh0502/bh0502.html';
  }
  else if(link == "bh0503") {
     location.href='http://www.agribrand.co.kr/bh0500/bh0503/bh0503.html';
  }
  else if(link == "bh0504") {
     location.href='http://www.agribrand.co.kr/bh0500/bh0504/bh0504.html';
  }
  else if(link == "bh0505") {
     location.href='http://www.agribrand.co.kr/bh0600/bh0601/bh0601.html';
  }
   else if(link == "bh0600") {
     location.href='http://www.agribrand.co.kr/bh0600/bh0601/bh0601.html';
  }
   else if(link == "bh0601") {
     location.href='http://www.agribrand.co.kr/bh0600/bh0601/bh0601.html';
  }
}