function updateClickRecord(qryString)
	{
		//var URL = 'http://dev-steve/partsbase/aeropages/RecordClick.asp?' + qryString;
		var URL = 'RecordClick.asp?' + qryString + '&bustcache='+new Date().getTime();
        var xmlHttpReq = false;
        // FOR IE
			if (window.ActiveXObject) 
			{
				xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
				xmlHttpReq.open('GET', URL, true);
				xmlHttpReq.send();
            }
		// FOR OTHER BROWSERS
            else  
            {
				try {
						xmlHttpReq = new XMLHttpRequest();
						xmlHttpReq.open('GET', URL, true);
						xmlHttpReq.send(null);
					}
					catch(err)
					{
						alert('Error running AJAX request.\n' + err);
						
					}
			}

		var div = document.getElementById("divResults");
		xmlHttpReq.onreadystatechange = function(){
				var div = document.getElementById("divResults");
				if (xmlHttpReq.readyState == 4) 
					{
						div.innerHTML = xmlHttpReq.responseText;
					}
				else
					{
						div.innerHTML = 'Getting Results';
					}
			}
		/*
		*/
		
	}
	
	function RecordClick(Table,URLpath,context,destination,actionCode,description,businessObjID)
		{
			var qryStr = '';
			qryStr += 'Table="' + Table + '"&';
			qryStr += 'IP="' + document.getElementById ('NaviLog_IP').value + '"&';
			qryStr += 'Browser="' + document.getElementById ('NaviLog_Browser').value + '"&';
			qryStr += 'source="' + document.getElementById ('NaviLog_Source').value  + '"&';
			qryStr += 'destination="' + destination + '"&';
			qryStr += 'actionCode=' + actionCode + '&';
			qryStr += 'description="' + description + '"&';
			qryStr += 'BusObjID=' + businessObjID;
			updateClickRecord (qryStr);		
			return false;
		}
	
	function RecordClickOpenURL(Table,URLpath,context,destination,actionCode,description,businessObjID)
		{
			var qryStr = '';
			qryStr += 'Table="' + Table + '"&';
			qryStr += 'IP="' + document.getElementById ('NaviLog_IP').value + '"&';
			qryStr += 'Browser="' + document.getElementById ('NaviLog_Browser').value + '"&';
			qryStr += 'source="' + document.getElementById ('NaviLog_Source').value  + '"&';
			qryStr += 'destination="' + destination + '"&';
			qryStr += 'actionCode=' + actionCode + '&';
			qryStr += 'description="' + description + '"&';
			qryStr += 'BusObjID=' + businessObjID;
			updateClickRecord (qryStr);				
			if (context=='CorpVideo')
				{
					openPopUp (URLpath,325,315,true)
				}
			else
				{
					openPopUp (URLpath,800,600,false)
				}
		
		}
		
		function test()
			{
				alert('test');
			}
		function openPopUp(url,w,h,isVideo)
			{
				w += 32;
				h += 96;
				var wLeft = (screen.width - w) / 2;
				var wTop = (screen.height - h) / 2;
				var name = '';
				var win;
				wLeft = (wLeft < 0 ? 0 : wLeft);
				wTop = (wTop < 0 ? 0 : wTop);
				
				if (isVideo==true) {
						win = window.open(url,
							name,
							'width=' + w + ', height=' + h + ', ' +
							'left=' + wLeft + ', top=' + wTop + ', ' +
							'location=no, menubar=no, ' +
							'status=no, toolbar=no, scrollbars=no, resizable=no');
							document.getElementById ('IconClick').value = 'Video';
					}
				else
					{
						win = window.open(url,
							name,
							'width=' + w + ', height=' + h + ', ' +
							'left=' + wLeft + ', top=' + wTop + ', ' +
							'location=yes, menubar=yes, ' +
							'status=yes, toolbar=yes, scrollbars=yes, resizable=yes');
							document.getElementById ('IconClick').value = 'URL';
					}
			}
		

