jQuery(document).ready(function($){

// navigation
	$("#dropmenu li:has(ul)").addClass("hasChild");
	$("#dropmenu li a").wrap("<span></span>");

// horizontal menu drop-down
	$("#dropmenu ul").css({display: "none"}); // Opera Fix 
	$("#dropmenu li").hover(function(){ 
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
			},function(){ 
			$(this).find('ul:first').css({visibility: "hidden"}); 
			}); 

// check op i-frame
	$('body.page:has(iframe)').addClass('i-frame');
	$('body.iframe').find('iframe.mailiframe').removeClass('i-frame');

	
// thickbox gallery
	$('.gallery .gallery-icon a').addClass('thickbox');
	$('a.thickbox').attr('rel','gallery-thickbox');

// move bad behaviors
	$('#footer p.bad-behavior').appendTo('#footer .block-small.users .wrapper');

// autoscale height iframe (http://sonspring.com/journal/jquery-iframe-sizing)
	$('iframe').load(function() {
			this.style.height =
			this.contentWindow.document.body.offsetHeight + 'px';
		}
	);
	// Start timer when loaded
	$('iframe').load(function() {
			setTimeout(iResize, 0);
		}
	);
	// Safari and Opera need a kick-start
	for (var i = 0, j = iFrames.length; i < j; i++) {
		var iSource = iFrames[i].src;
		iFrames[i].src = '';
		iFrames[i].src = iSource;
	}


// end
});
