var _vocam = {
	ver:'1.0'
}

_vocam.homepage={
	_url:'',
	showAllStars:function(){
		this._url = location.href;
		var urlArray = new Array(['http://www.vocam.com/', 'http://www.vocam.com/Home.aspx'],
						   ['http://www.vocam.co.uk/', 'http://www.vocam.co.uk/Home.aspx'],
						   ['http://www.vocam.co.nz/', 'http://www.vocam.co.nz/Home.aspx'],
						   ['http://www.vocam.ca/', 'http://www.vocam.ca/Home.aspx'],
						   ['http://www.vocam.com.au/', 'http://www.vocam.com.au/Home.aspx'],
						   ['http://www.vocam.com/sg/', 'http://www.vocam.com/sg/Home.aspx'],
						   ['http://www.vocam.com/my/', 'http://www.vocam.com/my/Home.aspx'],
						   ['http://www.vocam.com/hk/', 'http://www.vocam.com/hk/Home.aspx'],
						   ['http://www.vocam.com/ir/', 'http://www.vocam.com/ir/Home.aspx']
						  );
		for (var i=0; i<urlArray.length; i++) {
			if (this._url == urlArray[i][0] || this._url == urlArray[i][1]) {
				
				if(document.getElementById('level1')){
					document.getElementById('level1').style.display='block';
					_vocam.setLevel1HrefCss.init();
				}
				break;
			}
			else{
				if(document.getElementById('level1')){
					document.getElementById('level1').style.display='none';
				}
			}
		}
	}
}


_vocam.BrowserDetect = {
	detectedBrowser:'',
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
		this.detectedBrowser = this.browser;
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};

_vocam.setLevel1AllStarsCss = {
	init: function(){
		if(document.getElementById('level1')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('level1').className = 'level1_container_IE';
				document.getElementById('level1_options').className = 'level1_options_container_IE';
			}
			else{
				document.getElementById('level1').className = 'level1_container';
				document.getElementById('level1_options').className = 'level1_options_container';
			}
		}
	}
}

_vocam.setLevel1HrefCss = {
	init: function(){
		
		if(document.getElementById('level1_dvd')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('level1_dvd').className = 'level1_href_IE';
			}
			else{
				document.getElementById('level1_dvd').className = 'level1_href_FF_CR';
			}
		}
	}
}

_vocam.setLevel2HrefCss = {
	init: function(){
		if(document.getElementById('level2')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('level2').className = 'level2_container_IE';
			}
			else{
				document.getElementById('level2').className = 'level2_container';
			}
		}
	}
}

_vocam.setVocamHeaderTableCss = {
	init: function(){
		if(document.getElementById('vocam_header_table')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('vocam_header_table').className = 'vocam_header_table_IE';
			}
			else{
				document.getElementById('vocam_header_table').className = 'vocam_header_table';
			}
		}
	}
}

_vocam.setLevel2Options = {
	init: function(){
		if(document.getElementById('level2_options')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('level2_options').className = 'level2_options_IE';
			}
			else{
				document.getElementById('level2_options').className = 'level2_options';
			}
		}
	}
}

_vocam.setLevel3Container = {
	init: function(){
		if(document.getElementById('level3')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('level3').className = 'level3_container_IE';
			}
			else{
				document.getElementById('level3').className = 'level3_container';
			}
		}
	}
}

_vocam.setLevel3Options = {
	init: function(){
		if(document.getElementById('level3_options')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('level3_options').className = 'level3_options_IE';
			}
			else{
				document.getElementById('level3_options').className = 'level3_options';
			}
		}
	}
}

_vocam.setTopMenu = {
	init: function(){
		if(document.getElementById('menu_container')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Safari'){
				document.getElementById('menu_container').className = 'menu_container_safari';
			}
			else{
				document.getElementById('menu_container').className = 'menu_container';
			}
		}
	}
}

_vocam.setSearch = {
	init: function(){
		if(document.getElementById('search')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Safari'){
				document.getElementById('search').className = 'search_safari';
			}
			else{
				document.getElementById('search').className = 'search';
			}
		}
	}
}

_vocam.dnnSearch = {
	init: function(){
		if(document.getElementById('dnn_dnnSEARCH_cmdSearch')){
			document.getElementById('dnn_dnnSEARCH_cmdSearch').innerHTML = "Go";
		}
	}
}



_vocam.Reload = {
	_url:'',
	init: function(){
		this._url = location.href;
		if(this._url.indexOf('products') > 0){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				//alert('reload');
				//document.location.reload();
			}
		}
	}
}

//*****product section*******

