









function getInnerText(elem) {
var _innerText = elem.innerText;
if (_innerText == undefined) {
_innerText = elem.innerHTML.replace(/<[^>]+>/g,"");
}
return elem.text ? elem.text :
elem.innerText ? elem.innerText :
elem.firstChild.nodeType == 3 ? elem.firstChild.nodeValue :
_innerText ? _innerText :
'';
}




function openWindow(page, w, h)
{
var popupWin = window.open(page, "popup", "width=" + w + ",height=" + h);
return popupWin;
}





















function openPopUpWindow(url, target, width, height, pos, menubar, toolbar, status, resizable, scrollbars)
{
features = createWindowFeatures(width, height, pos, menubar, toolbar, status, resizable, scrollbars);

return window.open(url, target, features);

}




function openHelp(width,height,anchor) {

features = createWindowFeatures(width, height, 5, 0, 0, 0, 1, 1);

if (window.help && !window.help.closed) {
help.focus();
}
help=window.open(anchor.href, anchor.target, features);
return false;
}




function openDelWindow(anchor){

features = createWindowFeatures(625, 500, 5, 0, 0, 0, 0, 1);

if(window.delWindow && !window.delWindow.closed){
delWindow.close();
}

delWindow=window.open(anchor.href,anchor.target,features);
return false;
}





















function openModalPopUpWindow(url, target, width, height, pos, menubar, toolbar, status, resizable, scrollbars)
{
features = createWindowFeatures(width, height, pos, menubar, toolbar, status, resizable, scrollbars);

if (window.infoPopup && !window.infoPopup.closed) {
infoPopup.focus();
}
url = new String(url);



if (!(window.navigator.appName == "Microsoft Internet Explorer") || url.length < 1800){
infoPopup=window.open(url, target, features);
}else{
infoPopup=window.open("", target, features);
var sourceInfoForm = infoPopup.document.createElement("form");
var queryString = url.substring(url.indexOf("?")+1);

populateFormWithQueryString(sourceInfoForm, queryString);

url = url.substring(0, url.indexOf("?"));
infoPopup.document.body.appendChild(sourceInfoForm);

sourceInfoForm.method = "POST";
sourceInfoForm.action =  url;
sourceInfoForm.target = target;
sourceInfoForm.submit();
}
return false;
}

function populateFormWithQueryString(sourceInfoForm, queryString){
var nameValuePairs = queryString.split("&");
var hiddenField;
var paramName;
var paramValue;

for(i = 0; i < nameValuePairs.length; i++){
hiddenField = infoPopup.document.createElement("input");
hiddenField.setAttribute("type", "hidden");
paramName = strtrim(unescape(nameValuePairs[i].substring(0, nameValuePairs[i].indexOf("="))));
paramValue = strtrim(unescape(nameValuePairs[i].substring(nameValuePairs[i].indexOf("=")+1)));
hiddenField.setAttribute("name", paramName);
hiddenField.setAttribute("value", paramValue);
sourceInfoForm.appendChild(hiddenField);
}
}




function openPriceInfoWindow(link) {
openModalPopUpWindow(link,'priceInformation', 500, 400, 1, 0, 0, 0, 1, 1);
return false;
}







function openSourceInfo(link, name) {

if (window.sourceInfo && !window.sourceInfo.closed) {
sourceInfo.focus();
}

if (link.href.indexOf('csis=') < 0) {
return;
}

var linkString = unescape(link.href);

var queryString = linkString.substring(linkString.indexOf('csis=') + 5, linkString.length);

var csiList = "";
if (queryString.indexOf('&') >= 0) {
csiList = queryString.substring(0, queryString.indexOf('&'));
} else {
csiList = queryString;
}

if ((name != null) && (name != "")) {
linkString = linkString + "&name=" + name;
}

if (csiList.indexOf(',') >=0 ) {
args = createSourceInfoArgs(false);
} else {
args = createSourceInfoArgs(true);
}




sourceInfo = window.open(linkString, link.target, args);
return false;
}








