
var nav_show = 0;
var current_tab = 0;

function show_topnav(set_id, tab) {
	nav_show = set_id;
	
	if (tab)
		current_tab = tab;
	
	if (tab) {
		jQuery('#popup-menu').html(jQuery('#' + tab).html());
	}
	
	jQuery('#popup-menu').show();
	jQuery('#blinder').show();
	
	jQuery('.main-menu td').removeClass('nav_highlight');
	
	if (current_tab)
		jQuery('#nav_' + current_tab).addClass('nav_highlight');
}

function hide_topnav(check) {
	if (check && nav_show) {
		return;
	}
	
	jQuery('#popup-menu').hide();
	jQuery('#blinder').hide();
	jQuery('.main-menu td').removeClass('nav_highlight');
}

function page_reload() {
	window.location.reload();
}

function url_redirect(url) {
	window.location = url;	
}

function display_video(guid, w, h) {
	jQuery('#blinder').show();
	jQuery('#overlay').show();
	
	var vid = '';
	
	if (!navigator.plugins || !navigator.mimeTypes.length || navigator.mimeTypes["application/x-shockwave-flash"]) {
		vid = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + w + '" height="' + h + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://hd.pelopidas.com/wp-content/plugins/video/flvplayer.swf?guid=' + guid + '&amp;autoplay=yes&amp;video_info_path=http://hd.pelopidas.com/wp-content/plugins/video/video-xml.php" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="' + w + '" height="' + h + '" src="http://hd.pelopidas.com/wp-content/plugins/video/flvplayer.swf?guid=' + guid + '&amp;autoplay=yes&amp;video_info_path=http://hd.pelopidas.com/wp-content/plugins/video/video-xml.php" allowfullscreen="true"></embed></object>';
	} else {
		vid = '<video width="' + w + '" height="' + h + '" controls autoplay>'
		vid += '<source src="http://hd.pelopidas.com/html5_video/' + guid + '" type="video/ogg"></source>';
		vid += '</video>';
	}
	
	var main_html = vid + '<br /><br /><br /><div style="color: #ffffff; font-weight: bold;">click here to close</div>';
	var html = '<div style="width: 100%; margin: 30px; padding-top: 30px; text-align: center;">' + main_html + '</div>';
		
	jQuery('#overlay').html(html);
}

function hide_all() {
	jQuery('#blinder').hide(); 
	jQuery('#overlay').hide();
	jQuery('#overlay').html('');
}
