var price_div_not_downloadable_obj = $('price_div_not_downloadable');
var mpExists = false;
var mpVersion = "";

function setMpPlayer(){
	mpExists = true;
}

function setPlayerVersion(versionNumber){
	mpVersion = versionNumber;
}

function checkIndividualisation(){   
	var sXMLCommand, objClientInformation, objXMLDOM, xmlNode;
	var sFoundSec;
	var nRequiredSec = '2200', nFoundSec = 0.0;
	sFoundSec = new String('0.0')
  
	objClientInformation = document.netobj.GetSystemInfo();
	sXMLCommand = '<?xml version="1.0"?><MEDIATEST><WMP>7</WMP>' + netobj.GetSystemInfo() + '</MEDIATEST>';
	try {
		objXMLDOM = new ActiveXObject("Msxml2.DOMDocument");
	}
	catch (xmlException) {
		objXMLDOM = new ActiveXObject("Msxml.DOMDocument");
	}
	objXMLDOM.loadXML (sXMLCommand);
  
	xmlNode = objXMLDOM.selectSingleNode("MEDIATEST/CLIENTINFO/SECURITYVERSION");
	if (xmlNode){
		var sRegEx
		sRegEx = /\./g;
		sFoundSec = String(xmlNode.text);
		sFoundSec = sFoundSec.replace(sRegEx, '');
	}
	if (Number(sFoundSec) < nRequiredSec){
		return false;
	}
	return true;
}

function checkCompatibility(){
	if(BrowserDetect.OS != 'Windows'){
		return 'ERROR_OS';
	}
	if(BrowserDetect.browser != 'Explorer'){
		return 'ERROR_BROWSER';
	}
	if(!mpExists){
		return 'ERROR_MP_NOT_INSTALLED';	
	}
	if(mpVersion < 10){
		return 'ERROR_MP_VERSION';	
	}
	document.write('<object id="netobj" classid=clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062 width=0 height=0></object>');
	if(!checkIndividualisation()){
		return 'ERROR_DRM';
	}
	return 'OK';
}

