var currentid;
function popup_show(tag_id){
var divX, divY
coords = Position.cumulativeOffset($(tag_id + '_pos'));
divX = coords[0];
divY = coords[1];
$(tag_id).style.left = divX - 1;
$(tag_id).style.top = divY + 11;
Element.show(tag_id);
}
function popup_hide(tag_id){
Element.hide(tag_id);
}
function image_popup_show(tag_id){
if(tag_id!=currentid){
$('image_popup_'+ tag_id).innerHTML='
';
//alert('
');
Element.show('image_popup_'+ tag_id);
currentid=tag_id;
} else {
Element.hide('image_popup_'+ tag_id);
currentid='';
}
}
function image_popup_hide(tag_id){
Element.hide('image_popup_'+ tag_id);
currentid='';
}
function select_box_hide_all(){
var selectControls=document.getElementsByTagName("select");
for (var i=0; i < selectControls.length; i++) {
selectControls[i].style.visibility='hidden';
}
}
function select_box_show_all(){
var selectControls=document.getElementsByTagName("select");
for (var i=0; i < selectControls.length; i++) {
selectControls[i].style.visibility='visible';
}
}
function select_box_hide_overlaping(x,y,width,height) {
var right=x+width-1;
var bottom=y+height-1;
var selectControls=document.getElementsByTagName("select");
for (var i=0; i < selectControls.length; i++) {
var sx=selectControls[i].offsetLeft;
var sy=selectControls[i].offsetTop;
// sx and sy are relative to parent. Compute absolute values
var parent=selectControls[i].offsetParent;
do {
sx += parent.offsetLeft;
sy += parent.offsetTop;
} while ( parent = parent.offsetParent );
var sRight=sx+selectControls[i].offsetWidth-1;
var sBottom=sy+selectControls[i].offsetHeight-1;
if (bottom >= sy && (x >= sx && x <= sRight || right >= sx && right <= sRight)) {
selectControls[i].style.visibility='hidden';
}
}
}
// Define a function to show/hide the select controls
// that overlap with the menu
// Parameters:
// actions: may be 'hide' of 'show'
// x: the x position of the menu
// y: the y position of the menu
// width: the width of the menu
// height: the height of the menu
function showHideSelectControls(action,x,y,width,height) {
var right=x+width-1;
var bottom=y+height-1;
var selectControls=document.getElementsByTagName("select");
for (var i=0; i < selectControls.length; i++) {
if (action=='hide') {
var sx=selectControls[i].offsetLeft;
var sy=selectControls[i].offsetTop;
// sx and sy are relative to parent. Compute absolute values
var parent=selectControls[i].offsetParent;
do {
sx += parent.offsetLeft;
sy += parent.offsetTop;
} while ( parent = parent.offsetParent );
var sRight=sx+selectControls[i].offsetWidth-1;
var sBottom=sy+selectControls[i].offsetHeight-1;
if (bottom >= sy && (x >= sx && x <= sRight || right >= sx && right <= sRight)) {
selectControls[i].style.visibility='hidden';
}
} else {
selectControls[i].style.visibility='visible';
}
}
}