_vocam_invenTopMenuCss = {
	_url:'',
	init: function(){
		this._url = location.href;
		if(this._url.indexOf('products') > 0){
			this.getElementByClassName('products_container products_IE_OR_FF');
		}
	},
	getElementByClassName: function(strClassName){
		var divElements = document.getElementsByTagName('DIV');
		for (var i=0; i<divElements.length; i++) {
			if(document.getElementsByTagName('DIV')[i].className == strClassName){
				if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
					document.getElementsByTagName('DIV')[i].className = 'products_container products_IE';
				}else{
					document.getElementsByTagName('DIV')[i].className = 'products_container products';
				}
				break;
			}
		}
	}
}

_vocam.setProductsPane = {
	_url:'',
	init: function(){
		this._url = location.href;
		if(this._url.indexOf('products') > 0){
			if(document.getElementById('products_container')){
				if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
					document.getElementById('products_container').className = 'products_container_IE';
				}
				else{
					document.getElementById('products_container').className = 'products_container';
				}
			}
		}
	}
}

_vocam.setTopNav = {
	_url:'',
	init: function(){
		this._url = location.href;
		if(this._url.indexOf('products') > 0){
			if(document.getElementById('topnavmenucontainer')){
				if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
					document.getElementById('topnavmenucontainer').className = 'topnavmenucontainer_IE';
				}
				else{
					document.getElementById('topnavmenucontainer').className = 'topnavmenucontainer';
				}
			}
		}
	}
}


