<?php
@ini_set('zend.ze1_compatibility_mode',0);

if(file_exists("kernel/wbs.xml")){
	$xml= simplexml_load_file("kernel/wbs.xml");
	$type=(string)$xml->FRONTEND['type'];
	$type=isset($type)?$type:'$type';
	$__WBS_INSTALL_PATH = (string)@$xml->DIRECTORIES->WEB_DIRECTORY['PATH'];
}else{
	$type='$type';
	$__WBS_INSTALL_PATH = '';
}
switch ($type){
	case 'SC':
		$_GET['frontend']=1;
				//for IIS
	
	if(!strlen($__WBS_INSTALL_PATH)){
	if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['SCRIPT_FILENAME'])){
	$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
	}; };
	if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['PATH_TRANSLATED'])){
	$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
	}; };
	//end for IIS
		define('WBS_INSTALL_PATH',str_replace(array('\\','///','//'),'/','/'.substr(dirname($_SERVER['SCRIPT_FILENAME']).'/',strlen($_SERVER['DOCUMENT_ROOT']))));
	}else{
		define('WBS_INSTALL_PATH',$__WBS_INSTALL_PATH);
	}
		
		if(!isset($_GET['__furl_path']))$_GET['__furl_path']='index.php';
		include dirname(__FILE__)."/published/SC/html/scripts/index.php";
		break;
	case 'login':
		header('Location: login/');
		break;
	case 'none':
		print '<html><head><title></title></head><body><!-- WebAsyst blank page --></body></html>';
		break;
	default:
		print '<html><head><title></title></head><body><!-- Error read wbs.xml file --></body></html>';
}
?>