
var highlightActive = 1;
var highlightTimeout = 0;
function highlight_show(id, loop) {
	
	if (jQuery('#box_highlights #highlight_' + id).length == 0) id = 1;
	
	jQuery('#box_highlights .highlight').fadeOut(500);
	jQuery('#box_highlights #highlight_' + id).fadeIn(500);
	
	jQuery('#highlight_chooser a').removeClass('active');
	jQuery('#highlight_chooser #highlight_choose_' + id).addClass('active');
	
	if (highlightTimeout) {
		window.clearTimeout(highlightTimeout);
	}
	
	if (loop) {
		highlightTimeout = window.setTimeout(function () {highlight_show(id+1, true);}, 5000);
	}
	
}


var Opener = {
	
	queryFieldInit : function(field, text) {
		field.message = text;
		if (field.value == '') {
			field.value = text;
			jQuery(field).addClass('empty');
			jQuery(field).focus(
				function() {
					if (field.value == text) {
						field.value = '';
						jQuery(field).removeClass('empty');
					}
				}
			);
			jQuery(field).blur(
				function() {
					if (field.value == '') {
						field.value = text;
						jQuery(field).addClass('empty');
					}
				}
			);
		}
	},
	
	checkFrameset : function() {
		//alert(document.location.pathname);
		//alert(self == parent);
		if (self == parent) {
			var html = '<frameset rows="100%, 0" border="0" frameborder="no"><frame src="'+(document.location.pathname)+'?player" /><frame src="/page/opener/player_frame.html" /></frameset>';
			
			document.open();
			document.write(html);
			document.close();
			//jQuery('head').after(html);
			//alert(jQuery('head'))
		}
	}
	
};