';
for(var i=0; i < len; i++) {
htmlStr += '

';
}
htmlStr += '
';
contentDiv.innerHTML = htmlStr;
var thisSlider = new bumbleSlider(thisContainer, width, height, 2000, 2000, offSet, 1, 'slide', 1);
}
function embedCourseExam(examModrw, divId) {
updateDiv(divId,'','page_type=course_exam&exam_modrw=' + examModrw,'html',1);
}
function proceedCourseAnswer(obj, attemptId, examModrw, questionKey, answerKey, validateBool) {
var parentId = obj.parentNode.id;
var validateQS = validateBool == 1 ? '&validate=1&answer_key=' + answerKey + '&question_key=' + questionKey: '';
updateDiv(parentId,'','page_type=course_exam&attempt_id=' + attemptId + '&exam_modrw=' + examModrw + validateQS,'html',0);
}
function addslashes(str) {
str=str.replace(/\\/g,'\\\\');
str=str.replace(/\'/g,'\\\'');
str=str.replace(/\"/g,'\\"');
str=str.replace(/\0/g,'\\0');
return str;
}
function stripslashes(str) {
str=str.replace(/\\'/g,'\'');
str=str.replace(/\\"/g,'"');
str=str.replace(/\\0/g,'\0');
str=str.replace(/\\\\/g,'\\');
return str;
}
function findPosX(obj)
{
var curleft = 0;
if(obj.offsetParent)
while(1)
{
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if(obj.offsetParent)
while(1)
{
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.y)
curtop += obj.y;
return curtop;
}
function getStats() {
var screenres;
var screencolor;
var flashvn;
var browser;
var browservn;
var os;
if (screen.width) screenres=screen.width+" x "+screen.height;
else screenres="Unknown";
if (screen.colorDepth) screencolor=screen.colorDepth;
else screencolor="Unknown";
browser='';
browservn='';
alert("Screen res: "+screenres+", "+screencolor+" bit\nBrowser: "+browser+" "+browservn);
}
function listCategoryTree(type, containerId, parentId, divPrefix) {
if (!divPrefix) var divPrefix = containerId;
updateDiv(containerId,'','page_type=output_categories&parent_id=' + parentId + '&type=' + type + '&container_id=' + containerId + '&div_prefix=' + divPrefix,'html',0,'');
}
function swapGalImg(parentDiv, imgFile) {
var containerDiv = document.getElementById(parentDiv);
if (containerDiv != null) {
// get width and height
var largeWidth = containerDiv.clientWidth;
var largeHeight = containerDiv.clientHeight;
var largeImgFile = '/?page_type=show_image&img=' + imgFile + '&w=' + largeWidth + '&h=' + largeHeight + '&canvas=crop';
var fullImgFile = '/library/images/' + imgFile;
// make sure container is positioned relatively
containerDiv.style.position = 'relative';
containerDiv.style.overflow = 'hidden';
// loop elements to find image
var oChild = containerDiv.firstChild;
if (oChild) {
while(oChild) {
if ((oChild.tagName == 'img' || oChild.tagName == 'IMG') && oldImg == null) {
var oldImg = oChild;
}
else {
oChild.parentNode.removeChild(oChild);
}
oChild = oChild.nextSibling;
}
}
// if old image exists
if (oldImg != null) {
// position top left
oldImg.style.position = 'absolute';
oldImg.style.top = 0;
oldImg.style.left = 0;
oldImg.style.zIndex = 10;
}
// create new element and position top left, zindex 0
var newImg = document.createElement("img");
newImg.src = largeImgFile;
newImg.style.position = 'relative';
newImg.style.zIndex = 0;
newImg.style.top = 0;
newImg.style.left = 0;
newImg.style.cursor = 'pointer';
newImg.onclick = function() { manualiBox(fullImgFile) }
containerDiv.appendChild(newImg);
// fade out old one, callback destroy
if (oldImg != null) {
var fadeOut = new bumbleTransitionObj(oldImg, 'opacity', 100, 0, '', 500, 'cos', '', 'if (this.obj.parentNode != null) this.obj.parentNode.removeChild(this.obj)', 100);
}
// new img onclick = ibox
}
}