_vocam.title = {
	_url:'',
	elementsCount:200,
	init: function() {
		this._url = location.href;
		if(this._url.indexOf('products') > 0){
			this.titleFormat();
			if(this._url.indexOf('tabid') > 0){
				
			}
			else{
				this.titleflv();
			}
		}
	},
	titleFormat:function(){
		var formatcounter = 1;
		for (var i=0; i< document.forms[0].elements.length; i++) {
			var formatElement = document.forms[0].elements[i];
			if(formatElement.name=='formatlistinput'){
				formatElement.name = 'formatlistinput' + formatcounter;	
				formatElement.id = 'formatlistinput' + formatcounter;	
				formatcounter++;
			}
		}
		formatDiv = 1;
		for (var i=0; i<formatcounter; i++) {
			var divFormatElement = document.getElementById('format');
			if(divFormatElement){
				divFormatElement.id = 'format'+formatDiv;
				formatDiv++;
			}
			
		}
		for(var i=1; i<=formatDiv; i++){
			var formatListInputId = 'formatlistinput'+i;
			var formatListInput = document.getElementById(formatListInputId);
			if(formatListInput){
				var divFormatId = 'format'+i;
				var divFormat = document.getElementById(divFormatId);
				if(divFormat){
					var formatArray = formatListInput.value.split(",");
					var formatArraySize = formatArray.length;
					var formatInnerHtml = "";
					if( formatListInput.value == ''){
					}else{
						for(var j=0; j<formatArraySize; j++){
							if(j > 0){
								var formatIcon = formatArray[j];
								formatIcon = formatIcon.substring(1);
								formatInnerHtml+= '<img src="/lib/images/titleformats/'+formatIcon + '_sml.gif" />&nbsp;';
							}
							else{
								formatInnerHtml+= '<img src="/lib/images/titleformats/'+formatArray[j] + '_sml.gif" />&nbsp;';
							}
						}
						divFormat.innerHTML = formatInnerHtml;
					}
				}
			}
		}
	},
	titleflv: function(){
		var flvcounter = 1;
		this.elementsCount = document.forms[0].elements.length;
		for (var i=0; i<this.elementsCount; i++) {
			
			var flvElement = document.forms[0].elements[i];
			if(flvElement.name == 'isTitleFlv'){
				flvElement.name = 'isTitleFlv' + flvcounter;
				flvElement.id = 'isTitleFlv' + flvcounter;
				flvcounter++
			}
		}
		var codeCounter = 1;
		for (var i=0; i<this.elementsCount; i++) {
			var codeElement = document.forms[0].elements[i];
			if(codeElement.name == 'titlecode'){
				codeElement.name = 'titlecode' + codeCounter;
				codeElement.id = 'titlecode' + codeCounter;
				codeCounter++;
			}
		}
		//alert('codeCounter ' + codeCounter);
		var imageCounter = 1;
		for (var i=0; i<this.elementsCount; i++) {
			var imageElement = document.forms[0].elements[i];
			if(imageElement.name == 'isTitleImage'){
				imageElement.name = 'isTitleImage' + imageCounter;
				imageElement.id = 'isTitleImage' + imageCounter;
				imageCounter++;
			}
		}
		flvDiv = 1;
		for (var i=0; i<this.elementsCount; i++) {
			var divFormatElement = 'flvsection';
			
			if(document.getElementById('flvsection')){
				document.getElementById('flvsection').id = 'flvsection'+ flvDiv;
				flvDiv++;
			}
		}
		this.titleList(flvDiv);
	},
	generateStrFlv: function(type, titleCode, isUniqueImage){
		var portal = _vocam.dnnportals.init(location.hostname);
		var strFlvSection='';
		var titleImagesFileName='';
		var previewFlvFileName= type + '_' + portal + '_' +titleCode + '_pvw.flv';
		if(isUniqueImage.length > 0){
			titleImagesFileName = 'PP_' + titleCode + '.jpg';
		}
		else{
			titleImagesFileName = 'title_null.jpg';
		}
		strFlvSection+= '<object type="application/x-shockwave-flash" width="240" height="180" wmode="transparent"';
		strFlvSection+= 'data="/mediaplayer.swf?file=/portals/' + portal +'/titlepreview/' + previewFlvFileName;
		strFlvSection+= '&image=/lib/images/titleImages/' + titleImagesFileName +'&autoStart=false&showfsbutton=false&displayheight=175">';
		strFlvSection+= '<param name="movie" value="/mediaplayer.swf?file=/portals/' + portal + '/titlepreview/' + previewFlvFileName;
		strFlvSection+= '&image=/lib/images/titleimages/' + titleImagesFileName + '&autoStart=false&showfsbutton=false&displayheight=175"/>';
		strFlvSection+= '<param name="wmode" value="transparent" /><param name="quality" value="high"></object>';
		//alert(strFlvSection);
		return strFlvSection;
	},
	titleList:function(flvDiv){
		
		for(var i=1; i<=flvDiv; i++){
			var strFlvSection = '';
			var titleFlvSearch = 'isTitleFlv' + i;
			var titleCodeSearch = 'titlecode' + i;
			var flvSectionSearch = 'flvsection' + i;
			var titleImageSearch = 'isTitleImage' + i;
			var titleFlvSearchValue = '';
			var titleCodeSearchValue = '';
			var titleImageSearchValue = '';
			var titleImagesFileName = '';
			var titleFlvArray = '';
			var isPreview = 0;
			
			if(document.getElementById(titleCodeSearch)){
				titleCodeSearchValue = document.getElementById(titleCodeSearch).value;
			}
			if(document.getElementById(titleImageSearch)){
				titleImageSearchValue = document.getElementById(titleImageSearch).value;
			}
			//alert(titleFlvSearch);
			if(document.getElementById(titleFlvSearch)){
				//alert(titleFlvSearch);
				if(document.getElementById(titleFlvSearch).value.length > 0){
					titleFlvArray = document.getElementById(titleFlvSearch).value.split(",");
					if(this._url.indexOf('vocamdvds') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Dvds' || titleFlvArray[j] == ' Vocam Dvds'){
								strFlvSection = this.generateStrFlv('dvd', titleCodeSearchValue, titleImageSearchValue);
								isPreview = 1;
								break;
							}
						}
					}
					if(this._url.indexOf('vocamonlinedvds') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Dvds Online' || titleFlvArray[j] == ' Vocam Dvds Online'){
								strFlvSection = this.generateStrFlv('dvd', titleCodeSearchValue, titleImageSearchValue);
								isPreview = 1;
								break;
							}
						}
					}
					if(this._url.indexOf('vocambusinesstraining') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == ' Vocam Business Training' || titleFlvArray[j] =='Vocam Business Training'){
								strFlvSection = this.generateStrFlv('dvd', titleCodeSearchValue, titleImageSearchValue);
								isPreview = 1;
								break;
							}
						}
					}
					if(this._url.indexOf('vocamonlinetraining') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Online Training' || titleFlvArray[j] == ' Vocam Online Training'){
								strFlvSection = this.generateStrFlv('soda', titleCodeSearchValue, titleImageSearchValue);
								isPreview = 1;
								break;
							}
						}
					}
					if(isPreview == 0){
						if(titleImageSearchValue.length > 0){
							titleImagesFileName = 'ppno_' + titleCodeSearchValue + '.jpg';
							strFlvSection+= '<img src="/lib/images/titleimages/';
							strFlvSection+= titleImagesFileName +'" width="240px" height="180px"/>';
						}
						else{
							strFlvSection+= '<img src="/lib/images/titleimages/';
							strFlvSection+= 'title_null.gif " width="240px" height="180px"/>';
						}
					}
				}
				else{
					
					if(titleImageSearchValue.length > 0){
						titleImagesFileName = 'ppno_' + titleCodeSearchValue + '.jpg';
						strFlvSection+= '<img src="/lib/images/titleimages/';
						strFlvSection+= titleImagesFileName +'" width="240px" height="180px"/>';
					}
					else{
						strFlvSection+= '<img src="/lib/images/titleimages/';
						strFlvSection+= 'title_null.gif " width="240px" height="180px"/>';
					}
				}
			}
			//alert(strFlvSection);
			if(document.getElementById(flvSectionSearch)){
				//alert(strFlvSection);
				document.getElementById(flvSectionSearch).innerHTML = strFlvSection;
			}
		}
	}
}

