function launchScanner(center){
	if (!CheckScannerCompatibility()){
		DocumentProperties.SetLocationHREF(Utils.GetGlobalPath()+'/scanner/unsupportedclient.htm');
		return;}
	if (!Browser.ActiveX){
		DocumentProperties.SetLocationHREF(Utils.GetGlobalPath()+'/scanner/noactivex.htm');
		return;}
	if(Browser.OS=='Vista'){
		varc=true;
		if (DocumentProperties.GetLocationHREF().indexOf('whatsnew')==-1){
			DisplayPopOver();}
		else{
			new Scanner('sandbox').LaunchScanner('default','','scan',true,true);}}
	else{
		if (DocumentProperties.GetLocationHREF().indexOf('whatsnew')>-1){
			DisplayPopOver();}
		else{
			new Scanner('').LaunchScanner(center,'','scanload',true,true);}}}
			
function DisplayPopOver(){
	var popover=new Live.ControlsEx.Popover();
	popover.width=450;
	popover.header=g_LSPOTitle;
	popover.body=g_LSPOText;
	popover.addButton('Confirm',g_LSPOCConfirm,true,false);
	popover.addButton('Cancel',g_LSPOBCancel,false,true);
	popover.show(PopOverCallback);}
	
function PopOverCallback(popover, btnName){	
    if (btnName == 'Confirm'){
		if(Browser.OS=='Vista'){
			new Scanner('sandbox').LaunchScanner('default','','scan',true,true);}
		else{
			center='default';
			new Scanner('').LaunchScanner(center,'','scanload',true,true);}}
	return true;}

function CheckScannerCompatibility(){
	var loc=Utils.GetGlobalPath().split('/')[1];
	var returnValue=true;
	var fct;
	if (Browser.OS=='Unsupported'){
		fct=32;
		returnValue=false;}
	if (!(Browser.Type=='IE'&&parseInt(Browser.Version)>=6)){
		fct=64;
		returnValue=false;}
	if (!returnValue){
		var temp=new Image();
		temp.src='/utility/shared/scanLog.aspx?a=1&fc='+fct+'&l='+loc;}
	return returnValue;}
