     function ImageLoaded(section) {
              document.getElementById(section+"_loading").style.display = 'none';
     }

     function ShowImage(section) {
              document.getElementById("hdn_frame").src = "actions.php?action=show_image&section="+section;
     }
     
     function CloseImage() {
              var pageBlocker = document.getElementById("page_blocker");
              pageBlocker.style.display = 'none';
     }
     
     function NavigateToPicture(id,section) {
              if (section == "3d") {
                 document.getElementById("3d_loading").style.display = 'block';
                 for (var i = 0; i < items_3d.length; i++) {
                     if (parseInt(items_3d[i]) == parseInt(id)) {
                        current_items_3d = i;
                     }
                 }
                 document.getElementById("hdn_frame").src = "actions.php?action=3d_load&id="+id+"&sub_action=show_image&section="+section;
              }else if (section == "2d") {
                      document.getElementById("2d_loading").style.display = 'block';
                      for (var i = 0; i < items_2d.length; i++) {
                          if (parseInt(items_2d[i]) == parseInt(id)) {
                             current_items_2d = i;
                          }
                      }
                      document.getElementById("hdn_frame").src = "actions.php?action=2d_load&id="+id+"&sub_action=show_image&section="+section;
              }
     }

        function NavigatePictures(direction,section) {
                 if (section == "2d") {
                   document.getElementById("2d_loading").style.display = 'block';
                   // direction is "fw" or "bk"
                   if (direction == "fw") {
                      if ((parseInt(current_items_2d)+1) > (parseInt(items_2d.length)-1)) {
                         current_items_2d = 0;
                      }else{
                         current_items_2d = (parseInt(current_items_2d)+1);
                      }
                   }else{
                      if ((parseInt(current_items_2d)-1) < 0) {
                         current_items_2d = (parseInt(items_2d.length)-1);
                      }else{
                         current_items_2d = (parseInt(current_items_2d)-1);
                      }
                   }
                   document.getElementById("hdn_frame").src = "actions.php?action=2d_load&id="+items_2d[current_items_2d];
                 }else if (section == "3d") {
                   document.getElementById("3d_loading").style.display = 'block';
                   // direction is "fw" or "bk"
                   if (direction == "fw") {
                      if ((parseInt(current_items_3d)+1) > (parseInt(items_3d.length)-1)) {
                         current_items_3d = 0;
                      }else{
                         current_items_3d = (parseInt(current_items_3d)+1);
                      }
                   }else{
                      if ((parseInt(current_items_3d)-1) < 0) {
                         current_items_3d = (parseInt(items_3d.length)-1);
                      }else{
                         current_items_3d = (parseInt(current_items_3d)-1);
                      }
                   }
                   document.getElementById("hdn_frame").src = "actions.php?action=3d_load&id="+items_3d[current_items_3d];
                 }
        }

        function DoScroll(direction,section) {
                 var myDiv = document.getElementById("image_container_"+section);
                 var divWidth = parseInt(myDiv.offsetWidth);
                 var maxmove = 722;
                 if (divWidth > 722) {
                    maxmove = divWidth-722;
                 }
                 if (direction == "left") {
                    easeMoving(myDiv,-395,maxmove)
                 }else{
                    easeMoving(myDiv,395,maxmove)
                 }
        }
        
	function fnSelect(objId) {
		fnDeSelect();
		if (document.selection) {
		var range = document.body.createTextRange();
 	        range.moveToElementText(document.getElementById(objId));
		range.select();
		}
		else if (window.getSelection) {
		var range = document.createRange();
		range.selectNode(document.getElementById(objId));
		window.getSelection().addRange(range);
		}
	}

	function fnDeSelect() {
		if (document.selection) document.selection.empty();
		else if (window.getSelection)
                window.getSelection().removeAllRanges();
	}        
