var ext = ".htm";


function setup(){

	var video = new Object();
	video.value=getParameter('video');
	if (video.value==""){
		video.value="default";
	}
	changevideo(video);
	$('videoSelect').value=video.value;
}

function changevideo(obj){
	updatevideo(obj.value);

}

function updatevideo(page){
	var url = page+ext;
	new Ajax.Updater('videoContent', url, {method: 'get',evalScripts: true});
}





//********* functions for getting URL param by name **********

function getParameter(param) {
   
   	var searchStr = unescape(location.search.substring(1));
   	if (searchStr) {
       		var formElement = searchStr.split("&");
       		var tmpArray = new Array();
       		for (k = 0; k < formElement.length; k++) {
            		tmpArray = formElement[k].split("=");
	    		if (tmpArray[0]==param){
				return tmpArray[1];
			}
       		}
   	}
	return "";
}
