function set_stretch(mode)
{

	var p = document.getElementById("Vid1");
	if(!p || typeof p.ConnectURL == "undefined")	return;

	p.SetStretch(mode);
}

//this will set the screen to work with a particular video size passed to it
function setVideoDim(thewidth,theheight)
{
	var totalwidth = thewidth;
	var totalheight = theheight + 24;
	$("#viewerarea").css({"width": totalwidth , "height" : totalheight});
	$("#navigation").css({"height" : totalheight});
	$("#video").css({"width": thewidth , "height" : totalheight});
	
	$("#player").css({"width": thewidth, "height" : theheight});

	var p = document.getElementById("Vid1");
	if(!p || typeof p.ConnectURL == "undefined")	return;
	
	p.height = theheight;
	p.width = thewidth;
}

function setMessage(themessage)
{
	document.getElementById("message").innerHTML = themessage;
}

function setReadAhead(x){//takes a percentage and sets the read ahead to that value
    var newpos = Math.round(($("#readahead").width()) * x / 100 - 1200) + "px top";
    $("#readahead").css("background-position", newpos);
}

function setPlayhead(x){//takes a percentage and sets the slider to the right place.
    $("#progbar").slider("option", "value", x)
}


