
var actFrame = '';
var closeIda = '';
var isInter = 0;
var doBool = false;
var doOnce = false;
var openLBLink;
var openLBId;
function openLightBox(obj, cid, parm, literal, lURL){	
	

    //GLOBAL var 
    if(gloOpenPopup == 1 || !Lightbox){ obj.returnValue = true; return true; }
    if (literal == 1){
	var link = obj+'&js=1';
    }
    else if (typeof(lURL) != 'undefined' && lURL != '') link = lURL + '?js=1';
    else {
    	if (obj.href.indexOf('type=') > -1) {
		var linkArr = obj.href.split('type=');
		if (parm == 1) {
			var link = linkArr[0]+'&js=1';
		}
		else{
		    var link = linkArr[0]+'type=3&js=1';
		}
	} else var link = obj.href;
    }
    
    $$('embed').each(function(row){ row.style.visibility = "hidden"; });
    $$('body').each(function(row){ row.style.overflow = "hidden"; row.scroll = "no"; });
    $$('html').each(function(row){ row.style.overflow = "hidden"; row.scroll = "no"; });
    
    doBool = false;
    var screenHeight = document.documentElement.clientHeight - 100;

    if (screenHeight < 100) {
	if(screen.height > 768){
    		var screenHeight = 660;
    	}else{
        	var screenHeight = 400;
    	}
    }
    
    Lightbox.init({defaultIframeHeight: screenHeight, defaultIframeWidth: '745'});

    Lightbox.show(link, '', 'lbox');
    if (literal != 1){
    	if(obj.id) openLBId = obj.id;
	else{ obj.id = openLBId = 'openLBId'; }
    	openLBLink = obj.href; 
    	obj.href = 'javascript: void(0);';
    	obj.returnValue = false;
    	return false;
    }
}

function addInfoIntoParent(objId){
    //Check for iframe
    if(window.location != window.parent.location){
        if(window.parent){
            var pW = window.parent.document;
            var newInnerHTML = document.getElementById(objId).innerHTML + "";
            pW.getElementById('spanInside').setHTML(newInnerHTML);
            var ch = pW.getElementById('spanInside').childNodes;
            var bodyOfIframe = window.document.getElementsByTagName('body')[0];
            bodyOfIframe.className = "lbBody";
            for(i=0; i < ch.length; i++){
                if(ch[i].tagName == 'A' || ch[i].tagName == 'a'){

                    if(navigator.userAgent.indexOf("MSIE") != -1){
                        window.parent.document.frames[0].name = "lbFrame";//+new Date().getTime();
                        window.parent.document.frames[0].id = "lbFrame"//+new Date().getTime();
                    }
                    
                    ch[i].target = window.name;
                    var deURI = ch[i].href;
                    if(deURI.indexOf("tipUrl") != -1){
                        var newDeURI = deURI.replace('&js=1', '').replace('tipUrl', 'type=5&js=1&tipUrl');
                        ch[i].href = newDeURI;
                    }
                }    
            }
        }
    }
}

