<!-- MENU-LOCATION=NONE -->
<html xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
<head>
<!-- Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved. -->
<title><MMString:LoadString id="insertbar/textLI" /></title>
<script type="text/javascript" src="../../Shared/Common/Scripts/dwscripts.js"></script>

<script language="javascript">

//---------------     API FUNCTIONS    ---------------

function isDOMRequired() { 
	// Return false, indicating that this object is available in code view.
	return false;
}

function objectTag()
{
    var curDom = dw.getActiveWindow();
	if (curDom.isFluidGridDoc() ) {
		dreamweaver.popupCommand( "InsertFGLI.htm" );
	}
	else {
		// Manually wrap tags around selection.
        var upCaseTag = (dw.getPreferenceString("Source Format", "Tags Upper Case", "") == 'TRUE');
        if(dw.getActiveTarget() == "live"){
            var tagName = upCaseTag ? 'LI' : 'li';
			var content = dw.loadString('insertbar/div/divContent');
			content = content.replace(/%1/, tagName);
            dw.createRunTagFromTextAndInsert(tagName,content);
            return;
        }
        
		var dom = dw.getDocumentDOM();
        if (dw.getFocus() == 'textView' || dw.getFocus(true) == 'html'){
			insertLI(dom);
		}else if (dw.getFocus() == 'document'){
			dom.setView('split'); // switch to split
            dw.setFocus('textView'); // set focus to code view
			dom.source.updateSelectionFromDOM();
			insertLI(dom);
			dom.source.syncCodeToDOM();
		}
  }

  // Just return -- don't do anything else.
  return;
}

function insertLI(dom) {
	var upCaseTag = (dw.getPreferenceString("Source Format", "Tags Upper Case", "") == 'TRUE');
	// Manually wrap tags around selection.
	if (upCaseTag){
		dom.source.wrapSelection('<LI>','</LI>');
	}else{
		dom.source.wrapSelection('<li>','</li>');
	}
}

</script>
	
</head>

<body>
</body>

</html>
