﻿// JScript File
//function hideBox(div)
//{ 
//    setTimeout("reallyHideBox('" + div + "');", 500);
//}
//    function reallyHideBox(div) 
//{  
//   divObj = document.getElementById(div); 
//   divObj.style.visibility = 'hidden';
//}
//var popupTimerHandle = null;
//function showBox(div) 
//{   
//if (popupTimerHandle != null)
//{     
//     clearTimeout(popupTimerHandle);  
//     popupTimerHandle = null;  
//}   
//     divObj = document.getElementById(div);
//     divObj.style.visibility = 'visible';
//}
//function hideBox(div)
//{   
//     popupTimerHandle = setTimeout("reallyHideBox('" + div + "');", 500);
//}

function findPos(obj)
{
var curleft = curtop = 0;
if (obj.offsetParent)
{
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent)
{
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop + 23];
}
//Display a named menu, at the position of another object
function showBox(buttonname, divname) 
{
//get the named menu
var menu_element = document.getElementById(divname);
//override the 'display:none;' style attribute
//menu_element.style.display = "";
//get the placement of the element that invoked the menu...
var placement = findPos(buttonname);
//...and put the menu there
menu_element.style.left = placement[0] + "px";
menu_element.style.top = placement[1] + "px";
menu_element.style.visibility = 'visible';
}

function hideBox(div)
{ 
   divObj = document.getElementById(div); 
   divObj.style.visibility = 'hidden';
}

//function showBox(buttonname, divname) 
//{   
////    pos_x = document.mouse.xevent.offsetX?(event.offsetX):event.pageX-document.getElementById(buttonname).offsetLeft;
////    pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById(buttonname).offsetTop;
////    document.getElementById(div).style.left = (pos_x-1) ;
////    document.getElementById(div).style.top = (pos_y-15) ;
////    document.getElementById(div).style.visibility = "visible" ;
////    document.pointform.form_x.value = pos_x;
////    document.pointform.form_y.value = pos_y;
//alert('hi');
//thebutton = document.getElementById(buttonname);
////alert(thebutton.);
//    divObj = document.getElementById(divname);
//    divObj.style.visibility = 'visible';
////document.getElementById(buttonname).style.top = getBodyScrolltop()+(getClientHeight()/4); 
////document.getElementById('fishingmenu').style.top = getBodyScrolltop()+(getClientHeight()/4); 

//}

//function point_it(event)
//{
//    pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("pointer_div").offsetLeft;
//    pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("pointer_div").offsetTop;
//    document.getElementById("cross").style.left = (pos_x-1) ;
//    document.getElementById("cross").style.top = (pos_y-15) ;
//    document.getElementById("cross").style.visibility = "visible" ;
//    document.pointform.form_x.value = pos_x;
//    document.pointform.form_y.value = pos_y;
//}

function displayIframe(src)
{
divObj = document.getElementById('iFrame1');
divObj.style.visibility = 'visible';
divObj.style.display = 'block';
parent.iFrame1.location = src;
   
}


//function getClientCenterX() { 
//return parseInt(getClientWidth()/2)+getBodyScrollLeft(); 
//} 

//function getClientCenterY() { 
//return parseInt(getClientHeight()/2)+getBodyScrolltop(); 
//} 
//function getClientWidth() { 
//return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth; 
//} 

//function getClientHeight() { 
//return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; 
//} 

//function getBodyScrolltop() { 
//return self.pageYOffset ¦¦ (document.documentElement && document.documentElement.scrolltop) ¦¦ (document.body && document.body.scrolltop); 
//115} 

//function getBodyScrollLeft() { 
//return self.pageXOffset ¦¦ (document.documentElement && document.documentElement.scrollLeft) ¦¦ (document.body && document.body.scrollLeft); 
//} 

//function hidden(id) { 
//document.getElementById('price').value = ''; 
//document.getElementById('info').innerHTML = ''; 
//document.getElementById(id).style.display = 'none'; 
//document.getElementById('iframe').style.display = 'none'; 
//} 

//function showpopup(id,tml_id) { 
//template_id = tml_id; 
//document.getElementById(id).style.top = getBodyScrolltop()+(getClientHeight()/4); 
//document.getElementById('fishingmenu').style.top = getBodyScrolltop()+(getClientHeight()/4); 
//document.getElementById('fishingmenu').style.visibility = 'visible'; 
//document.getElementById(id).style.visibility = 'visible'; 
////document.getElementById('price').focus(); 
//} 

function showDiv(divname)
{
    divObj = document.getElementById(divname);
    divObj.style.display = 'block';
    divObj.style.visibility = 'visible';

}

function showBaitShopDiv(divname)
{
    hideAllDivs();
    divObj = document.getElementById(divname);
    if (divObj != null)
    {
    divObj.style.display = 'block';
    divObj.style.visibility = 'visible';
    }

}

function hideAllDivs()
{
    var divArray = document.getElementsByTagName("div");
    for (var i = 0; i < divArray.length; i++)
    {
     divArray[i].style.display = 'none';
     divArray[i].style.visibility = 'hidden';
    }
}