_vocam.getQueryValue = {
	init:function(query){
		hu = window.location.search.substring(1);
		gy = hu.split("&");
		for (i=0;i<gy.length;i++) {
			ft = gy[i].split("=");
			if (ft[0] == query) {
			return ft[1];
			}
		}
	}
}

_vocam.dnnportals={
	portal:'',
	init:function(theHost){
		if(document.getElementById('currentCountry')){
			this.portal = document.getElementById('currentCountry').value;
		}
		return this.portal;
	}
}

_vocam.countXmodModule={
	allElements:'',
	xmod:0,
	init: function(){
		this.allElements = document.getElementsByTagName('DIV');
		for(var i=0; i<this.allElements.length; i++){
			if(document.getElementsByTagName('DIV')[i].id == "titletable"){
				//alert(document.getElementsByTagName('DIV')[i].style.height);
				this.xmod++;
			}
		}
	}
}

_vocam.countSideNav = {
	sideMenus:'',
	init: function(){
			this.sideMenus = _vocam.sideNav._navMenu.length;
		 
	}
}

_vocam.setSideExtendHeight = {
	init: function(){
		_vocam.countXmodModule.init();
		_vocam.countSideNav.init();
	
		var xmodHeight = ( _vocam.countXmodModule.xmod * 210 ) + ( (_vocam.countXmodModule.xmod - 1) * 15) + 113;
		var sideNavHeight = ( _vocam.countSideNav.sideMenus * 42 ) + 22;
		var extendHeight = 1;
		if(xmodHeight > sideNavHeight){
			extendHeight = xmodHeight - sideNavHeight;
		}
		if(document.getElementById('sidenavbg_extend')){
			document.getElementById('sidenavbg_extend').innerHTML = '<div style="height:' + extendHeight + 'px;"></div>';
		}
	}
	
}



