var box;
var sg_box;
var nbox;
window.addEvent('domready', function() {
	if(exists('#mapThing')){
		hideFlashBG()
	}
	//popup
	if ($$('.mb')){	
		box = new MultiBox('mb', {descClassName: 'multiBoxDesc'});
		$$('.mb').each(function(el, i) { 
			if(el.hasClass('autopop')){
				if(Cookie.read("popSession") != 'set'){
					Cookie.write('popSession', 'set');
					box.open(el);
				}				
			} 
		});
	}
	
/*
	if(exists('.socialgubbins')){
		$$('.socialgubbins a').each(function(el,i){
			el.htxt = new Element('div').injectBefore(el).addClass('htxt').set('text', el.getAttribute('title'))
			el.addEvents({
				'mouseenter': function(){
					this.htxt.setStyle('display', 'block')
				},
				'mouseleave': function(){
					this.htxt.setStyle('display', 'none')
				}
			});
			
		});
	}
*/
	if(exists('.embed_vid')){
		nbox = new MultiBox('vmb');
		$$('.vmb').each(function(el, i) { 
			if(el.hasClass('autopop')){
				if(Cookie.read("popSession") != 'set'){
					Cookie.write('popSession', 'set');
					box.open(el);
				}				
			} 
		});
	}
	
});


function hideFlashBG(){
$('hp_flash').setStyle('background', 'none')
}

function exists(a){return ($$(a).length>0)?true:false;}
