


// JavaScript Document

function checkImages() {
	var tHolder = document.getElementById('tapeHolder');
	//alert(document.getElementById('rightColumn').getElementsByTagName('img').length);	
	var imgs = document.getElementById('rightContent').getElementsByTagName('img');
	var t = "";
	
	//alert(t);
	for (var i = 0; i < imgs.length; i++){
		if(imgs[i].width >= 100 && imgs[i].height >= 75){
			var imgid = '';
			if(imgs[i].id.length == 0)
				imgs[i].id = 'rcimg_' + i;
			var th = document.createElement('DIV');
			th.style.position = 'relative';
			var info = Position.get(imgs[i]);
			th.style.width = info.width;
			th.style.left = info.left; //info.left  /findPosX(imgs[i].parentNode)
			th.style.right = info.top; //info.right /findPosY(imgs[i].parentNode)
			
			th.style.display = 'block';
			/*if(imgs[i].align == 'right') {
				th.style.width = imgs[i].width + 'px';
				th.style.styleFloat = 'right';
				th.style.cssFloat = 'right';
			}*/
			imgs[i].parentNode.insertBefore(th,imgs[i]);
			th.parentNode.style.position = 'relative';
			th.parentNode.style.backgroundColor = '#363636';
			var tl = document.createElement('DIV');
			tl.className = 'tapeLeft pngFix';
			tl.style.position = 'absolute';
			tl.style.top = ((imgs[i].height) - 30) + 'px';
			tl.style.left = (-15) + 'px';
			tl.innerHTML = '';
			//tl.style.float = imgs[i].style.float;
			th.appendChild(tl);
	
			var tr = document.createElement('DIV');
			tr.className='tapeRight pngFix';
			tr.style.position= 'absolute';
			tr.style.top = (-12) + 'px';
			tr.style.left = ((parseInt(imgs[i].width)) -35) + 'px';
			tr.innerHTML = '';
			//tr.style.float = imgs[i].style.float;
			th.appendChild(tr);
	//		imgs[i].parentNode.insertBefore(tr,imgs[i]);
	//		alert(imgs[i].parentNode.innerHTML);
		}
	}
}

/*for (var i = 0; i < imgs.length; i++){
		if(imgs[i].width >= 100 && imgs[i].height >= 75){
			var imgid = '';
			if(imgs[i].id.length == 0)
				imgs[i].id = 'rcimg_' + i;
			var th = document.createElement('DIV');
			th.style.position = 'relative';
			th.style.display = 'block';
			if(imgs[i].align == 'right') {
				th.style.width = imgs[i].width + 'px';
				th.style.styleFloat = 'right';
				th.style.cssFloat = 'right';
			}
			imgs[i].parentNode.insertBefore(th,imgs[i]);
			var tl = document.createElement('DIV');
			tl.className = 'tapeLeft pngFix';
			tl.style.position = 'absolute';
			tl.style.top = ((imgs[i].height) - 30) + 'px';
			tl.style.left = (-15) + 'px';
			tl.innerHTML = '';
			//tl.style.float = imgs[i].style.float;
			th.appendChild(tl);
	
			var tr = document.createElement('DIV');
			tr.className='tapeRight pngFix';
			tr.style.position= 'absolute';
			tr.style.top = (-12) + 'px';
			tr.style.left = ((parseInt(imgs[i].width)) -35) + 'px';
			tr.innerHTML = '';
			//tr.style.float = imgs[i].style.float;
			th.appendChild(tr);
	//		imgs[i].parentNode.insertBefore(tr,imgs[i]);
	//		alert(imgs[i].parentNode.innerHTML);
		}
	}*/

//Position.cumulativeOffset


function pOffset(inputElement) {
    var coords =  new Object();
    coords.x = 0;
    coords.y = 0;
    try {
        targetElement = inputElement;
        if(targetElement.x && targetElement.y) {
            coords.x = targetElement.x;
            coords.y = targetElement.y;
        } else {
            if(targetElement.offsetParent) {
                coords.x += targetElement.offsetLeft;
                coords.y += targetElement.offsetTop;
                while(targetElement = targetElement.offsetParent) {
                    coords.x += targetElement.offsetLeft;
                    coords.y += targetElement.offsetTop;
                }
            } else {
                //alert("Could not find any reference for coordinate positioning.");
            }
        }
        return coords;
    } catch(error) {
        //alert(error.msg);
        return coords;
    }
}


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;
  }







