﻿// Move an element directly on top of another element (and optionally
// make it the same size)
function Cover(bottom, top, ignoreSize) {
    var location = Sys.UI.DomElement.getLocation(bottom);
    top.style.position = 'absolute';
    top.style.top = location.y + 'px';
    top.style.left = location.x + 'px';
    if (!ignoreSize) {
        top.style.height = bottom.offsetHeight + 'px';
        top.style.width = bottom.offsetWidth + 'px';
    }
}

function LinkColor(selLink, selColor) {
    selLink.style.color = selColor;
}

function Hide(item) {
//    var selItem = Sys.UI.DomElement.getElementById('+item+', document);
    //    selItem.visible = false;

    item.style.display = "none";

}

function OpenProjectPopUp(page) {
    OpenWin(page, "popUp", 550, 400, 0, 1, 200, 200);
}

function OpenWin(page, winName, w, h, scroll, resize, left, top) {
    winOpen = window.open(page, winName, 'width=' + w + ',height=' + h + ',scrollbars=' + scroll + ',resizable=' + resize + ',left=' + left + ',top=' + top + '');
    winOpen.focus();

    return;
}

function showModalPopupViaClient(location, ext) {
    // ev.preventDefault();

    if (location.toString().length < 5) {
        return false;
    }
    var modalPopupBehavior = $find('programmaticModalPopupBehavior');
 
    width = 500;
    height = 350;
   
    var mediaShow = "";

    if (ext == "swf") {
      mediaShow = '<object id="flash1" data="'+location+'" height="'+height+'" type="application/x-shockwave-flash" width="'+width+'">   <param name="movie" value="'+ location +'">    </object>';
   }
   else {
       mediaShow = " <img alt=\"\" src="+location+" />";
   }
   document.getElementById('divLocation').innerHTML = mediaShow;
  
    modalPopupBehavior.show();
}

function hideModalPopupViaClient(ev) {
  //  ev.preventDefault();
    var modalPopupBehavior = $find('programmaticModalPopupBehavior');
    modalPopupBehavior.hide();
}
