function chkBrowser(){			
	//alert("hi");
	var Opera = (navigator.userAgent.indexOf("Opera")!=-1);
	var MSIE = (navigator.appVersion.indexOf("MSIE")!=-1);
	var Moz = (navigator.userAgent.indexOf("Mozilla/5")!=-1);
	var myframe = document.getElementById("panMain");
	//alert(navigator.appVersion.indexOf("Opera"));
	//alert(MSIE);
	//alert(Moz);
		
	if (Moz)
	{
		//alert("fireFox");
		myframe.style.height="100%";					
	}
	if (navigator.userAgent.indexOf("Opera")!=-1) 
	{
		//alert("IE");
		hgt='100%';
		myframe.style.height=hgt;
		myframe.style.bottom=0;
	}

}

window.onload= function(){    
   chkBrowser();
}


function doCommand(s) {

	var el = document.getElementById('txtCommand');
	var f = document.getElementById('Form1');
	var isSave = false;
	var isDelete = false;
	var fOK = true;
	//determine if 'save' is a part of the command...  if so, ignore isDirty variable	
	if (s.split('save').length > 1) {isSave = true}
	if (s.split('delete').length > 1) {isDelete = true}
	
	if (s == 'undo') {isDirty = false;}
	
	if (s == 'View' | s == 'view') {		
		var tab = arguments[1];		
		if ((tab.toString()).length > 0) {			
			if (tab < 10000) {
				changeView(tab,1); 
				fOK = false;
			} else {
				fOK = false;
			}
		}
	}
	
	if (isDelete) {
		fOK = window.confirm('Are you sure you wish to delete this record?');
	}
	
	if (isSave) {
		if (self.doValidate) {
			fOK = doValidate();
		} else { 
			fOK = true;
		}
		if (fOK) { isDirty = false }
	}
		
	if (fOK) {
		if (arguments.length > 1) {
			for (var a=1; a < arguments.length; a++) {
				s = s + ',' + arguments[a];
			}
		}
		el.value = s;
		f.submit();
	}
	
}
function logTraffic (iPid) {
	
	var el;

	var sQry = location.search;
	sQry = sQry.substr(1);
	sQry = sQry.replace(/=/g,"||");
	sQry = sQry.replace(/&/g,"|AND");
	
	var sURL = location.protocol + '//www.relevantweb.com/synergy/macrim/site/traffic.aspx?cid=19&pid=' + iPid + '&hip=&ha=' + navigator.userAgent + '&ref=' + document.referrer + '&qry=' + sQry ;


    if (document.getElementById && document.body.style) {
		el = document.getElementById("imgT");
	}
    else if (document.all && !document.getElementById) {
		el = document.all("imgT");
	}
    else if (document.layers) {
		el = document.layers("imgT");
    }
	
	if (el) {
		el.src = sURL;
	}

}
