// check through URL pattern, if lightbox is open 
function checkUrlForExtLightbox(extLightboxQueryParam) {

	var lightboxActive = false;
	
    // check query string for predefined variables
    $A(extLightboxQueryParam).each(function(name){

        // create regex for matching lightbox URLs 
        var re1 = new RegExp('^(.+)\\.(htm|html|php)(\\?)' + name + '=\\/(.+)\\.(htm|html|php)$');
        var re2 = new RegExp('^(.+)(\\/)(\\?)' + name + '=\\/(.+)\\.(htm|html|php)$');

        // test URL
    	if (re1.test(window.location.href) || re2.test(window.location.href)) {
    		lightboxActive = true;
    		throw $break;
    	}
	});
	
	return lightboxActive;
}

// track background page
function trackExtLightboxBackgroundPage() {
	if(s){
		var s_code=s.t();if(s_code)document.write(s_code);
	}
	return true;
}