//##########################################For Flash plugin check
//--------------------------------------------------
// -->
//Function to check a division is available
function checkDivAvail(divid){
	alert('Hi');
	var divId = divid;
	if((!document.getElementById(divId))){
		
	alert(document.getElementById(divId));
	return "Hi";
	}
	else return 0;
}// -->
//#############################################  check if the window is already open then pop up a message
//################### otherwise open it in a new window.

//This function is for checking if there is only one video is going to be played
function checkOneFlash(filename,media,captionfile,audiodes,url){
    //alert(media+"+++++"+filename);
    if (hasProductInstall == true && media=="audio"){
		var pathaudio="/sme/useruploads/audio/";
        filename=pathaudio+filename;
        playaudio(filename);
    }
    else if (hasProductInstall == true && media=="video"){
		var pathvideo="/sme/useruploads/video/";
		filename=pathvideo+filename;
        play_one_video(filename,captionfile,audiodes,url);
    } 
    else 
    {
        window.open("http://www.adobe.com/go/getflash/"); 
    }

}
//This function is for loading the video in a seperate page
function load(file,url,captionfile,audiodes,sendpath){
	//alert('Hi');
	checkFlashVideo(file,'video',captionfile,audiodes,url);
}

function checkFlash(filename,media,captionfile,audiodes,sendpath){
    //alert(media+"+++++"+filename);

    if (hasProductInstall == true && media=="audio"){
        var pathaudio="/sme/useruploads/audio/";
        filename=pathaudio+filename;
        playaudio(filename);
    }
    else if (hasProductInstall == true && media=="video"){
		var pathvideo="/sme/useruploads/video/";
		filename=pathvideo+filename;
        playVideo(filename,captionfile,audiodes,sendpath);
    } 
    else 
    {
        window.open("http://www.adobe.com/go/getflash/"); 
    }

}


function checkFlashWMV(filename){
    //alert(media+"+++++"+filename);
	
    if (hasProductInstall == true ){
		var pathvideo="/sme/useruploads/video/";
		filename=pathvideo+filename;
        play_wmv(filename);
    } 
    else 
    {
        window.open("http://www.adobe.com/go/getflash/"); 
    }

}

function checkFlashOneWMV(filename){
    //alert(media+"+++++"+filename);
	
    if (hasProductInstall == true ){
		var pathvideo="/sme/useruploads/video/";
		filename=pathvideo+filename;
        play_one_wmvvideo(filename);
    } 
    else 
    {
        window.open("http://www.adobe.com/go/getflash/"); 
    }

}

function checkFlashVideo(filename,media,captionfile,audiodes,sendpath){
    //alert(media+"+++++"+filename);
    if (hasProductInstall == true && media=="audio"){
        playaudio(filename);
    }
    else if (hasProductInstall == true && media=="video"){
        playVideo(filename,captionfile,audiodes,sendpath);
    } 
    else if(document.getElementById('flashcheck_videoalone'))
    {
        document.getElementById('flashcheck_videoalone').innerHTML = "<a target=_ href='http://www.adobe.com/go/getflash/'>This content requires Adobe Flash Player, as the required Flash Plugin is not installed in this machine. Please Click on this link to get the flash file installation.</a>";
    }

}


//-----------------------------checking for flash installation  and if it doesnot inst----
/*function checkFlash(filename){
    if (hasProductInstall == true){
        playaudio(filename);
    } 
    else 
    {
        loadUniquePage("http://www.adobe.com/go/getflash/"); 
    }

}
function loadUniquePage(page) {
//if (window.opener && !window.opener.closed){
//window.opener.focus();
//window.open = page;
//}
//else {
//var myWin =
    window.open(page);
//window.opener = myWin;
//}
}
//-----------------------------checking for flash installation  and if it doesnot inst----
function checkFlash(filename){
    if (hasProductInstall == true){
        playVideo(filename);
    } 
    else 
    {
        loadUniquePage("http://www.adobe.com/go/getflash/"); 
    }

}*/