function getfileextension(inputId)
{
var fileinput = document.getElementById("foo");
if(!fileinput ) return "";
var filename = fileinput.value;
if( filename.length == 0 ) return "";
var dot = filename.lastIndexOf(".");
if( dot == -1 ) return "";
var extension = filename.substr(dot,filename.length);
return extension;
}
function checkfileType(inputId,allowedExt)
{
var ext = getfileextension(inputId);
if( ext == allowedExt )
switchid('mediaspace')
//else
//alert("Sorry, Extension doesnt support Web Player");
}

function checkfileType2(inputId,allowedExt2)
{
var ext = getfileextension(inputId);
if( ext == allowedExt2 )
switchid('jwplayer')
//else
//alert("Sorry, Extension doesnt support Web Player");
}

function checkfileType3(inputId,allowedExt3)
{
var ext = getfileextension(inputId);
if( ext == allowedExt3 )
switchid('jwplayer')
//else
//alert("Sorry, Extension doesnt support Web Player");
}

function checkfileType4(inputId,allowedExt4)
{
var ext = getfileextension(inputId);
if( ext == allowedExt4 )
switchid('quicktime')
//else
//alert("Sorry, Extension doesnt support Web Player");
}