function openSourceInfoFromArray(href, csis) {
var singleSource = true;
var start = 0;
var end = "";
var queryString = "";

var i = 0;

while (true) {
if (csis.indexOf(',') < 0) {
if (csis.indexOf(';') > 0) {
end = csis.indexOf(';');
} else {
end = csis.length;
}
} else {
end = csis.indexOf(',');
}

if (i == 0) {
queryString += "?csis=" + csis.substring(0, end);
} else {
queryString += "," + csis.substring(0, end);
}

if (csis.indexOf(',') < 0) {
break;
}

csis = csis.substring(csis.indexOf(',') + 1, csis.length);
i++;
}

if (csis.indexOf(';') >= 0) {
name = csis.substring(csis.indexOf(';') + 1, csis.length);
queryString += "&name=" + name;
}

if (i >= 1) {
singleSource = false;
}

var args = createSourceInfoArgs(singleSource);

sourceInfo = window.open(href + queryString, 'sourceInfo', args);
return false;

}








function openSourceSingleSource(href, source) {
var end = "";
var queryString = "";
var csi = source.value;

end = csi.indexOf(';');

queryString += "?csis=" + csi.substring(0, end);

if (csi.indexOf(';') >= 0) {
name = csi.substring(csi.indexOf(';') + 1, csi.length);
queryString += "&name=" + name;
}

var args = createSourceInfoArgs(true);

sourceInfo = window.open(href + queryString, 'sourceInfo', args);
}







function createSourceInfoArgs(singleSource) {
var args;
if (singleSource) {

args = createWindowFeatures(680, 300, 1, 0, 0, 0, 1, 1);
} else {
args = createWindowFeatures(625, 200, 1, 0, 0, 0, 1, 1);
}

return args;
}







function strtrim(str) {
return str.replace(/^\s+/,'').replace(/\s+$/,'');
}



function projectIdValidationCheck(form){
if(form.projId){
if(!matchPattern(form.projId.value) || (form.projId.value == '')){
alert(projIdErrMsg);
form.projId.focus();
return false;
}
}

}



