﻿$create = function(tag) { return document.createElement(tag);}
$tagname = function(ids) { return document.getElementsByTagName(ids);}
$id = function(ids) { return document.getElementById(ids);}


function getPath() {
    var paths = location.pathname;
    var arrp = paths.split("/");
    var lensp = arrp.length - 1;
    if (location.host.indexOf('localhost') > -1)
    { lensp--; }
    var str = "";
    for (var ips = 1; ips < lensp; ips++)
    { str += "../"; }

    return str;
//    str += "calendar/";
//    pathToImages = str
}


var bod = $tagname("body") ;
var divBody = $create('div');
var divOver = $create('div');
var _icopath = getPath() + "Images/" 
var gTabbableTags = new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");	


//-----------------------------------------
HideDiv = function() {
    // displaySelectBoxes(); 
    divBody.style.display = 'none';
    divOver.style.display = 'none';
    divOver.innerHTML = "";
    // bod[0].style.overflow = "";
}
//-----------------------------------------

ShowEnlarge = function(files) {   //var img = $id(Id) ;
    var ypos = 250 + 15;

    //var imgtitle = $id("ImgTitle").innerHTML ;

    divBody.id = "BodyOverLay";
    divBody.style.display = "block";
    divBody.onclick = function() { HideDiv(); }

    //alert(divBody.id) ;
    hsp = (ypos - 40) / 2;
    divOver.id = "DivOverLayer";
    divOver.style.display = "block";

    divOver.innerHTML = "<br><br><img src='" + _icopath + "loading.gif' hspace='" + hsp + "' vspace='70' /><br><br>"
    divOver.style.left = (screen.width - (ypos + 10)) / 2 + 'px';
    divOver.style.top = 70 + 'px';
    divOver.style.width = ypos + "px";
    files = files.replace("../..", "").replace("/", "") //.replace(findstring,newstring)

//    divOver.innerHTML = '<div id="divClose"><img src="' + _icopath + 'closelabel.gif" onclick="HideDiv();" /></div>' +
    //                        '<iframe src="' + getPath() + 'Play_movie.aspx?files=' + files + '" width="220" height="240" scrolling="no" align="top" frameborder="0" style="border:0px;" />';
    divOver.innerHTML = '<div id="divClose"><img src="' + _icopath + 'closelabel.gif" onclick="HideDiv();" /></div>' +
                        '<div><br /></div><embed src="' + getPath() + 'movies/' + files + '" width="220" height="220"> </embed><div><br /></div>';

    bod[0].appendChild(divBody);
    bod[0].appendChild(divOver);

}

//-------------------------------
