﻿var objHidKeyWord;var objTxtKeyword;function AddKeywords(HidStrKeywordsID,TxtKeywordID){var strHTML="";var ColumnId=0;objHidKeyWord=document.getElementById(HidStrKeywordsID);objTxtKeyword=window.document.getElementById(TxtKeywordID);if(typeof(objHidKeyWord)=='object'){if(typeof(objTxtKeyword)=='object'){if(objTxtKeyword.value!="Please enter searchable keywords here. Words entered here will only apply to this item."&& objTxtKeyword.value!="Please enter searchable keywords here. Words entered will apply to all items."){var arrayKeywords=objTxtKeyword.value.split(",");var totalNoRows=arrayKeywords.length;for(rowCount=0;rowCount<totalNoRows;rowCount++){var regexpr='\\b'+arrayKeywords[rowCount]+'\\b';var myRegExp=new RegExp(regexpr,"gi");if(objHidKeyWord.value.search(myRegExp)==-1){if(objHidKeyWord.value==undefined||objHidKeyWord.value==""){objHidKeyWord.value=arrayKeywords[rowCount]}else if(objTxtKeyword.value!=""){objHidKeyWord.value=objHidKeyWord.value+','+arrayKeywords[rowCount]}}}objTxtKeyword.value=""}strKeywords=objHidKeyWord.value;arrayKeywords=strKeywords.split(",");var TableKeyword=window.document.getElementById("TableKeyword");totalNoRows=arrayKeywords.length;strHTML='<div style="height:60"><table cellspacing=2><tr>';for(rowCount=0;rowCount<totalNoRows;rowCount++){if(arrayKeywords[rowCount]!=""){if(ColumnId<3){strHTML=strHTML+'<td width="10"></td>';strHTML=strHTML+'<td style="width:60"><span title="'+arrayKeywords[rowCount]+'" style="width:60;color:Black;white-space:nowrap">'+arrayKeywords[rowCount].substring(0,12)+'</span></td>';strHTML=strHTML+'<td width="10"></td>';strHTML=strHTML+'<td><input type= "image"  id='+rowCount+' src="../Images/btn_delete.gif" onclick="javascript:RemoveKeyword(this);return false;"></td>';ColumnId++;}else{ColumnId=0;strHTML=strHTML+'</tr><tr>';strHTML=strHTML+'<td width="10"></td>';strHTML=strHTML+'<td><span title="'+arrayKeywords[rowCount]+'" style="width:60;color:Black;white-space:nowrap">'+arrayKeywords[rowCount].substring(0,12)+'</span></td>';strHTML=strHTML+'<td width="10"></td>';strHTML=strHTML+'<td style="width:60"><input type= "image"  id='+rowCount+' src="../Images/btn_delete.gif" onclick="javascript:RemoveKeyword(this); return false;")</td>';ColumnId++;}}}strHTML=strHTML+'</tr></table></div>';}TableKeyword.innerHTML=strHTML;}}function RemoveKeyword(cntrlObj){if(document.getElementById(document.getElementById("hdnIDForHdnEnabled").value).value+""=="false"){AddKeywords(objHidKeyWord.id,objTxtKeyword.id);}else{var strKeywords=objHidKeyWord.value;var arrayKeywords=strKeywords.split(",");strKeywords="";var totalNoRows=arrayKeywords.length;for(rowCount=0;rowCount<totalNoRows;rowCount++){if(cntrlObj.id!=rowCount){if(strKeywords==""){strKeywords=strKeywords+arrayKeywords[rowCount];}else{strKeywords=strKeywords+','+arrayKeywords[rowCount];}}}objHidKeyWord.value=strKeywords;AddKeywords(objHidKeyWord.id,objTxtKeyword.id);}}function ParseXml(){if(window.ActiveXObject){var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;}else if(document.implementation&& document.implementation.createDocument){var xmlDoc=document.implementation.createDocument("","doc",null);}xmlDoc.load("Help.xml");var oIterate=xmlDoc.getElementsByTagName('Help');while((elm=oIterate.item([i++]))){var attr=elm.getAttributeNode("Id");if(attr.value=="1")alert(attr.childnodes["Title"].value);}}var charsLeft=0;function GetRemainingChars(objtxt,objCharLeft,maxChars){alert(maxChars);var currentChars=objtxt.value.length;charsLeft=Math.max((maxChars-currentChars),0);if(currentChars>maxChars){objtxt.value=objtxt.value.substring(0,maxChars);}var objectCharLeft=document.getElementById(objCharLeft)objectCharLeft.innerText=charsLeft+" chars Remaining";}function setOnFocus(txt,text){if(txt.value==text){txt.value="";}}function setOnBlur(txt,text){if(txt.value==""){txt.value=text;}}
