function swapin(id) {
	document.getElementById(id).src = 'images/' + id + '_new_r.gif'
}
function swapout(link,id) {
	if ( location != link && link != location + 'index.php' ) {
		document.getElementById(id).src = 'images/' + id + '_new_n.gif'
	}
}
function show_videos(id) {
	document.getElementById('featuredtab').className = 'inactivetab'
	document.getElementById('topratedtab').className = 'inactivetab'
	document.getElementById('mostviewedtab').className = 'inactivetab'
	tabid = id + 'tab'
	document.getElementById(tabid).className = 'activetab'
	document.getElementById('featured').style.display = 'none'
	document.getElementById('toprated').style.display = 'none'
	document.getElementById('mostviewed').style.display = 'none'
	document.getElementById(id).style.display = 'block'
}
function reload_player(id,value) {
	if ( document.all ) {
		var html = '<div class="flash">'
		if ( value ) {
			html += '<br /><br />Please wait for flash to load...'
			html += '<object width="100%" height="100%" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0">'
			html += '<param name="movie" value="'+value+'" />'
			if ( value.search(/uploader/i) >= 0 ) {
				html += '<param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" />'
			} else {
				html += '<param name="allowFullScreen" value="true" />'
			}
			html += '<br /><br /><a href="http://www.adobe.com/go/getflashplayer">Your browser was unable to load flash player. Please click here to download it.</a>'
			html += '</object>'
		}
		html += '</div>'
	} else {
		var html = '<object type="application/x-shockwave-flash" width="100%" height="100%" data="'+value+'">'
		if ( value.search(/uploader/i) >= 0 ) {
			html += '<param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" />'
		} else {
			html += '<param name="allowFullScreen" value="true" />'
		}
		html += '</object>'
	}
	document.getElementById(id).innerHTML = html
}
function uploader(form,query) {
	if ( document.getElementById('terms').checked && document.getElementById('title').value && document.getElementById('file').value ) {
		form.action = form.action + '&js=1'
		form.target='upload'
		form.style.display='none'
		document.getElementById('progressbardiv').style.display='block'
		document.getElementById('status').src='/cgi-bin/status.cgi?'+query
		document.getElementById('statusdiv').innerHTML='Getting Status...Please wait...'
		return
	}
	alert('You must submit a valid file, give it a title, and agree to the Terms and Conditions.')
	return false
}
window.onload = function() {
	var elements = document.getElementsByTagName('noscript')
	var array = new Array()
	for ( i = 0; i < elements.length; i++ ) {
		if ( elements[i].className == 'iefix' ) {
			array = elements[i].id.split('_')
			reload_player(array[0],array[1])
		}
	}
}