_vocam.sideNav={
	_url:'',
	_host:'',
	_solution:'',
	_navMenu:'',
	_currentCountry:'',
	_sideNavCss:'',
	init: function(){
		this._url = location.href;
		if(this._url.indexOf('products') > 0){
			this._sideNavCss = 'sidenavmenucontainer';
			if(document.getElementById('hiddentitledetail')){
				this._sideNavCss = 'title_details_sidenavmenucontainer';
			}
			this.setSideNavLocation();
			this.getMenuType();
		}
	},
	setSideNavLocation: function(){
		if(document.getElementById('sidenav')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('sidenav').className = 'sidenav_container_IE';
				if(document.getElementById('hiddentitledetail')){
					document.getElementById('sidenav').className='title_details_sidenav_container';
				}
			}
			else{
				document.getElementById('sidenav').className = 'sidenav_container';
				if(document.getElementById('hiddentitledetail')){
					document.getElementById('sidenav').className='title_details_sidenav_container';
				}
			}
		}
	},
	getMenuType: function(){
		if(document.getElementById('currentCountry')){
			if(document.getElementById('currentCountry').value == 'us'){
				this._host = '/us';
				this.getUSAMenu();
			}
			if(document.getElementById('currentCountry').value == 'au'){
				this._host = '';
				this.getAuMenu();
			}
			if(document.getElementById('currentCountry').value == 'uk'){
				this._host = '';
				this.getUkMenu();
			}
			if(document.getElementById('currentCountry').value == 'ca'){
				this._host = '';
				this.getCaMenu();
			}
			if(document.getElementById('currentCountry').value == 'ir'){
				this._host = '';
				this.getIrMenu();
			}
			if(document.getElementById('currentCountry').value == 'nz'){
				this._host = '';
				this.getNzMenu();
			}
			if(document.getElementById('currentCountry').value == 'cn'){
				this._host = '/cn';
				this.getCnMenu();
			}
			if(document.getElementById('currentCountry').value == 'hk'){
				this._host = '/hk';
				this.getHkMenu();
			}
			if(document.getElementById('currentCountry').value == 'my'){
				this._host = '/my';
				this.getMyMenu();
			}
			if(document.getElementById('currentCountry').value == 'sg'){
				this._host = '/sg';
				this.getSgMenu();
			}
		}
		
	},
	getUSAMenu: function(){
		if(_us.siteNav){
			_us.siteNav.init();
			this._solution = _us.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _us.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _us.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _us.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _us.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
			
		}
	},
	getAuMenu: function(){
		if(_au.siteNav){
			_au.siteNav.init();
			this._solution = _au.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _au.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _au.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _au.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _au.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getUkMenu: function(){
		if(_uk.siteNav){
			_uk.siteNav.init();
			this._solution = _uk.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _uk.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _uk.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _uk.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _uk.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getCaMenu: function(){
		if(_ca.siteNav){
			_ca.siteNav.init();
			this._solution = _ca.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _ca.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _ca.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _ca.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _ca.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getIrMenu: function(){
		if(_ir.siteNav){
			_ir.siteNav.init();
			this._solution = _ir.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _ir.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _ir.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _ir.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _ir.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getNzMenu: function(){
		if(_nz.siteNav){
			_nz.siteNav.init();
			this._solution = _nz.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _nz.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _nz.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _nz.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _nz.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getCnMenu: function(){
		if(_cn.siteNav){
			_cn.siteNav.init();
			this._solution = _cn.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _cn.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _cn.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _cn.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _cn.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getHkMenu: function(){
		if(_hk.siteNav){
			_hk.siteNav.init();
			this._solution = _hk.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _hk.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _hk.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _hk.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _hk.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getMyMenu: function(){
		if(_my.siteNav){
			_my.siteNav.init();
			this._solution = _my.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _my.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _my.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _my.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _my.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	getSgMenu: function(){
		if(_sg.siteNav){
			_sg.siteNav.init();
			this._solution = _sg.siteNav.solution;
			if(this._solution == 'vocamdvds'){
				this._navMenu = _sg.vocamdvds.vocamdvdsMenu;
				this.generateSideMenu('vd', this._navMenu);
			}
			if(this._solution == 'vocamonlinedvds'){
				this._navMenu = _sg.vocamonlinedvds.vocamonlinedvdsMenu;
				this.generateSideMenu('vdo', this._navMenu);
			}
			if(this._solution == 'vocambusinesstraining'){
				this._navMenu = _sg.vocambusinesstraining.vocambusinesstrainingMenu;
				this.generateSideMenu('ibt', this._navMenu);
			}
			if(this._solution == 'vocamonlinetraining'){
				this._navMenu = _sg.vocamonlinetraining.vocamonlinetrainingMenu;
				this.generateSideMenu('soda', this._navMenu);
			}
		}
	},
	generateSideMenu: function(strfilter, sideMenuArray){
		if(document.getElementById('sidenav')){
			var currentCat = _vocam.getQueryValue.init(strfilter);
			var isOver = '';
			var strInnerHtml = '<table cellspacing="0" width="159px">';
			for(var i=0; i<sideMenuArray.length; i++){
				strInnerHtml+='<tr><td class="sidenavbg" valign="bottom">';
				if(currentCat == sideMenuArray[i][1]){
					isOver = 'sidenavmenu_over';
				}
				else{
					isOver = 'sidenavmenu';
				}
				if(sideMenuArray[i][1] == 'promotion'){
					strInnerHtml+='<div class=" ' + this._sideNavCss +'"><a class="' + isOver +'" href="' + this._host +'/products/' + this._solution +'/solution.aspx?' + strfilter +'='+sideMenuArray[i][1] + '&sol=' + this._solution + '">' + sideMenuArray[i][0] + '</a></div></td></tr>';
				}
				else{
					strInnerHtml+='<div class=" ' + this._sideNavCss +'"><a class="' + isOver +'" href="' + this._host +'/products/' + this._solution +'.aspx?' + strfilter +'='+sideMenuArray[i][1] + '&sol=' + this._solution + '">' + sideMenuArray[i][0] + '</a></div></td></tr>';
				}
				
			}
			//strInnerHtml+='<tr><td id="sidenavbg_extend" class="sidenavbg_extend"></td></tr><tr><td class="sidenavbg_footer"></td></tr></table>';
			strInnerHtml+='</table>';
			document.getElementById('sidenav').innerHTML = strInnerHtml;
		}
		//_vocam.setSideExtendHeight.init();
		this.setCurrentCategory(strfilter,sideMenuArray);
	},
	setCurrentCategory: function(strfilter, sideMenuArray){
		if(document.getElementById('current_category')){
			var currentCat = _vocam.getQueryValue.init(strfilter);
			for(var i=0; i<sideMenuArray.length; i++){
				if(currentCat == sideMenuArray[i][1]){
					document.getElementById('current_category').className = 'current_category';
					document.getElementById('current_category').innerHTML = sideMenuArray[i][0];
					break;
				}
			}
		}
	}
}

_vocam.HomePage = {
	discardLeftPane: function(){
		var hostname = 'http://' + window.location.hostname +'/';
		var defaultPage = hostname + 'Home.aspx';
		if(hostname == window.location.href || defaultPage == window.location.href){
			if(document.getElementById('dnn_LeftPane')){
				document.getElementById('dnn_LeftPane').className = '';
			}
		}
		else{
			
		}
	}
}

_vocam.titleDetails = {
	_url: window.location.href,
	_country:'',
	_host:'',
	_brochure:'',
	init:function(){
		if(document.getElementById('flvDetailSection')){
			var titleCode = '';
			var strFlv='';
			var titleImage = '';
			var titleImagesFileName = '';
			var downloadbrochure = '';
			var titleName = '';
			
			if(document.getElementById('titlecode')){
				titleCode = document.getElementById('titlecode').value;
			}
			
			if(document.getElementById('isTitleImage')){
				titleImage = document.getElementById('isTitleImage').value;
			}
			
			if(document.getElementById('isDownloadBrochure')){
				this.getMenuType();
				downloadbrochure = document.getElementById('isDownloadBrochure').value;
				titleName = document.getElementById('titlename').value;
				
				var strTransaction = "<table><tbody><tr><td valign=\'middle\'><img src=\'/lib/images/common/buynow_arrow.gif\'/></td><td><a class=\'buynow\' ";
				strTransaction+= "href=\'" + this._host + "/buynow.aspx?country=" + this._country + "&selected=" + titleName + "\'/>ORDER NOW</a></td><td style=\'color:#0066cc; font-weight:bold;\' valign=\'middle\'>&nbsp;|&nbsp;</td>";
				strTransaction+= "<td valign=\'middle\'><img src=\'/lib/images/common/buynow_arrow.gif\'/></td>";
				strTransaction+= "<td><a class=\'requestpreview\' href=\'" + this._host + "/requestpreview.aspx?country=" + this._country + "&selected=" + titleName + "\'/>Request preview</a></td>";
				
				if(document.getElementById('isDownloadBrochure').value.length > 0){
					strTransaction+= "<td style=\'color:#0066cc; font-weight:bold;\' valign=\'middle\'>&nbsp;|&nbsp;</td><td valign=\'middle\'><img src=\'/lib/images/common/buynow_arrow.gif\'/></td>";
					strTransaction+= "<td><a class=\'brochure\' href=\'/lib/brochures/" + document.getElementById('currentCountry').value + "/" + titleCode +".pdf\' target=\'blank\'/>Download brochure</a></td>";
				}
				if(document.getElementById('transaction')){
					document.getElementById('transaction').innerHTML = strTransaction;
				}
			}
			
			if(document.getElementById('isTitleFlv')){
				if(document.getElementById('isTitleFlv').value.length > 0){
					var titleFlvArray = document.getElementById('isTitleFlv').value.split(",");
					var isPreview = 0;
					if(this._url.indexOf('vocamdvds') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Dvds' || titleFlvArray[j] == ' Vocam Dvds'){
								strFlv = this.generateStrFlv('dvd', titleCode, titleImage);
								isPreview = 1;
								break;
							}
						}
					}
					if(this._url.indexOf('vocamonlinedvds') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Dvds Online' || titleFlvArray[j] == ' Vocam Dvds Online'){
								strFlv = this.generateStrFlv('dvd', titleCode, titleImage);
								isPreview = 1;
								break;
							}
						}
					}
					if(this._url.indexOf('vocambusinesstraining') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Business Training' || titleFlvArray[j] == ' Vocam Business Training'){
								strFlv = this.generateStrFlv('dvd', titleCode, titleImage);
								isPreview = 1;
								break;
							}
						}
					}
					if(this._url.indexOf('vocamonlinetraining') > 0){
						for(var j=0; j< titleFlvArray.length; j++){
							if(titleFlvArray[j] == 'Vocam Online Training' || titleFlvArray[j] == ' Vocam Online Training'){
								strFlv = this.generateStrFlv('soda', titleCode, titleImage);
								isPreview = 1;
								break;
							}
						}
					}
					if(isPreview == 0){
						if(titleImage.length > 0){
							titleImagesFileName = 'ppno_' + titleCode + '.jpg';
							strFlv+= '<img src="/lib/images/titleimages/';
							strFlv+= titleImagesFileName +'" width="340px" height="250px"/>';
						}
						else{
							strFlv+= '<img src="/lib/images/titleimages/';
							strFlv+= 'title_null.gif " width="340px" height="250px"/>';
						}
					}
				}
				else{
					if(titleImage.length > 0){
						titleImagesFileName = 'ppno_' + titleCode + '.jpg';
						strFlv+= '<img src="/lib/images/titleimages/';
						strFlv+= titleImagesFileName +'" width="340px" height="250px"/>';
					}
					else{
						strFlv+= '<img src="/lib/images/titleimages/';
						strFlv+= 'title_null.gif " width="340px" height="250px"/>';
					}
				}
			}
			
			
			document.getElementById('flvDetailSection').innerHTML = strFlv;
			
		}
	},
	getMenuType: function(){
		if(document.getElementById('currentCountry')){
			if(document.getElementById('currentCountry').value == 'us'){
				this._country = 'america';
				this._host = '/us';
				
			}
			if(document.getElementById('currentCountry').value == 'au'){
				this._country = 'australia';
				this._host = '';
				
			}
			if(document.getElementById('currentCountry').value == 'uk'){
				this._country = 'united kingdom';
				this._host = '';
				
			}
			if(document.getElementById('currentCountry').value == 'ca'){
				this._country = 'canada';
				this._host = '';
				
			}
			if(document.getElementById('currentCountry').value == 'ir'){
				this._country = 'ireland';
				this._host = '';
				
			}
			if(document.getElementById('currentCountry').value == 'nz'){
				this._country = 'new zealand';
				this._host = '';
				
			}
			if(document.getElementById('currentCountry').value == 'cn'){
				this._country = 'china';
				this._host = '/cn';
				
			}
			if(document.getElementById('currentCountry').value == 'hk'){
				this._country = 'hong kong';
				this._host = '/hk';
				
			}
			if(document.getElementById('currentCountry').value == 'my'){
				this._country = 'malaysia';
				this._host = '/my';
				
			}
			if(document.getElementById('currentCountry').value == 'sg'){
				this._country = 'singapore';
				this._host = '/sg';
				
			}
		}
		
	},
	generateStrFlv: function(type, titleCode, isUniqueImage){
		var portal = _vocam.dnnportals.init(location.hostname);
		var strFlvSection='';
		var titleImagesFileName='';
		var previewFlvFileName= type + '_' + portal + '_' +titleCode + '_pvw.flv';
		if(isUniqueImage.length > 0){
			titleImagesFileName = 'PP_' + titleCode + '.jpg';
		}
		else{
			titleImagesFileName = 'title_null.jpg';
		}
		strFlvSection+= '<object type="application/x-shockwave-flash" width="340" height="250" wmode="transparent"';
		strFlvSection+= 'data="/mediaplayer.swf?file=/portals/' + portal +'/titlepreview/' + previewFlvFileName;
		strFlvSection+= '&image=/lib/images/titleImages/' + titleImagesFileName +'&autoStart=false&showfsbutton=false&displayheight=250">';
		strFlvSection+= '<param name="movie" value="/mediaplayer.swf?file=/portals/' + portal + '/titlepreview/' + previewFlvFileName;
		strFlvSection+= '&image=/lib/images/titleimages/' + titleImagesFileName + '&autoStart=false&showfsbutton=false&displayheight=250"/>';
		strFlvSection+= '<param name="wmode" value="transparent" /><param name="quality" value="high"></object>';
		return strFlvSection;
	}
}

_vocam.trainingtopics = {
	_elementsCount:1000,
	_currentCountry:'',
	_host:'',
	_sideMenuArray:'',
	_sideNavCss:'',
	init:function(){
		
		if(window.location.href.indexOf('trainingtopics') > 0){
			this.initSideMenu();
			if(document.getElementById('currentCountry')){
				this._currentCountry = document.getElementById('currentCountry').value;
			}
			this.initTrainingTopicImages();
		}
	},
	initTrainingTopicImages:function(){
		var trainingTopicElementCount = 0;
		for (var i=0; i<this._elementsCount; i++) {
			var trainingTopicElement = document.getElementById('trainingtopicimage');
			if(trainingTopicElement){
				trainingTopicElement.id = 'trainingtopicimage' + i;
				trainingTopicElementCount++;
				if(document.getElementById('isTrainingtopicimageupload')){
					document.getElementById('isTrainingtopicimageupload').id = 'isTrainingtopicimageupload' + i;
				}
			}
			else{
				break;
			}
		}
		for(var i=0; i<trainingTopicElementCount; i++){
			var trainingTopicElement = 'trainingtopicimage' + i;
			var trainingtopicimageupload = 'isTrainingtopicimageupload' + i;
			if(document.getElementById(trainingtopicimageupload).value.length > 0){
				if(document.getElementById(trainingTopicElement)){
					document.getElementById(trainingTopicElement).innerHTML = '<img src=\'/portals/' + this._currentCountry + '/trainingtopicimages/' +  document.getElementById(trainingtopicimageupload).value +'\' height=\'91\' width=\'94\'/>';
				}
			}
		}
	},
	initSideMenu:function(){
		
		
		this.getCurrentCountryCode();
		this._sideNavCss = 'sidenavmenucontainer';
			if(document.getElementById('hiddentitledetail')){
				this._sideNavCss = 'title_details_sidenavmenucontainer';
			}
		this.setSideNavLocation();
		this.generateSideMenu();
		
	},
	getCurrentCountryCode: function(){
		if(document.getElementById('currentCountry')){
			if(document.getElementById('currentCountry').value == 'us'){
				this._host = '/us';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'au'){
				this._host = '';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'uk'){
				this._host = '';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'ca'){
				this._host = '';
				_caTrainingTopics.init();
				this._sideMenuArray = _caTrainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'ir'){
				this._host = '';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'nz'){
				this._host = '';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'cn'){
				this._host = '/cn';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'hk'){
				this._host = '/hk';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'my'){
				this._host = '/my';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
			if(document.getElementById('currentCountry').value == 'sg'){
				this._host = '/sg';
				_trainingTopics.init();
				this._sideMenuArray = _trainingTopics.sideMenu;
			}
		}
	},
	generateSideMenu: function(){
		if(document.getElementById('sidenav')){
			var currentCat = _vocam.getQueryValue.init('cat');
			var isOver = '';
			var strInnerHtml = '<table cellspacing="0" width="159" border="0">';
			for(var i=0; i<this._sideMenuArray.length; i++){
				strInnerHtml+='<tr><td class="sidenavbg" valign="bottom">';
				if(currentCat == this._sideMenuArray[i][1]){
					isOver = 'sidenavmenu_over';
					if(document.getElementById('trainingtopic_title')){
						document.getElementById('trainingtopic_title').innerHTML = '<h1>Vocam ' + this._sideMenuArray[i][0] + '</h1>';
					}
				}
				else{
					isOver = 'sidenavmenu';
				}
				strInnerHtml+='<div class="sidenavmenucontainer"><a class="' + isOver +'" href="' + this._host +'/trainingtopics/topics.aspx?cat=' + this._sideMenuArray[i][1] + '">';
				strInnerHtml+= this._sideMenuArray[i][0] + '</a></div></td></tr>';
			}
			strInnerHtml+='</table>';
			document.getElementById('sidenav').innerHTML = strInnerHtml;
			//alert(strInnerHtml);
		}
	},
	setSideNavLocation: function(){
		if(document.getElementById('sidenav')){
			if(_vocam.BrowserDetect.detectedBrowser == 'Explorer'){
				document.getElementById('sidenav').className = 'sidenav_container_IE';
				if(document.getElementById('hiddentitledetail')){
					document.getElementById('sidenav').className='title_details_sidenav_container';
				}
			}
			else{
				document.getElementById('sidenav').className = 'sidenav_container';
				if(document.getElementById('hiddentitledetail')){
					document.getElementById('sidenav').className='title_details_sidenav_container';
				}
			}
		}
	}
}

_vocam.news = {
	_elementsCount:200,
	_currentCountry:'',
	init:function(){
		if(window.location.href.indexOf('news') > 0){
			if(document.getElementById('currentCountry')){
				this._currentCountry = document.getElementById('currentCountry').value;
				this.initNewsImages();
			}
			
		}
	},
	initNewsImages:function(){
		var newsElementCount = 1;
		for (var i=0; i<this._elementsCount; i++) {
			var newsElement = document.getElementById('newsimage');
			if(newsElement){
				newsElement.id = 'newsimage' + newsElementCount;
				
				if(document.getElementById('newsimageupload')){
					document.getElementById('newsimageupload').id = 'newsimageupload' + newsElementCount;
				}
				newsElementCount++;
			}
			else{
				break;
			}
		}
		var newsImageCount = 1;
		for(var i=0; i<newsElementCount; i++){
			var newsElement = 'newsimage' + newsImageCount;
			var newsimageupload = 'newsimageupload' + newsImageCount;
			if(document.getElementById(newsimageupload)){
				if(document.getElementById(newsimageupload).value.length > 0){
					
					newsImageCount++;
					if(document.getElementById(newsElement)){
						document.getElementById(newsElement).innerHTML = '<img src=\'/portals/' + this._currentCountry + '/newsimages/' +  document.getElementById(newsimageupload).value +'\' height=\'91\' width=\'94\'/>';
					}
				}
			}
			
		}
	}
	
}









	






_vocam.BrowserDetect.init();
_vocam.setVocamHeaderTableCss.init();
_vocam.setTopMenu.init();
_vocam.setSearch.init();
_vocam.setLevel1AllStarsCss.init();
_vocam.setLevel1HrefCss.init();
_vocam.setLevel2HrefCss.init();
_vocam.setLevel2Options.init();
_vocam.setLevel3Container.init();
_vocam.setLevel3Options.init();
_vocam.dnnSearch.init();
_vocam.setProductsPane.init();
_vocam.setTopNav.init();
_vocam.trainingtopics.init();
//_vocam.HomePage.discardLeftPane();


_vocam.title.init();
_vocam.sideNav.init();
_vocam.titleDetails.init();
_vocam.news.init();




//_soda.childBar.timeout = setTimeout('_soda.childBar.initialize();', 250);