function matchPattern(value) {


var  maskStr=/^[0-9a-zA-Z=%\-&\/.'~":@\s]*$/g;

var bMatched = maskStr.exec(value);

if (!bMatched) {
return false;
}
return true;
}





















function createWindowFeatures(width, height, pos, menubar, toolbar, status, resizable, scrollbars) {
var xpos = 0;
var ypos = 0;
var xfudge = 20;
var yfudge = 40;

switch (pos) {
case 1:
xpos = 0;
ypos = 0;
break;
case 2:
xpos = (screen.width - width - xfudge) / 2;
ypos = 0;
break;
case 3:
xpos = screen.width - width - xfudge;
ypos = 0;
break;
case 4:
xpos = 0;
ypos = (screen.height - height - yfudge) / 2;
break;
case 5:
xpos = (screen.width - width - xfudge) / 2;
ypos = (screen.height - height - yfudge) / 2;
break;
case 6:
xpos = screen.width - width - xfudge;
ypos = (screen.height - height - yfudge) / 2;
break;
case 7:
xpos = 0;
ypos = (screen.height - height - yfudge);
break;
case 8:
xpos = (screen.width - width - xfudge) / 2;
ypos = (screen.height - height - yfudge);
break;
case 9:
xpos = (screen.width - width - xfudge);
ypos = (screen.height - height - yfudge -20); //Added -20 to fix window position
break;
case 10:
xpos = (screen.width - width - 10);
ypos = 0;
break;
}


args= "width="      + width +
",height="    + height +
",screenx="   + xpos +
",left="      + xpos +
",screeny="   + ypos +
",top="       + ypos +
",menubar="   + menubar +
",toolbar="   + toolbar +
",status="    + status +
",resizable=" + resizable +
",scrollbars=" + scrollbars;
return args;
}

function openTerms(anchor) {
features = createWindowFeatures(800, 400, 9, 0, 0, 0, 1, 1);

if (window.help && !window.help.closed) {
help.focus();
}
help=window.open(anchor.href, anchor.target, features);
return false;
}



function openMarketingLink(anchor) {
features = createWindowFeatures(800, 400, 9, 0, 0, 0, 1, 1);
anchor.target = "_external";
if (window.marketing && !window.marketing.closed) {
marketing.focus();
}
marketing=window.open(anchor.href, anchor.target, features + ",location=yes");
return false;
}



function openCopyright(anchor) {
features = createWindowFeatures(620, 400, 5, 0, 0, 0, 1, 1);

if (window.help && !window.help.closed) {
help.focus();
}
help=window.open(anchor.href, anchor.target, features);
return false;
}





function isBlank(s) {

for(var i = 0; i < s.length; i++) {
var c = s.charAt(i);
if((c != ' ') && (c != '\n') && (c != '\t')) {
return false;
}
}
return true;
}








function inList(list, value) {

for (i = 0; i < list.length; i++) {
if (list[i].value == value) {
return true;
}
}
return false;
}








function fnSubmitPrefDefaults(){
var prefform=document.forms['preferences_PreferenceHandlerForm'];
for(i=0;i<prefform.elements.length;i++){
prefform.elements[i].disabled=false;
}
}

function submitFormName(formObj,url){
fnSubmitPrefDefaults();
formObj.action=url;
formObj.method="POST";
formObj.submit();
}

function showMessage(mouseKey){
var str = mouseKey;

if(document.all){
document.all("layer3").innerHTML = str;
document.all("layer3").style.visibility="visible"
}
else{
document.getElementById("layer3").innerHTML = str;
document.getElementById("layer3").style.visibility="inherit";
}
}

function hideMessage(){
if(document.all){
document.all("layer3").style.visibility="hidden";
}
else{
document.getElementById("layer3").style.visibility="hidden";
}
}

function showOrHideLayer(layerName, show) {
var ns = (document.layers)? true:false;
var ie = (document.all)? true:false;

if (!show) {
if (ns)
eval("document.getElementById('" + layerName + "').style.visibility='hidden'");
else if(ie)
eval("document.all['" + layerName + "'].style.visibility='hidden'");
}
if (show) {
if (ns){
obj = eval("document.getElementById('" + layerName + "').style.visibility='visible'");
}
else if(ie)
eval("document.all['" + layerName + "'].style.visibility='visible'");
}
}
var DAMATAConfirmWindow;


var continueClicked = false;


function handleTransWarnContinue(formName,displayDamata,transWarnPopUpFlag, path){

var url = document.commonui_TransWarnHandlerForm.continueURL.value;


if (displayDamata=="true" && document.commonui_TransWarnHandlerForm.damataFlag.checked){
DAMATAConfirmWindow=openPopUpWindow(path+"/common/confirmDAMATA.do","",505,180,2,0,0,0,0,0)
} else {

if(transWarnPopUpFlag=="true"){

closeAllPopUps(formName,path+url);
}


else if(!continueClicked){
document.getElementById("enabledContinue").style.display = 'none';
document.getElementById("disabledContinue").style.display = '';
continueClicked = true;


document.commonui_TransWarnHandlerForm.action=path + url;

window.location.replace(document.commonui_TransWarnHandlerForm.action); return false;

document.commonui_TransWarnHandlerForm.submit();
}
}
}
function handleTransWarnCancel(url,cancelViaHistoryFlag, path){
document.commonui_TransWarnHandlerForm.cancelWarning.value='true';
if (url != ""){

document.commonui_TransWarnHandlerForm.action=path + url+"&cancelWarning=true";
document.commonui_TransWarnHandlerForm.submit();

}else{
if (cancelViaHistoryFlag=="true"){
history.go(-1);
}else{
window.close();
}
}
if(DAMATAConfirmWindow != null){
DAMATAConfirmWindow.close();
}
}

function handleConfirmDAMATA(path){

var formName=opener.document.commonui_TransWarnHandlerForm.formName.value;

var transWarnPopUpFlag=opener.document.commonui_TransWarnHandlerForm.transWarnPopUpFlag.value;

if (transWarnPopUpFlag=="true"){

opener.closeAllPopUps(formName,path+"/common/transWarnHandler.do");
}else{
opener.document.commonui_TransWarnHandlerForm.action=path+"/common/transWarnHandler.do";
opener.document.commonui_TransWarnHandlerForm.submit();
window.close();
}
}
function closeAllPopUps(formName,url){

window.focus();
if(window.DAMATAConfirmWindow != null){

window.DAMATAConfirmWindow.close();
}
window.close();

opener.document.forms[formName].action=url;
opener.document.forms[formName].submit();


}


function openSourceInfoWindow(url){




if (window.navigator.appName == "Microsoft Internet Explorer"){
openModalPopUpWindow(url,'sourceInformation', 500, 670, 1, 0, 0, 0, 1, 1);
}else{
openModalPopUpWindow(url,'sourceInformation', 500, 768, 1, 0, 0, 0, 1, 1);
}




return false;
}

function openExternalLink(url)
{

var str_target = "_external";
var int_winWidth  = 625;
var int_winHeight = 460;
var str_attribute = "top=0,left=0,toolbar=yes,scrollbars=yes,location=yes,resizable=yes,menubar=yes,width="+int_winWidth+",height="+int_winHeight;

var winVar = window.open(url,str_target,str_attribute);
winVar.focus();
}



function openExternalRelatedLink(url,contextRoot, urlsecuritykey)
{


var str_target = "_external";
var int_winWidth  = 625;
var int_winHeight = 460;
var str_attribute = "top=0,left=0,toolbar=yes,scrollbars=yes,location=yes,resizable=yes,menubar=yes,width="+int_winWidth+",height="+int_winHeight;




url = urlEncoding(url);





url = replaceAll(url,"&","%26");

url = contextRoot+ "/redirect.do?urlSecurityKey=" + urlsecuritykey + "&url=" + url;


var winVar = window.open(url,str_target,str_attribute);

winVar.focus();
}



function urlEncoding(inputString){
var encodedString = escape(inputString);


encodedString = encodedString.replace("+", "%2B");
encodedString = encodedString.replace("/", "%2F");

return encodedString;
}



function openHelpLink(width,height,anchor){


anchor.target="help";
return openHelp(width,height,anchor);
}

function openTutorialLink(url)
{

var str_target = "_lookup";
var int_winWidth  = 560;
var int_winHeight = 350;
var var_win_left = screen.width - 560;
var_win_left = var_win_left - 10;
var str_attributes = "width="+int_winWidth+",height="+int_winHeight+",top=0,left="+var_win_left+",resizable=yes";
var root_url = url;
var hlpWin = window.open(root_url,str_target,str_attributes);
hlpWin.focus();
return false;
}

function openInformationLink(url)
{
regex = /%/g;
url=url.replace(regex,"%25");
regex = /#/g;
url=url.replace(regex,"%23");
regex = /`/g;
url=url.replace(regex,"'");

var str_target = "_info";
var int_winWidth  = 500;
var int_winHeight = 400;
var str_attribute = "top=0,left=0,scrollbars=yes,resizable=yes,width="+int_winWidth+",height="+int_winHeight;

var winVar = window.open(url,str_target,str_attribute);
winVar.focus();
}

function openTransWarn(anchor)
{
return openHelp(anchor);
}






function upCbox(chkBoxObj,hiddenProperty,separator){


var chkbxElem;

var strChkbox="";
var allchecked=false;
var chkBoxArray = document.getElementsByName(chkBoxObj.name);

for (var chkBoxLength = 0;chkBoxLength < chkBoxArray.length;chkBoxLength++){

chkbxElem = chkBoxArray[chkBoxLength];
if ((chkbxElem.type == 'checkbox') && (chkbxElem.checked) && (chkbxElem.name = chkBoxObj.name)){

if (strChkbox == ""){
strChkbox = chkbxElem.value;
}else {
strChkbox = strChkbox + separator + chkbxElem.value;

}
}
}






document.getElementById(hiddenProperty).value = strChkbox;





}

function upCboxAllPresent(chkBoxObj,hiddenProperty,separator){

var chkbxElem;

var strChkbox="";
var allchecked=true;
var chkBoxArray = document.getElementsByName(chkBoxObj.name);

for (var chkBoxLength = 0;chkBoxLength < chkBoxArray.length;chkBoxLength++){

chkbxElem = chkBoxArray[chkBoxLength];
if ((chkbxElem.type == 'checkbox') && (chkbxElem.checked) && (chkbxElem.name = chkBoxObj.name)){

if (strChkbox == ""){
strChkbox = chkbxElem.value;
}else {
strChkbox = strChkbox + separator + chkbxElem.value;

}
} else {
if(chkbxElem.id != 'hiddenChkList') {
allchecked=false;
}
}
}
var allCHkBoxObj = document.getElementById('allChkBox');
if(allchecked){
document.getElementById(hiddenProperty).value = allValue;

for (var chkBoxLength = 0;chkBoxLength < chkBoxArray.length;chkBoxLength++){

chkbxElem = chkBoxArray[chkBoxLength];
if ((chkbxElem.type == 'checkbox') && (chkbxElem.checked) && (chkbxElem.name = chkBoxObj.name)&& (chkbxElem.id != 'hiddenChkList')){
chkbxElem.checked=false;
}else{
if ((chkbxElem.id == 'hiddenChkList')){

chkbxElem.checked = true;
}
}

}
allCHkBoxObj.checked=true;
}else {
for (var chkBoxLength = 0;chkBoxLength < chkBoxArray.length;chkBoxLength++){
chkbxElem = chkBoxArray[chkBoxLength];

if ((chkbxElem.type == 'checkbox') && (chkbxElem.checked) && (chkbxElem.name = chkBoxObj.name) && (chkbxElem.id == 'hiddenChkList')){
chkbxElem.checked = false;

}
}
document.getElementById(hiddenProperty).value = strChkbox;
allCHkBoxObj.checked=false;
}










}




function deSelectAllCbox(chkBoxObj){

var chkBoxArray = document.getElementsByName('sourceList');
var allCHkBoxObj = document.getElementById('allChkBox');

var noneChecked=true;
for(var i=0; i<chkBoxArray.length; i++){
if(chkBoxArray[i].checked == true){
noneChecked = false;
break;
}
}

if(noneChecked == true){
allCHkBoxObj.checked = true;
}


}




function upAllCbox(chkBoxName,hiddenProperty,separator){


var chkbxElem;

var strChkbox="";
var chkBoxArray = document.getElementsByName(chkBoxName);
var HiddenChkBoxArray = document.getElementById('hiddenChkList');
var allCHkBoxObj = document.getElementById('allChkBox');

if ((allCHkBoxObj.type == 'checkbox') && (allCHkBoxObj.checked)) {
document.getElementById(hiddenProperty).value = allValue;
for (var chkBoxLength = 0;chkBoxLength < chkBoxArray.length;chkBoxLength++){

chkbxElem = chkBoxArray[chkBoxLength];
if ((chkbxElem.type == 'checkbox') && (chkbxElem.checked) && (chkbxElem.name = chkBoxName) && (chkbxElem.id != 'hiddenChkList')){
chkbxElem.checked = false;




boxArray = document.getElementsByName(chkBoxName);

for(i = 0; i < boxArray.length; i++){
if(boxArray[i].disabled = true){
boxArray[i].disabled = '';
}
}




} else{
if ((chkbxElem.id == 'hiddenChkList')){

chkbxElem.checked = true;
}
}

}
allCHkBoxObj.checked=true;
} else {
for (var chkBoxLength = 0;chkBoxLength < chkBoxArray.length;chkBoxLength++){

chkbxElem = chkBoxArray[chkBoxLength];
if ((chkbxElem.type == 'checkbox') && (chkbxElem.checked) && (chkbxElem.name = chkBoxName) && (chkbxElem.id == 'hiddenChkList')){
chkbxElem.checked = false;

}
}


document.getElementById(hiddenProperty).value='';
}
}
























var winModalWindow;

function IgnoreEvents(e){
return false;
}

function showNSWindow(url, name, width, height, xposition, yposition, attr){
var args = "width=" + width + ",height=" + height
+ ",screenx=" + xposition + ",screeny=" + yposition
+ ",left="+ xposition +",top="+yposition + attr;
winModalWindow = window.open (url,name,args);
winModalWindow.focus();
}


function handleFocus(){
if (winModalWindow){
if (!winModalWindow.closed){

setTimeout("winModalWindow.focus()", 1);
}
}
return false;
}


function showIEWindow(url, name, width, height, xposition, yposition, attr) {
if (!winModalWindow || (winModalWindow && winModalWindow.closed)) {
var args = "left=" + xposition + ",top=" + yposition
+ ",resizable=no,width=" + width + ",height=" + height + attr;

winModalWindow=window.open(url, name, args);
winModalWindow.focus();
} else {
winModalWindow.focus();
}
}



function checkModal() {
setTimeout("finishChecking()", 1);
return true
}

function finishChecking() {
if (winModalWindow && !winModalWindow.closed) {
winModalWindow.focus();
}
}

function showModalWindow(url, name, width, height, xposition, yposition, attr){
if(document.all || ((navigator.appVersion.indexOf("Mac") > 0) && (navigator.appVersion.indexOf("Safari") > 0))){
showIEWindow(url, name, width, height, xposition, yposition, attr);
} else {
showNSWindow(url, name, width, height, xposition, yposition, attr);
}
}












function scrollToSkipLink(anchorname){

document.location.hash = "#"+ anchorname;
}








function openViewTutorialLink(url) {
var str_target = "_external";
features = createWindowFeatures(560, 350, 10, 0, 0, 0, 1, 1);

if (window.help && !window.help.closed) {
help.focus();
}

help=window.open(url, str_target, features);
}


function dataMiningSubmit(){

var redButton = document.getElementById("enableSearchImg");
var greyButton = document.getElementById("disableSearchImg");

if((trimSpaces(document.forms[0].securityText.value)) != "") {
greyButton.style.display="";
redButton.style.display="none";
document.forms[0].submit();
}
else{
alert("Please enter the security sequence.");
greyButton.style.display="none";
redButton.style.display="";
document.forms[0].securityText.focus();
}

}


function subContinueEnterKeyPressHandler(e)
{
KeyCode = (window.Event? e.which : event.keyCode);
var redButton = document.getElementById("enableSearchImg");
var greyButton = document.getElementById("disableSearchImg");

if(KeyCode == 13) {

if(trimSpaces(document.forms[0].securityText.value)!= "")
{

greyButton.style.display="";
redButton.style.display="none";

document.forms[0].submit();
}
else
{
alert("Please enter the security sequence.");
greyButton.style.display="none";
redButton.style.display="";
document.forms[0].securityText.focus();
return false;
}

}
}
function setCursorText(){
document.forms[0].securityText.focus();
}

function trimSpaces(str) {
return str.replace(/^\s+/,'').replace(/\s+$/,'');
}


function openNoDocsDeliveryWindow(noDocsDelUrl) {
features = createWindowFeatures(625, 500, 5, 0, 0, 0, 0, 1);

delWindow = window.open("", "delivery", features);
delWindow.focus();

delWindow.location.href = noDocsDelUrl;
}



function goToPreviousPage() {
history.go(-1);
}



function retrieveMktgPopupInfo(targetUrl){
var ajaxContent = {};
var ajaxURL = targetUrl;
var ajaxUseCache = false;
var ajaxPreventCache = true;
var ajaxMimeType = "text/html";
var ajaxTransport = "XMLHTTPTransport";
var ajaxMethod = "POST";
var ajaxReturnHandlerFunction = constructMktgPopupInfo;
submitAjaxCall(ajaxContent, ajaxURL, ajaxUseCache, ajaxPreventCache, ajaxMimeType, ajaxTransport, ajaxMethod, ajaxReturnHandlerFunction);
}

function constructMktgPopupInfo(type, data, evt){
var MktgMessage = document.getElementById("tsppopup");
var MktgDiv = document.getElementById("mktgBkg");
if (type == 'error') {
MktgDiv.style.display = 'none';
MktgMessage.style.display = 'none';
}


MktgMessage.innerHTML = data;
var dataContent = data.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
if (dataContent.indexOf('dontShowPopup') == -1) {
MktgDiv.style.display = '';
MktgMessage.style.display = '';
fnSelectToggle(document,true);
showhideSelect(true);
}
}



function closeMrktgPopUp() {
document.getElementById("tsppopup").style.display='none';
document.getElementById("mktgBkg").style.display='none';
fnSelectToggle(document,false);
showhideSelect(false);

return false;
}



function showhideSelect(f_boolean){
var iframeArr = document.getElementsByTagName("iframe");

for (ifrm=0;ifrm<iframeArr.length;ifrm++) {
if (iframeArr[ifrm].contentDocument)
var iframeObj = iframeArr[ifrm].contentDocument;
else if (iframeArr[ifrm].contentWindow)
var iframeObj = iframeArr[ifrm].contentWindow.document;
else if (iframeArr[ifrm].document)
var iframeObj = iframeArr[ifrm].document;
else var iframeObj = null;

fnSelectToggle(iframeObj,f_boolean);
}

}



function fnSelectToggle(Obj,var_boolean) {

var selArr = Obj.getElementsByTagName("select");
for (oi=0;oi<selArr.length;oi++) {

thisObj = selArr[oi];
if (var_boolean) {
thisObj.style.display = "none";
} else {
thisObj.style.display = "";
}

}

}









var chkbxsObject = document.getElementsByName("chkPrjId");
var alertMsg;



function submitToEditPID(){
var str = document.getElementById('editPID');
str.value = true;
document.forms[0].action = 'auth/pidhandler.do';
document.forms[0].ef.value='';
document.forms[0].submit();
}




function allAffected(){
var chkBoxMainObj = document.getElementById("allCheck");

if(chkBoxMainObj.checked){
document.getElementById('enabledDelBtn').style.display = '';
document.getElementById('disabledDelBtn').style.display = 'none';
if(chkbxsObject){
for(var i=0;i<chkbxsObject.length;i++){
if(!chkbxsObject[i].disabled){
chkbxsObject[i].checked = true;
}
}
}
}else{
document.getElementById('enabledDelBtn').style.display = 'none';
document.getElementById('disabledDelBtn').style.display = '';
if(chkbxsObject){
for(var i=0;i<chkbxsObject.length;i++){
chkbxsObject[i].checked = false;
}
}
}
}



function enableDeleteBtn(){
var isChecked = false;
var allChecked = true;
if(chkbxsObject){
for(var i=0;i<chkbxsObject.length;i++){
if(chkbxsObject[i].checked){
isChecked = true;
}else{
allChecked = false;
}
}
}
if(allChecked){
document.getElementById("allCheck").checked = true;
}else{
document.getElementById("allCheck").checked = false;
}
if (isChecked) {
document.getElementById('enabledDelBtn').style.display = '';
document.getElementById('disabledDelBtn').style.display = 'none';
} else {
document.getElementById('enabledDelBtn').style.display = 'none';
document.getElementById('disabledDelBtn').style.display = '';
}
}


function replaceAll(OldString, FindString, ReplaceString) {
var SearchIndex = 0;
var NewString = "";

while (OldString.indexOf(FindString,SearchIndex) != -1)    {
NewString += OldString.substring(SearchIndex,OldString.indexOf(FindString,SearchIndex));
NewString += ReplaceString;
SearchIndex = (OldString.indexOf(FindString,SearchIndex) + FindString.length);
}

NewString += OldString.substring(SearchIndex,OldString.length);
return NewString;
}




function checkForNonLatin1(searchString){
var matchfound = false;
searchStringLength = searchString.length;
for(var index=0; index<searchStringLength; index++){
if(searchString.charCodeAt(index)>255){
matchfound = true;
break;
}
}
return matchfound;
}




function fnSubmit11(e,submitAction) {
var KeyCode = null;
KeyCode = (window.Event? e.which : event.keyCode);
if(KeyCode == 13){
trimfunction(submitAction);
}
}

function trimfunction (submitAction){

var elem = document.getElementById('newProjectId');
if(elem) {
elem.value = elem.value.replace(/^[\s]+/g,"");
elem.value = elem.value.replace(/[\s]+$/g,"");
}


document.forms[0].action = submitAction;
document.forms[0].submit();
}

