function showVideo() {

}

function createMovieDiv(divName,divClass,mySource) {
if(document.getElementById('gallery')) {
removeDiv('gallery');
}
if(document.getElementById('libraryIF')) {
removeDiv('libraryIF');
}
var videoSource="EzuqK9o9iRs";
if(mySource!='') {
videoSource = mySource;
} 

if(document.getElementById(divName)) {
// alert("div already exists");
} else {
var officialVideo = '<div id="xDiv" name="xDiv" class="xDiv"><a href="javascript:removeDiv(\'video\');" class="divOff">';
officialVideo = officialVideo + '<img src="/assets/lytebox/close_white.png" class="closeDiv" alt="close"/></a><div>';
officialVideo = officialVideo + '<div class="bsesVideo">';
officialVideo = officialVideo + '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/EzuqK9o9iRs&hl=en&fs=1&"></param>';
officialVideo = officialVideo + '<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>';
officialVideo = officialVideo + '<embed src="http://www.youtube.com/v/' + videoSource + '&hl=en&fs=1&" type="application/x-shockwave-flash" ';
officialVideo = officialVideo + 'allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></div>';
        var divTag = document.createElement("div");
        divTag.id = divName;
        divTag.name = divName;
        divTag.className =divClass;
        divTag.innerHTML = officialVideo;
        document.body.appendChild(divTag);
}
}
function createImageDiv(divName,divClass,mySource) {
if(document.getElementById('video')) {
removeDiv('video');
}
if(document.getElementById('libraryIF')) {
removeDiv('libraryIF');
}
if(mySource=='') {
var theImageSet = "user_id=40432373@N02";
} else {
var theImageSet = "set_id=" + mySource;
}

if(document.getElementById(divName)) {
// alert("div already exists");
} else {
var officialGallery = '<div id="xDiv" name="xDiv" class="xDiv"><a href="javascript:removeDiv(\'gallery\');" class="divOff">';
officialGallery = officialGallery + '<img src="/assets/lytebox/close_white.png" class="closeDiv" alt="close"/></a><div>';
officialGallery = officialGallery + '<iframe align="center" src="http://www.flickr.com/slideShow/index.gne?' + theImageSet + '" width="500" height="500" frameBorder="0" scrolling="no">';
officialGallery = officialGallery + '</iframe><br />';
        var divTag = document.createElement("div");
        divTag.id = divName;
        divTag.name = divName;
        divTag.className =divClass;
        divTag.innerHTML = officialGallery;
        document.body.appendChild(divTag);
}
}

function createLibraryDiv(divName,divClass,mySource) {
if(document.getElementById('video')) {
removeDiv('video');
}
if(document.getElementById('gallery')) {
removeDiv('gallery');
}
if(mySource=='') {
var theLibrary = "expeditions";
} else {
var theLibrary = mySource;
}

if(document.getElementById(divName)) {
// alert("div already exists");
} else {
var officialGallery = '<div id="xDiv" name="xDiv" class="xDiv"><a href="javascript:removeDiv(\'' + divName + '\');" class="divOff">';
officialGallery = officialGallery + '<img src="/assets/lytebox/close_white.png" class="closeDiv" alt="close"/></a><div>';
officialGallery = officialGallery + '<iframe align="center" src="/assets/includes/mmLibrary.php?search=' + theLibrary + '" width="500" height="500" frameBorder="0" scrolling="no">';
officialGallery = officialGallery + '</iframe><br />';
        var divTag = document.createElement("div");
        divTag.id = divName;
        divTag.name = divName;
        divTag.className =divClass;
        divTag.innerHTML = officialGallery;
        document.body.appendChild(divTag);
}
}




function removeDiv(divName) {
if(document.getElementById(divName)) {
// alert("div already exists");
document.getElementById(divName).style.border = "1px solid red";
var myElement = document.getElementById(divName);
myElement.parentNode.removeChild(myElement);
} else {
// nothing to do
}
}
function removeElement(parentDiv, childDiv){
     if (childDiv == parentDiv) {
          alert("The parent div cannot be removed.");
     }
     else if (document.getElementById(childDiv)) {     
          var child = document.getElementById(childDiv);
          var parent = document.getElementById(parentDiv);
          parent.removeChild(child);
     }
     else {
          alert("Child div has already been removed or does not exist.");
          return false;
     }
}

function removeMyElement(divNum) {
  var d = document.getElementById('myDiv');
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}