function makeRequest(compage,vid) {
	url = "http://www.extremesportclips.com/ajaxcomments.php?compage=" + compage + "&vid=" + vid + "&lr=yes";
	var http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
			// See note below about this line
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = function() { alertContents(http_request); };
	http_request.open('GET', url, true);
	http_request.send(null);

}

function alertContents(http_request) {

	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			result = http_request.responseText;
			
			document.getElementById('commentsSection').innerHTML = result;
		} else {
			alert('There was a problem with the request.');
		}
	}

}
function doVote(vote,vid) {
	url = "http://www.extremesportclips.com/ajax.vote.php?vote=" + vote + "&vid=" + vid;
	var http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
			// See note below about this line
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Cannot record vote at this time.');
		return false;
	}
	http_request.onreadystatechange = function() { alertContents2(http_request); };
	http_request.open('GET', url, true);
	http_request.send(null);

}

function alertContents2(http_request) {

	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			result = http_request.responseText;
			if (result) {
				if (result == "vote track logged") {
					alert("You recently voted for this video.  Give it some time.");
				} else {
					document.getElementById('votesection').innerHTML = result;
				}
			} else {
				alert('Cannot record vote at this time.');
			}
		} else {
			alert('Cannot record vote at this time.');
		}
	}
}
function selectShare() {
	document.getElementById('shareLink').focus();
	document.getElementById('shareLink').select();
}
function getSel()
{
	var txt = '';
	var foundIn = '';
	if (window.getSelection)
	{
		txt = window.getSelection();
	}
	else if (document.getSelection)
	{
		txt = document.getSelection();
	}
	else if (document.selection)
	{
		txt = document.selection.createRange().text;
	}
	txt = txt.toLowerCase();
	if (txt != "") {
	
		if (document.forms[0].tags.value == "") {
			document.forms[0].tags.value = txt.replace(/ /g,"");
		} else {
			document.forms[0].tags.value = document.forms[0].tags.value + " " + txt.replace(/ /g,"");
		}
	}
}
function zoomOut() {
		//alert("active");
		document.getElementById('videocode').style.zIndex = '50';		
		document.getElementById('videocode').style.position = 'absolute';
		document.getElementById('videocode').style.top = '0px';
		document.getElementById('videocode').style.bottom = '0px';
		document.getElementById('videocode').style.left = '0px';
		document.getElementById('videocode').style.overflow='visible';
		document.scrollTop;
		document.getElementById('videocode').style.width = screen.width;
		document.getElementById('videocode').style.height = screen.height;
}