ipjUA=navigator.userAgent;
ipjIsIE = (navigator.appName == "Microsoft Internet Explorer");
ipjIsIE5 = ipjIsIE && (ipjUA.indexOf('MSIE 5') != -1);
ipjIsIE5_0 = ipjIsIE && (ipjUA.indexOf('MSIE 5.0') != -1);
ipjIsIE7 = ipjIsIE && (ipjUA.indexOf('MSIE 7') != -1);
ipjIsGecko = ipjUA.indexOf('Gecko') != -1; // Will also be true on Safari
ipjIsSafari = ipjUA.indexOf('Safari') != -1;
ipjIsOpera = window['opera'] && opera.buildNumber ? true : false;
ipjIsMac = ipjUA.indexOf('Mac') != -1;
ipjIsNS7 = ipjUA.indexOf('Netscape/7') != -1;
ipjIsNS71 = ipjUA.indexOf('Netscape/7.1') != -1;
function ipjAddEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, false);
return true;
}
else{
if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
}
else return false;
}
}
function ipjCancelEvent(event){
if (window.event && window.event.cancelBubble !==null) window.event.cancelBubble=true;
else if (event!=null && event.stopPropagation) event.stopPropagation();
}
if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement) {
HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode)
{
switch (where){
case 'beforeBegin':
this.parentNode.insertBefore(parsedNode,this)
break;
case 'afterBegin':
this.insertBefore(parsedNode,this.firstChild);
break;
case 'beforeEnd':
this.appendChild(parsedNode);
break;
case 'afterEnd':
if (this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);
else this.parentNode.appendChild(parsedNode);
break;
}
}
HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr)
{
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML=r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where,parsedHTML)
}
HTMLElement.prototype.insertAdjacentText=function(where,txtStr)
{
var parsedText=document.createTextNode(txtStr)
this.insertAdjacentElement(where,parsedText)
}
}
function ipjSetElementInnerHTMLGecko(element,htmlStr)
{
var range=element.ownerDocument.createRange();
range.selectNodeContents(element);
range.deleteContents();
var newFragment=range.createContextualFragment(htmlStr);
element.appendChild(newFragment);
};
function ipjGetElementOuterHTMLGecko(element)
{
var range=document.createRange();
range.selectNode(element);
var span = document.createElement("span");
range.surroundContents(span);
var strOuterHtml=span.innerHTML;
range.selectNode(span);
range.extractContents();
range.insertNode(element);
return strOuterHtml;
};
function ipjGetHtmlTextOfRangeGecko(range)
{
var clonedSelection=range.cloneContents();
var div = document.createElement('div');
div.appendChild(clonedSelection);
return div.innerHTML;
}
function ipjFindObj(n, d){
if(n==null) return n;
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
}
if(!(x=d[n])&&d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=ipjFindObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n);
return x;
}
function ipjJumpMenu(targ,selObj,restore){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
var IPJ_DELETED_ROW_FLAG=999999
var ipjDisableGridCellChangedHandler=false;
function ipjGetGridIdByControlId(ctrlId){
var foundGridId = "";
var gridId;
for (gridId in igtbl_gridState){
if (gridId.replace(/[_x]/g,"").replace(/grdTable/g,"")==ctrlId.replace(/[_x]/g,"").replace(/grdTable/g,"")) {
foundGridId=gridId;
break;
}
}
if (foundGridId=="") alert('Unable to identify grid - ' + ctrlId);
return foundGridId;
}
function ipjCellClickEditMode(GridID, CellID)
{
var column=igtbl_getColumnById(CellID);
if (column.HeaderText != 'Order') {
if (column.DataType==8){
igtbl_EnterEditMode(GridID);
};
};
};
function ipjAfterExitEditModeHandler(GridID, CellID)
{
__doPostBack('', '');
};
function ipjOrderedGridCellChangedHandler(GridID, CellID)
{
if (ipjDisableGridCellChangedHandler==true) return;
var cell=igtbl_getCellById(CellID);
var grid=igtbl_getGridById(ipjGetGridIdByControlId(GridID));
var count=grid.Rows.length;
if (cell.Column.Index==1){
var row=igtbl_getRowById(CellID);
if((cell.getValue()>0) && (cell.getValue()<=count)){
ipjMoveTableRow( GridID, (row.getIndex()+1), cell.getValue());
}
else{
ipjMoveTableRow( GridID, (row.getIndex()+1), (row.getIndex()+1));
}
}
};
function iGetRowOrderHTML(gridName, index, count)
{
var intUpArrowTo=index-1;
var intOrder=index;
var intDownArrowTo=index+1;
index--;
count--;
var strLead = '<table class="ipb-no" cellspacing="0" cellpadding="0"><tr><td><table class="ipb-no" cellSpacing="0" cellPadding="0" width="10">';
var strMidRow = '<tr><td>' + ipGridImgPxH2 + '</td></tr>';
var strOrderNumLink =  '<A class="ipb" title="Click to move." href="javascript:igtbl_EnterEditMode(\'' + gridName + '\');">' + intOrder + '</A>';
var strTail = '</td></tr></table>';
if((index==0) && (index!=count))
{
return strLead+
'<tr><td>' + ipGridImgPxH9 + '</td></tr>' +
strMidRow+
"<tr><td><A class=\"ipb\" href=\"javascript:ipjMoveTableRow('" + gridName + "', " + intOrder + ", " + intDownArrowTo + ");\">" + ipGridImgDn + "</A></td></tr>" +
"</table></td><td width=\"8\">&nbsp;</td><td>" + strOrderNumLink + strTail;
}
else
{
if((index!=0) && (index!=count))
{
return strLead+
"<tr><td><A class=\"ipb\" href=\"javascript:ipjMoveTableRow('" + gridName + "', " + intOrder + ", " + intUpArrowTo + ");\">" + ipGridImgUp + "</td></tr>" +
strMidRow+
"<tr><td><A class=\"ipb\" href=\"javascript:ipjMoveTableRow('" + gridName + "', " + intOrder + ", " + intDownArrowTo + ");\">" + ipGridImgDn + "</td></tr>" +
"</table></td><td width=\"8\">&nbsp;</td><td>" + strOrderNumLink + strTail;
}
else
{
if((index!=0) && (index==count))
{
return strLead+
"<tr><td><A class=\"ipb\" href=\"javascript:ipjMoveTableRow('" + gridName + "', " + intOrder + ", " + intUpArrowTo + ");\">" + ipGridImgUp + "</td></tr>" +
strMidRow+
"<tr><td>&nbsp;</td></tr>" +
"</table></td><td width=\"8\">&nbsp;</td><td>" + strOrderNumLink + strTail;
}
else
{
return intOrder;
}
}
}
};
function ipjGetDeletedRowCount(grid)
{
var count=0;
for (var i=0; i<grid.Rows.length; i++){
if (grid.Rows.getRow(i).getCellFromKey("HiddenSortOrder").getValue()==IPJ_DELETED_ROW_FLAG) {
count++;
}
}
return count;
}
function ipjGetActiveRowCount(grid)
{
return grid.Rows.length-ipjGetDeletedRowCount(grid);
}
function ipjMoveTableRow(gridName, indexFrom, indexTo)
{
indexFrom=Math.floor(indexFrom*1);
indexTo=Math.floor(indexTo*1);
if (indexTo<=0) indexTo=1;
var grid=igtbl_getGridById(ipjGetGridIdByControlId(gridName));
var row;
var count=ipjGetActiveRowCount(grid);
if(grid==null) return;
if(count==0) return;
if(indexFrom==0) return;
if(indexTo==0) return;
if(indexFrom>count) return;
if(indexTo>count) return;
ipjDisableGridCellChangedHandler=true;
grid.suspendUpdates(true);
if(indexFrom==indexTo)
{
row=grid.Rows.getRow(indexFrom-1);
row.getCell(0).setValue(indexTo);
row.getCell(1).setValue(indexTo);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, indexTo, count);
}
else
{
if(((indexFrom+1)==indexTo) || ((indexFrom-1)==indexTo) )
{
var intNewPos=indexTo;
if (indexFrom<indexTo)
{
row=grid.Rows.getRow(indexFrom-1);
row.getCell(0).setValue(intNewPos);
row.getCell(1).setValue(intNewPos);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, intNewPos, count);
row=grid.Rows.getRow(indexTo-1);
row.getCell(0).setValue(intNewPos-1);
row.getCell(1).setValue(intNewPos-1);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, intNewPos-1, count);
}
else
{
row=grid.Rows.getRow(indexTo-1);
row.getCell(0).setValue(intNewPos+1);
row.getCell(1).setValue(intNewPos+1);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, intNewPos+1, count);
row=grid.Rows.getRow(indexFrom-1);
row.getCell(0).setValue(intNewPos);
row.getCell(1).setValue(intNewPos);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, intNewPos, count);
}
}
else
{
var start=1;
var IsMovingDown;
if(indexFrom>indexTo)
{
IsMovingDown=false;
}
else
{
IsMovingDown=true;
}
row=grid.Rows.getRow(indexFrom-1);
row.getCell(0).setValue(indexTo);
row.getCell(1).setValue(indexTo);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, indexTo, count);
for(i=0; i<count; i++)
{
if(IsMovingDown)
{
if (i!=indexFrom-1)
{
row=grid.Rows.getRow(i);
if(i<=indexTo-1)
{
row.getCell(0).setValue(start);
row.getCell(1).setValue(start);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, start, count);
}
else
{
row.getCell(0).setValue(start+1);
row.getCell(1).setValue(start+1);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, start+1, count);
}
start++;
}
}
else
{
if(i!=indexFrom-1)
{
row=grid.Rows.getRow(i);
if(i<=indexTo-2)
{
row.getCell(0).setValue(start);
row.getCell(1).setValue(start);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, start, count);
}
else
{
row.getCell(0).setValue(start+1);
row.getCell(1).setValue(start+1);
row.getCell(1).Element.innerHTML=iGetRowOrderHTML(gridName, start+1, count);
}
start++;
}
}
}
}
}
grid.suspendUpdates(false);
ipjDisableGridCellChangedHandler=false;
var hiddenColumn=grid.Bands[0].Columns[0];
hiddenColumn.SortIndicator = 0; // 1 means "ascending"
grid.sortColumn(grid.Bands[0].Columns[0].Id);
grid.sort();
document.body.style.cursor = "default";
};
function ipjGridFindClear(gridName, textBoxName)
{
var grid=igtbl_getGridById(ipjGetGridIdByControlId(gridName));
var textbox=ipjFindObj(textBoxName);
var row;
for (i=0;i<rows.length;i++)
{
row=grid.Rows.getRow(i);
}
igtbl_clearSelectionAll(gridName);
};
function ipjGridSelectDeselectColumn(gridName, columnName)
{
var grid=igtbl_getGridById(ipjGetGridIdByControlId(gridName));
var blnAllSelected=true;
for (i=0; i<grid.Rows.length; i++){
if (grid.Rows.getRow(i).getCellFromKey(columnName).isEditable()){
if (grid.Rows.getRow(i).getCellFromKey(columnName).getValue()==0){
blnAllSelected=false;
break;
}
}
}
for (i=0; i<grid.Rows.length; i++){
if (grid.Rows.getRow(i).getCellFromKey(columnName).isEditable()){
grid.Rows.getRow(i).getCellFromKey(columnName).setValue(!blnAllSelected);
}
}
};
function ipjDebugGridAlert(gridName, cellCount)
{
var grid=igtbl_getGridById(ipjGetGridIdByControlId(gridName));
var msg="";
if (cellCount==null) cellCount=1;
for( var rowIndex=0; rowIndex<grid.Rows.length; rowIndex++)
{
msg+="\nRow_" + rowIndex +": ";
for( var cellIndex=0; cellIndex<cellCount; cellIndex++)
{
msg+="   " + (grid.Rows.getRow(rowIndex).getCell(cellIndex).getValue()+"").replace(/[^A-Za-z_0-9]/g,"");
}
}
alert(msg);
}
var ipjPageletsGrid=null;
var ipjPageletsGridID="";
var ipjPageletsRowReferences=new Array();
function ipjPageletsSetupGrid(gridID){
ipjPageletsGrid=igtbl_getGridById(ipjGetGridIdByControlId(gridID));
ipjPageletsGridID = gridID.replace(/_/g,"x")+"xgrdTable";
for (var i=0; i<ipjPageletsGrid.Rows.length; i++) ipjPageletsRowReferences.push(ipjPageletsGrid.Rows.getRow(i));
igtbl_deleteRow(ipjPageletsGridID, ipjPageletsRowReferences[0].Element.id);
}
function ipjPageletsAddRow(){
igtbl_addNew(ipjPageletsGridID,0);
var intRowIndex=ipjGetActiveRowCount(ipjPageletsGrid)-1;
var templateRow=ipjPageletsRowReferences[0];
var newRow=ipjPageletsGrid.Rows.getRow(ipjPageletsGrid.Rows.length-1);
newRow.getCellFromKey("HiddenSortOrder").setValue(intRowIndex+1);
newRow.getCellFromKey("PageDefID").setValue(0);
newRow.getCellFromKey("Title").Element.innerHTML = templateRow.getCellFromKey("TitleAlternate").Element.innerHTML.replace(/-1/g, ipjPageletsGrid.Rows.length);
newRow.getCellFromKey("TitleAlternate").Element.innerHTML = newRow.getCellFromKey("Title").Element.innerHTML;
newRow.getCellFromKey("SavePageletForceChildren").Element.innerHTML = templateRow.getCellFromKey("SavePageletForceChildren").Element.innerHTML;
newRow.getCellFromKey("UseParentCheckbox").Element.innerHTML = templateRow.getCellFromKey("UseParentCheckbox").Element.innerHTML.replace("-1", ipjPageletsGrid.Rows.length);
newRow.getCellFromKey("Delete").Element.innerHTML = templateRow.getCellFromKey("Delete").Element.innerHTML.replace("-1", ipjPageletsGrid.Rows.length);
ipjPageletsRowReferences.push(newRow);
var hiddenColumn=ipjPageletsGrid.Bands[0].Columns[0];
hiddenColumn.SortIndicator = 0; // 1 means "ascending"
ipjPageletsGrid.sortColumn(ipjPageletsGrid.Bands[0].Columns[0].Id);
ipjPageletsGrid.sort();
ipjMoveTableRow(ipjPageletsGridID, intRowIndex, intRowIndex);
ipjMoveTableRow(ipjPageletsGridID, intRowIndex+1, intRowIndex+1);
}
function ipjPageletsDeleteRow(intRowIndex){
var row=ipjPageletsRowReferences[intRowIndex];
var intOriginalPosition = row.getCellFromKey("HiddenSortOrder").getValue();
var intActiveRowCount=ipjGetActiveRowCount(ipjPageletsGrid);
ipjMoveTableRow(ipjPageletsGridID, intOriginalPosition, intActiveRowCount);
row.getCellFromKey("HiddenSortOrder").setValue(IPJ_DELETED_ROW_FLAG);
row.Element.style.display="none";
ipjMoveTableRow(ipjPageletsGridID, intActiveRowCount-1, intActiveRowCount-1);
}
function ipjPageletsUpdateRow(strReturnedValues, intSavedIndex){
if (typeof strReturnedValues=="undefined") return;
var returnedValues=eval(strReturnedValues);
if (returnedValues==false) return;
var intPageletPageDefID=returnedValues[0];
var strPageletTitle=unescape(returnedValues[1]);
var templateRow=ipjPageletsRowReferences[0];
var row=ipjPageletsRowReferences[intSavedIndex];
row.getCellFromKey("PageDefID").setValue(intPageletPageDefID);
row.getCellFromKey("Title").Element.innerHTML = templateRow.getCellFromKey("Title").Element.innerHTML.replace("TEMPLATE_TITLE", strPageletTitle).replace(/-1/g, intSavedIndex);
row.getCellFromKey("TitleAlternate").Element.innerHTML = row.getCellFromKey("Title").Element.innerHTML;
row.getCellFromKey("SavePageletForceChildren").Element.innerHTML = templateRow.getCellFromKey("SavePageletForceChildren").Element.innerHTML.replace("-1", intPageletPageDefID);
}
function ipjPageletsUseParentCheckboxChange(checkBoxElement, intRowIndex){
var row=ipjPageletsRowReferences[intRowIndex];
var blnIsChecked=checkBoxElement.checked;
row.getCellFromKey("UseParent").setValue(blnIsChecked);
if (blnIsChecked){
__doPostBack('', '');
}
else{
row.getCellFromKey("Title").Element.innerHTML = row.getCellFromKey("TitleAlternate").Element.innerHTML;
}
}
function ipjPageletsForceChildren(){
var intRowIndex = ipjPageletsGrid.getActiveRow().getCellFromKey("HiddenSortOrder").getValue();
__doPostBack('FORCE_'+intRowIndex, '');
}
function ipjTreeToggle(DivName, TreeName)
{
if(DivName==null) return;
var element=ipjFindObj(DivName);
if (element){
if (element.style.display == "inline") {
ipjTreeHide(DivName, TreeName);
}
else{
iTreeShow(DivName, TreeName);
}
}
};
function ipjTreeSetViewFromCookie(DivName, TreeName)
{
var strShowTree=ipjTreeGetCookie(DivName);
if(strShowTree == "true") {
iTreeShow(DivName, TreeName);
}
else{
ipjTreeHide(DivName, TreeName);
}
};
function ipjTreeGetCookie(DivName)
{
var strCookies=document.cookie;
var strPrefix = 'IPShowTree' + DivName + '=';
var strBegin = strCookies.indexOf("; " + strPrefix);
if (strBegin==-1){
strBegin=strCookies.indexOf(strPrefix);
if (strBegin !=0) return null;
}
else{
strBegin+=2;
}
var strEnd = document.cookie.indexOf(";", strBegin);
if (strEnd==-1) strEnd=strCookies.length;
return unescape(strCookies.substring(strBegin+strPrefix.length, strEnd));
};
function ipjTreeSetCookie(DivName, Value)
{
document.cookie = 'IPShowTree' + DivName + '=' + Value;
};
function iTreeShow(DivName, TreeName)
{
var element=ipjFindObj(DivName);
if (element){
element.style.display = 'inline';
ipjTreeSetCookie(DivName, "true");
}
};
function ipjTreeHide(DivName, TreeName)
{
var element=ipjFindObj(DivName);
if (element){
element.style.display = 'none';
ipjTreeSetCookie(DivName, "false");
}
};
var iTreeDivName;
var iTreeName;
var iTreeElementID;
var iTreeValue;
var iTreeNodeItemID;
var iTreeDoPostBack;
function ipjTreeNodeSel1(treeDivName, treeName, treeElementID, treeValue, treeNodeItemID, treeDoPostBack)
{
iTreeDivName=unescape(treeDivName);
iTreeName=unescape(treeName);
iTreeElementID=unescape(treeElementID);
iTreeValue=unescape(treeValue);
iTreeNodeItemID=unescape(treeNodeItemID);
iTreeDoPostBack=unescape(treeDoPostBack);
};
function ipjTreeAfterNodeSelection(treeID, nodeID)
{
setTimeout("ipjTreeAfterNodeSelectionFire('" + treeID + "','" + nodeID + "');",1)
}
function ipjTreeAfterNodeSelectionFire(treeID, nodeID)
{
var textbox=ipjFindObj(iTreeElementID);
var hiddenfield = ipjFindObj('ip_' + iTreeElementID);
if ((textbox) && (hiddenfield)){
textbox.value=iTreeValue;
hiddenfield.value=iTreeNodeItemID;
ipjTreeHide(iTreeDivName, iTreeName);
if(iTreeDoPostBack==1){
__doPostBack(iTreeElementID, iTreeNodeItemID)
}
}
};
function ipjTree_ChoosePageDef(value1, value2)
{
if (ipAddressTextBoxClientID){
value1=unescape(value1);
var textbox=ipjFindObj(ipAddressTextBoxClientID);
if (textbox){
textbox.value=value1;
}
}
if (ipTitleTextBoxClientID){
value2=unescape(value2);
var textbox=ipjFindObj(ipTitleTextBoxClientID);
if (textbox){
textbox.value=value2;
}
}
};
function ipjGrid_SetAltTag(altTag)
{
var altTag=unescape(altTag);
var textbox=ipjFindObj(ipAltTagOrTitleTextBoxClientID);
if (textbox && altTag){
textbox.value=altTag;
}
};
function ipjValidateRegEx(objTextbox, objSpan, strRegEx, intRequired, isRevMatch)
{
var b=false;
var s=objTextbox.value;
if (iTrim(s) == '') {
b=(intRequired==1);
}
else{
if (iTrim(strRegEx) != '') {
var rx=new RegExp(strRegEx);
var matches=rx.exec(s);
if (isRevMatch=='True')
{
b=(matches==null);
}
else
{
b=(matches !=null);
}
}
}
if (b){
iSetElementVis(objSpan, 1)
}
else{
iSetElementVis(objSpan, 0)
}
};
function iGetTheForm ()
{
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
theform = document.forms["IronPointForm"];
}
else{
theform=document.IronPointForm;
}
if (theform){
return theform;
}
else{
alert('Error in Javascript Function iGetTheForm (ip-utilities.js): "IronPointForm" missing');
}
};
function iSetElementVis(elementName, intVis)
{
var element=ipjFindObj(elementName);
if (element){
switch(intVis){
case 0:
element.style.visibility = "hidden";
break;
case 1:
element.style.visibility = "visible";
break;
case 2:
if (element.style.visibility == "hidden") {
element.style.visibility = "visible";
}
else{
element.style.visibility = "hidden";
}
}
}
};
function ipjShowFirstHideSecond (elementName1, elementName2)
{
var element1=ipjFindObj(elementName1);
var element2=ipjFindObj(elementName2);
if ((element1) && (element2)){
element1.style.display = "inline";
element2.style.display = "none";
}
};
function ipjEnableFirstDisableSecond (elementName1, elementName2)
{
var element1=ipjFindObj(elementName1);
var element2=ipjFindObj(elementName2);
if ((element1) && (element2)){
element1.disabled=false;
element2.disabled=true;
}
};
function ipjConditionalSetEnable(checkBoxName,elementName)
{
var element1=ipjFindObj(elementName);
var checkbox1=ipjFindObj(checkBoxName)
if ((element1) && (checkbox1)){
element1.disabled=!checkbox1.checked;
}
};
function ipjEnable(elementName)
{
var element1=ipjFindObj(elementName);
if (element1)
{
element1.disabled=false;
}
};
function ipjDisable(elementName)
{
var element1=ipjFindObj(elementName);
if (element1)
{
element1.disabled=true;
}
};
function ipjShowDiv(divName)
{
var element1=ipjFindObj(divName);
if (element1)
{
iSetElementVis(divName, 1);
}
};
function ipjHideDiv(divName)
{
var element1=ipjFindObj(divName);
if (element1)
{
iSetElementVis(divName, 0);
}
};
function ipjToggleDivWithImage(image, divId)
{
var div=ipjFindObj(divId);
if(div)
{
if(div.style.visibility=='visible')
{
ipjHideDiv(divId);
div.style.display='none';
var objRegEx = new RegExp("control_contract.gif");
image.src = image.src.replace(objRegEx, "control_expand.gif");
}
else
{
ipjShowDiv(divId);
div.style.display='inline';
var objRegEx = new RegExp("control_expand.gif");
image.src = image.src.replace(objRegEx, "control_contract.gif");
}
}
};
function iTrim(str)
{
var x=str;
x=x.replace(/^\s*(.*)/, "$1");
x=x.replace(/(.*?)\s*$/, "$1");
return x;
};
function iTrimChar(str, c)
{
if ((str !=null) && (str !=undefined)){
while (str.substring(0, 1)==c){
str=str.substring(1, str.length);
}
while (str.substring(str.length-1, 1)==c){
str=str.substring(0, str.length-1);
}
}
return str;
};
function ipjFocusElement(formName, elemName, doSelect)
{
if (document.forms[formName][elemName] !=null){
var elem=document.forms[formName].elements[elemName];
elem.focus();
if (doSelect){
elem.select();
}
}
};
function iAppendVirtualPath(path1, path2)
{
path1=iTrim(path1);
path2=iTrim(path2);
path1 = iTrimChar(path1, "/");
path2 = iTrimChar(path2, "/");
if ((path1.length>0) && (path2.length>0)){
return "/" + path1 + "/" + path2;
}
if (path1.length>0){
return "/" + path1;
}
if (path2.length>0){
return "/" + path2;
}
};
String.prototype.endsWith=function(sEnd)
{
return (this.substr(this.length-sEnd.length)==sEnd);
};
String.prototype.startsWith=function(sStart)
{
return (this.substr(0,sStart.length)==sStart);
};
String.prototype.trim=function()
{
var b=0;
var e=this.length-1;
while(this.substr(b,1) == " ") b++;
while(this.substr(e,1) == " ") e--;
return this.substring(b,e+1);
};
String.prototype.toCharArray=function()
{
var arrRet=new Array();
for(var i=0;i<this.length;i++){
arrRet.push(this.substr(i,1));
}
return arrRet;
};
String.prototype.reverse=function()
{
var a=new Array();
for(var i=0;i<this.length;i++){
a.push(this.substr(i,1));
}
return a.reverse().join("");
}
var iDivUpdateLast=(new Date()).getTime();
function ipjDivUpdate(elemName, msg)
{
msg=unescape(msg);
if ((new Date()).getTime()>iDivUpdateLast+1000){
var div=ipjFindObj(elemName);
div.innerHTML+=msg;
window.scrollTo(0,document.body.scrollHeight);
iDivUpdateLast=(new Date()).getTime();
}
};
function ipjRadioSelect(rbId)
{
var rb=ipjFindObj(rbId);
rb.checked=true;
};
function ipjClearDefaultAndCSS(el)
{
if (el){
if (el.defaultValue==el.value) el.value = ""
}
};
function ipjAddPostBack()
{
if(typeof(__doPostBack) == 'undefined')
{
document.write("<input type=\"hidden\" name=\"__EVENTTARGET\" value=\"\" />");
document.write("<input type=\"hidden\" name=\"__EVENTARGUMENT\" value=\"\" />");
document.write("<script language=\"javascript\" type=\"text/javascript\"> function __doPostBack(eventTarget, eventArgument) {	var theform; if (window.navigator.appName.toLowerCase().indexOf(\"microsoft\") > -1) { theform = document.IronPointForm; } else { theform = document.forms[\"IronPointForm\"]; } theform.__EVENTTARGET.value = eventTarget.split(\"$\").join(\":\"); theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); }</script>");
}
};
function ipjEnableContentActionButtons()
{
var strReadOnly = ipjFindObj("ipReadOnlyContentActionBar");
if(strReadOnly == null || strReadOnly != "True" || strReadOnly != "true")
{
var objButtonPrefix = ipjFindObj("ipActionButtonPrefix");
if((objButtonPrefix != null) && (objButtonPrefix.value != ""))
{
var strButtonPrefix=objButtonPrefix.value;
var oaInputElements = document.getElementsByTagName('input');
var element;
for (var i=0; i<oaInputElements.length ; i++)
{
element=oaInputElements[i]
if(element.id.indexOf(strButtonPrefix)>0)
{
element.disabled=false;
}
}
}
}
};
function ipjDisableContentActionButtons()
{
var strReadOnly = ipjFindObj("ipReadOnlyContentActionBar");
if(strReadOnly == null || strReadOnly != "True" || strReadOnly != "true")
{
var objButtonPrefix = ipjFindObj("ipActionButtonPrefix");
if((objButtonPrefix != null) && (objButtonPrefix.value != ""))
{
var strButtonPrefix=objButtonPrefix.value;
var oaInputElements = document.getElementsByTagName('input');
var element;
for (var i=0; i<oaInputElements.length ; i++)
{
element=oaInputElements[i]
if(element.id.indexOf(strButtonPrefix)>0)
{
element.disabled=true;
}
}
}
}
return true;
};
function ipjDisableContentActionButton(strValue){
var strReadOnly = ipjFindObj("ipReadOnlyContentActionBar");
if(strReadOnly == null || strReadOnly != "True" || strReadOnly != "true")
{
var objButtonPrefix = ipjFindObj("ipActionButtonPrefix");
if((objButtonPrefix != null) && (objButtonPrefix.value != ""))
{
var strButtonPrefix=objButtonPrefix.value;
var oaInputElements = document.getElementsByTagName('input');
var element;
for (var i=0; i<oaInputElements.length ; i++)
{
element=oaInputElements[i]
if(element.id.indexOf(strButtonPrefix)>0 && element.value==strValue)
{
element.disabled=true;
}
}
}
}
return true;
}
function ipjSearchResultPreview(url, id, previewLabel, hideLabel)
{
var strFrameID = 'ipFrame' + id;
var objFrame=ipjFindObj(strFrameID);
var strPreview = '&lt;&lt;' + previewLabel + '&gt;&gt;'
var strHide = '&lt;&lt;' + hideLabel + '&gt;&gt;'
if(url.innerHTML == strPreview) // We're expanding the frame
{
objFrame.src=url.href;
objFrame.height = "175px";
if (document.all) objFrame.width = "100%"; //IE
else objFrame.width = "95%";//Firefox, leave room for a scrollbar
url.insertAdjacentHTML('afterEnd', '<A class=\"ipf-PageSearchResult-PreviewLink\" href=\"'+url.href+'\" onClick=\"parent.ipjSearchResultPreview(this, '+id+', \''+previewLabel+'\', \''+hideLabel+'\'); return false;\"><font color=red>'+ strHide + '</font></A>');
url.innerHTML = "";
}
else // We're hiding the frame
{
objFrame.src = "";
objFrame.height = "0";
objFrame.width = "0";
url.innerHTML=strPreview;
}
};
function ipInitQuestionBuffer()
{
document.getElementById('ctlHiddenUserAction').value='';
};
function ipEditQuestion(qid,qItemID)
{
document.getElementById('ctlHiddenUserAction').value='Edit;' + qItemID + ';' + qid;
__doPostBack('', '');
};
function ipCopyQuestion(qid,qItemID)
{
document.getElementById('ctlHiddenUserAction').value='Copy;' + qItemID + ';' + qid;
__doPostBack('', '');
};
function ipPasteQuestion(qid,sortOrder)
{
document.getElementById('ctlHiddenUserAction').value='Paste;' + sortOrder + ';' + qid;
__doPostBack('', '');
};
function ipDeleteQuestion(qid,qItemID,isVersioned)
{
var response;
if (isVersioned)
{
response = confirm("Click OK to confirm deletion?");
}
else
{
response = confirm("All responses related to this question will be lost. Click OK to confirm deletion?");
}
if (response)
{
document.getElementById('ctlHiddenUserAction').value='Del;' + qItemID + ';' + qid;
__doPostBack('', '');
}
};
function ipjShowPopupWithContent(strContent,winName,features)
{
if (winName =="")    winName = "_blank";
if (winName =="center") features = ipjFindCenterForPopup();
if (features == "")  features = "width=300,height=300"
var ipDisplayWindow=window.open(strContent,winName,features);
ipDisplayWindow.document.write(unescape(strContent));
ipDisplayWindow.document.close();
}
function ipjShowPopupByURL(strURL,winName,features)
{
if (winName =="")    winName = "_blank";
if (winName =="center") features = ipjFindCenterForPopup();
if (features == "")  features = "width=300,height=300"
var ipDisplayWindow=window.open(strURL,winName,features);
}
function ipjFindCenterForPopup()
{
if (window.screen){
var nWidth=380;
var nHeight=350;
var nLeft=10;
var nTop=10;
nLeft=(window.screen.availWidth-nWidth)/2;
nTop=(window.screen.availHeight-nHeight)/2;
var features = 'width='+nWidth+',height='+nHeight+',left='+nLeft+',top='+nTop;
}
else{
var features='width=380,height=350';
}
return features;
}
function ipjOpenPreview(url)
{
eval("window.open(url,'Admin','scrollbars=yes,status=yes,toolbar=yes,menubar=yes,resizable=yes,height=510,width=750,left='+(screen.width-750)/2+',top='+(screen.height-(510+45))/2)");
};
function ipjOpenPrintPage(url)
{
eval("window.open(url,'PrinterFriendlyPage','scrollbars=yes,status=yes,toolbar=yes,menubar=yes,resizable=yes,height=510,width=750,left='+(screen.width-750)/2+',top='+(screen.height-(510+45))/2)");
};
var ipjModalDialogWindow=null;
var ipjModalReturnFunction=null;
var ipjModalReturnFunctionArgs=null;
var ipjModalAbortNew=false;
function Dimensions(){
this.top=0;
this.left=0;
this.width=0;
this.height=0;
}
function ipjGetDialogDimensions(intWidth, intHeight)
{
var dim=new Dimensions();
dim.width=intWidth;
dim.height=intHeight;
if (window.screenX){
dim.left=window.screenX+((window.outerWidth-intWidth)/2);
dim.top=window.screenY+((window.outerHeight-intHeight)/2);
}else if (window.screenLeft){
var CSSCompat = (document.compatMode && document.compatMode != "BackCompat");
window.outerWidth=(CSSCompat) ? document.body.parentElement.clientWidth : document.body.clientWidth;
window.outerHeight=(CSSCompat) ? document.body.parentElement.clientHeight : document.body.clientHeight;
window.outerHeight-=80;
dim.left=parseInt(window.screenLeft+((window.outerWidth-intWidth)/2));
dim.top=parseInt(window.screenTop+((window.outerHeight-intHeight)/2));
}else{
dim.left=(screen.width-intWidth)/2;
dim.top=(screen.height-intHeight)/2;
}
return dim;
}
function ipjShowModal(strUrl, intHeight, intWidth , args, objPointer, funcReturnFunc, functionArgs, dialogArgs){
if (ipjModalAbortNew==true) return true;
if (args !=null){
strUrl += "?" + args;
}
var dim=ipjGetDialogDimensions(intWidth, intHeight);
if (!ipjModalDialogWindow || (ipjModalDialogWindow && ipjModalDialogWindow.closed)){
if (window.showModalDialog){
var ieFeatures = "resizable:no;dialogLeft:" + dim.left + "px;dialogTop:" + dim.top + "px;dialogWidth:" + dim.width + "px;dialogHeight:" + dim.height + "px;status:no;help:no;scroll:no"; //mr
var returnValue=window.showModalDialog(strUrl, dialogArgs, ieFeatures);
if (funcReturnFunc !=null){
funcReturnFunc(returnValue, functionArgs);
return;
}
else{
return returnValue;
}
}
else{
ipjModalReturnFunction=funcReturnFunc;
ipjModalReturnFunctionArgs=functionArgs;
ipjModalDialogArgs=dialogArgs;
var nnfeatures = "dependent=yes,resizable=no,screenX=" + dim.left + ",screenY=" + dim.top + ",width=" + dim.width + ",height=" + dim.height;
ipjModalDialogWindow=window.open(strUrl, (new Date()).getTime().toString(), nnfeatures);
ipjModalDialogWindow.focus();
window.top.captureEvents(Event.CLICK|Event.FOCUS);
window.top.onclick=iIgnoreEvents;
window.top.onfocus=iHandleFocus;
setTimeout("ipjModalDialogWindow.focus();",1)
}
}
else{
ipjModalDialogWindow.focus();
}
}
function ipjCloseModal(returnValue)
{
returnValue=unescape(returnValue);
if (window.showModalDialog){
window.close();
window.returnValue=returnValue;
}
else{
parent.opener.top.releaseEvents(Event.CLICK|Event.FOCUS);
parent.opener.top.onclick="";
parent.opener.top.onfocus="";
if (parent.opener.ipjModalReturnFunction!=null) parent.opener.ipjModalReturnFunction(returnValue,parent.opener.ipjModalReturnFunctionArgs);
window.top.close();
}
};
function ipjForcePostBack(returnValue, postbackArgs)
{
if (postbackArgs==null || typeof(postbackArgs)!="object") __doPostBack('','');
else{
if (postbackArgs.length==1) __doPostBack(postbackArgs[0],'');
if (postbackArgs.length==2) __doPostBack(postbackArgs[0],postbackArgs[1]);
}
}
function ipjUpdateHyperlink(hyperlinkText, hyperlinkElementId)
{
if (hyperlinkText==null || hyperlinkText=="") return;
document.getElementById(hyperlinkElementId).innerHTML=hyperlinkText;
}
function ipjContinueEventAction(returnValue, elementId)
{
if (document.all) return;
if (returnValue=="true" || returnValue==true) {
ipjModalAbortNew=true;
document.getElementById(elementId).click();
}
else{
__doPostBack('','');  //default action is to postback when the modal is closed
}
}
function iIgnoreEvents(e)
{
return false;
};
function iHandleFocus()
{
if (ipjModalDialogWindow){
if (!ipjModalDialogWindow.closed){
ipjModalDialogWindow.focus();
}
else{
window.top.releaseEvents(Event.CLICK|Event.FOCUS);
window.top.onclick="";
}
}
};
var ipjActiveEditors=new Array();
function ipjRegisterEditor(editor){
ipjActiveEditors.push(editor);
var customFilter=new ipjEditorCustomFilter();
editor.FiltersManager.Add(customFilter);
}
function ipjEditorCustomFilter()
{
this.GetHtmlContent=function (content)
{
if (!document.all){
content = content.replace(/(["'])((pagefactory.aspx)|(page\d+.aspx)|(assetfactory.aspx)|(asset\d+.aspx))/gi, "$1" + iAppendVirtualPath(ipVirDir,"/$2"));
}
return content;
}
}
function ipjSetEditorsVisible(){
if (document.all) return;
for (i=ipjActiveEditors.length-1; i>=0; i--){
ipjActiveEditors[i].SetVisible(true);
}
}
function ipjOnClientCommandExecutingEditor(editor, commandName, oTool)
{
if (commandName=="SetLinkProperties") {
ipjAddInternalLink(editor);
return false;
}
if (commandName=="InsertParagraph") {
if (editor.GetText()=="")  editor.SetHtml("&nbsp;<p>.&nbsp;</p>"); //special case, empty editor
else editor.PasteHtml("<p>" + editor.GetSelectionHtml() + (document.all?".":"") +"</p>");
var strRadEditorContainerClientID = "RadEContentDiv_" + editor.Id;
var editDoc;
if (editor.Document){
editDoc=editor.Document;
}else{
editDoc=ipjFindObj(strRadEditorContainerClientID);
}
editor.SetActive();
editor.SetFocus();
var range;
var isSelectionControl=false;
if (document.all){
if (editDoc.selection.type=="Control") {
isSelectionControl=true;
var el=editDoc.selection.createRange().commonParentElement();
range=editDoc.body.createTextRange();
range.moveToElementText(el);
range.select();
}
else{
range=editDoc.selection.createRange();
}
range.moveStart("character",-2);
range.collapse(true);
range.moveEnd("character",1);
range.select();
range.pasteHTML("");
}
else{
var sel=editor.ContentWindow.getSelection();
range=sel.getRangeAt(0);
range.setStart(range.startContainer.previousSibling,0);
sel.collapseToStart();
}
return false;
}
}
function ipjAddDigitalAsset(RadEditor)
{
var strArgs = "";
var strRadEditorContainerClientID = "RadEContentDiv_" + RadEditor.Id;
var editDoc;
if (RadEditor.Document){
editDoc=RadEditor.Document;
}else{
editDoc=ipjFindObj(strRadEditorContainerClientID);
}
RadEditor.SetActive();
RadEditor.SetFocus();
var range;
var isSelectionControl=false;
if (document.all){
if (editDoc.selection.type=="Control") {
isSelectionControl=true;
var el=editDoc.selection.createRange().commonParentElement();
range=editDoc.body.createTextRange();
range.moveToElementText(el);
range.select();
}
else{
range=editDoc.selection.createRange();
}
}
else{
var sel=RadEditor.ContentWindow.getSelection();
range=sel.getRangeAt(0);
}
var rangeHtmlText=(document.all? range.htmlText : ipjGetHtmlTextOfRangeGecko(range));
if (rangeHtmlText.toLowerCase().indexOf("<object")>-1) range.collapse(true);
if (document.all){
strArgs+=ipjAnchorParseIE(editDoc, range, isSelectionControl);
}else{
strArgs+=ipjAnchorParseNN(editDoc, range, isSelectionControl);
}
if (range !=null){
strArgs = strArgs + "&SelectedHtmlText=" + escape(document.all? range.htmlText : ipjGetHtmlTextOfRangeGecko(range));
strArgs = strArgs + "&SelectedText=" + escape(document.all? range.text : ipjGetHtmlTextOfRangeGecko(range));
}
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseAssetHostFrame.htm");
var dlgWidth=760;
var dlgHeight=690;
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, strArgs, null, ipjChangeRangeHTML, range);
};
function ipjW3CValidation(RadEditor)
{
RadEditor.SetActive();
RadEditor.SetFocus();
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalW3CValidationHostFrame.htm");
var dlgWidth=790;
var dlgHeight=470;
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, '', null, null, null, RadEditor);
};
function ipjAddInternalLinkAnchor(addressTextBoxClientID)
{
var strArgs = "";
var addrtextbox=null;
if (addressTextBoxClientID){
var addrtextbox=ipjFindObj(addressTextBoxClientID);
if (addrtextbox){
strArgs = strArgs + "&Address=" + escape(addrtextbox.value);
};
};
if ((addrtextbox==null) || (!addrtextbox)){
alert('Parameter passed to ipjAddInternalLinkAnchor is invalid');
}
else
{
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseLinkAnchorHostFrame.htm");
var dlgWidth=350;
var dlgHeight=460;
var dlgResult=ipjShowModal(dlgUrl, dlgHeight, dlgWidth, strArgs);
if ((dlgResult != null) && (typeof(dlgResult) == "string")) {
dlgResult=unescape(dlgResult);
if ((dlgResult.length) && (dlgResult.toLowerCase() != "false")) {
addrtextbox.value=dlgResult;
};
};
};
};
function ipjAddInternalLink(RadEditor,oTool)
{
var strRadEditorContainerClientID = "RadEContentDiv_" + RadEditor.Id;
var editDoc;
if (RadEditor.Document){
editDoc=RadEditor.Document;
}else{
editDoc=ipjFindObj(strRadEditorContainerClientID);
}
RadEditor.SetActive();
RadEditor.SetFocus();
var range;
var isSelectionControl=false;
if (document.all){
if (editDoc.selection.type=="Control") {
isSelectionControl=true;
var el=editDoc.selection.createRange().commonParentElement();
range=editDoc.body.createTextRange();
range.moveToElementText(el);
range.select();
}
else{
range=editDoc.selection.createRange();
}
}
else{
var sel=RadEditor.ContentWindow.getSelection();
range=sel.getRangeAt(0);
}
var rangeHtmlText=(document.all? range.htmlText : ipjGetHtmlTextOfRangeGecko(range));
if (rangeHtmlText.toLowerCase().indexOf("<object")>-1) range.collapse(true);
var strArgs = "";
strArgs += "&ParentDocURL=" + escape(parent.document.URL);
if (document.all){
strArgs+=ipjAnchorParseIE(editDoc, range, isSelectionControl);
}else{
strArgs+=ipjAnchorParseNN(editDoc, range, isSelectionControl);
}
var strAnchorList = "Top" + ipjGetAllAnchorsNameList();
strArgs += "&AnchorList=" + escape(strAnchorList);
strArgs=ipjTruncateArgsList(strArgs);
if (oTool==null && strArgs.match(/&LinkHRef[^&]*%3Fdid%3D/gi)){
ipjAddDigitalAsset(RadEditor);
return;
}
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseLinkHostFrame.htm");
var dlgWidth=550;
var dlgHeight=600;
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, strArgs, null, ipjChangeRangeHTML, range);
};
function ipjTruncateArgsList(strArgs)
{
if (strArgs.length>1900){
alert('Not all page anchors were processed due to the number and length of the anchor names.');
strArgs=strArgs.substring(0,1900);
if (strArgs.lastIndexOf("%2CA">-1)) strArgs = strArgs.substring(0,strArgs.lastIndexOf("%2CA"));
}
return strArgs;
}
function ipjChangeRangeHTML(newHTML, range)
{
if ((newHTML != null) && (typeof(newHTML) == "string")) {
newHTML=unescape(newHTML);
if ((newHTML.length > 0) && (newHTML.toLowerCase() != "false")) {
if (range.pasteHTML){
range.pasteHTML(newHTML);
}else{
range.deleteContents();
range.insertNode(range.createContextualFragment(newHTML));
}
}
}
};
function ipjGetAnchorsNameList(editDoc)
{
var arrAnchors;
if (editDoc.anchors){
arrAnchors=editDoc.anchors;
}else{
arrAnchors=editDoc.contentWindow.document.anchors;
}
var strAnchorList = "";
for (i=0; i<arrAnchors.length; i++){
if (arrAnchors[i].name.length){
strAnchorList += "," + arrAnchors[i].name;
}
}
return strAnchorList;
}
function ipjGetAllAnchorsNameList(){
var strAnchorList = "";
var i;
for (i=0; i<ipjActiveEditors.length; i++){
if (ipjActiveEditors[i] && ipjActiveEditors[i].Document){
strAnchorList+=ipjGetAnchorsNameList(ipjActiveEditors[i].Document);
}
}
return strAnchorList;
}
function ipjAnchorParseNN(editDoc, selrange, isSelectionControl)
{
var strArgs = "";
var selectedLinkPosition=-1;
var selectedLinksNumber=0;
var rngEndContainer=selrange.endContainer;
var rngEndOffSet=selrange.endOffset;
var rngStartContainer=selrange.startContainer;
var rngStartOffSet=selrange.startOffset;
var anchorTagCol = editDoc.getElementsByTagName("A");
var outerHTMLArray=new Array();
for (i=0; i<anchorTagCol.length; i++){
outerHTMLArray.push(ipjGetElementOuterHTMLGecko(anchorTagCol[i]));
}
selrange.setEnd(rngEndContainer, rngEndOffSet);
selrange.setStart(rngStartContainer, rngStartOffSet);
for (i=0; i<anchorTagCol.length; i++){
var linkRange=editDoc.createRange();
linkRange.selectNode(anchorTagCol[i]);
if ((selrange.compareBoundaryPoints(Range.END_TO_START, linkRange)==-1) &&
(selrange.compareBoundaryPoints(Range.START_TO_END, linkRange)==1)){
if(selrange.compareBoundaryPoints(Range.START_TO_START, linkRange)==1){
selrange.setStartBefore(anchorTagCol[i]);
}
if(selrange.compareBoundaryPoints(Range.END_TO_END, linkRange)==-1){
selrange.setEndAfter(anchorTagCol[i]);
}
selectedLinksNumber++;
selectedLinkPosition=i;
}
}
if (selectedLinksNumber==1){
var i=selectedLinkPosition;
strArgs = strArgs + "&LinkOuterHtml=" + escape(outerHTMLArray[i]);
strArgs = strArgs + "&LinkTarget=" + escape(anchorTagCol[i].target);
strArgs = strArgs + "&LinkCssText=" + escape((anchorTagCol[i].cssText)?anchorTagCol[i].cssText:""); // alert("undefined");
strArgs = strArgs + "&LinkClass=" + escape(anchorTagCol[i].className);
strArgs = strArgs + "&LinkName=" + escape(anchorTagCol[i].name);
strArgs = strArgs + "&LinkTitle=" + escape(anchorTagCol[i].title);
strArgs = strArgs + "&LinkInner=" + escape(selrange.toString());
strArgs = strArgs + "&LinkHRef=" + escape(anchorTagCol[i].href);
}else{
strArgs = "&LinkInner=" + escape(ipjGetHtmlTextOfRangeGecko(selrange));
}
editDoc.defaultView.getSelection().removeAllRanges();
editDoc.defaultView.getSelection().addRange(selrange);
return strArgs;
};
function ipjAnchorParseIE(editDoc, selrange, isSelectionControl)
{
var anchorTagCol= editDoc.all.tags("A");
var foundLink=false;
var linkTextRange;
var strArgs = "";
if(selrange == null) alert("selrange is null");
if(selrange.htmlText != "<SPAN></SPAN>")
{
for (i=0; i<anchorTagCol.length && !foundLink; i++){
linkTextRange=editDoc.body.createTextRange();
linkTextRange.moveToElementText(anchorTagCol[i]);
if ((selrange.compareEndPoints("EndToStart",linkTextRange)==1) &&
(selrange.compareEndPoints("StartToEnd",linkTextRange)==-1)) {
if(selrange.compareEndPoints("StartToStart",linkTextRange)==1) {
selrange.setEndPoint("StartToStart",linkTextRange);
}
if(selrange.compareEndPoints("EndToEnd",linkTextRange)==-1) {
selrange.setEndPoint("EndToEnd",linkTextRange);
}
selrange.select();
strArgs = strArgs + "&LinkOuterHtml=" + escape(anchorTagCol[i].outerHTML);
strArgs = strArgs + "&LinkTarget=" + escape(anchorTagCol[i].target);
strArgs = strArgs + "&LinkCssText=" + escape(anchorTagCol[i].cssText);
strArgs = strArgs + "&LinkClass=" + escape(anchorTagCol[i].className);
strArgs = strArgs + "&LinkName=" + escape(anchorTagCol[i].name);
strArgs = strArgs + "&LinkTitle=" + escape(anchorTagCol[i].title);
if (isSelectionControl){
strArgs = strArgs + "&LinkInner=" + escape(anchorTagCol[i].innerHTML);
}
else{
strArgs = strArgs + "&LinkInner=" + escape(anchorTagCol[i].innerText);
}
strArgs = strArgs + "&LinkHRef=" + escape(anchorTagCol[i].href);
foundLink=true;
}
}
}
if (!foundLink){
strArgs = strArgs + "&LinkInner=" + escape(selrange.htmlText);
}
return strArgs;
};
function ipjAddDigitalAssetPlainText(textAreaElement)
{
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseAssetHostFrame.htm");
var dlgWidth=760;
var dlgHeight=690;
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, null, null, ipjInsertAtCaret, textAreaElement);
};
function ipjAddInternalLinkPlainText(textAreaElement)
{
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseLinkHostFrame.htm");
var dlgWidth=550;
var dlgHeight=600;
var strArgs = "&AnchorList=Top" + escape(ipjGetAnchorsNameListPlainText(textAreaElement));
strArgs=ipjTruncateArgsList(strArgs);
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, strArgs, null, ipjInsertAtCaret, textAreaElement);
};
function ipjCopyDigitalAssetToClipboard(textAreaElement)
{
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseAssetHostFrame.htm");
var dlgWidth=760;
var dlgHeight=690;
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, null, null, ipjCopyTextToClipboard);
};
function ipjCopyInternalLinkToClipboard(textAreaElement)
{
var dlgUrl = iAppendVirtualPath(ipVirDir, "/CM/WebUI/ModalDialogs/ModalChooseLinkHostFrame.htm");
var dlgWidth=550;
var dlgHeight=600;
var strArgs = "&AnchorList=Top" + escape(ipjGetAnchorsNameListPlainText(textAreaElement));
strArgs=ipjTruncateArgsList(strArgs);
ipjShowModal(dlgUrl, dlgHeight, dlgWidth, strArgs, null, ipjCopyTextToClipboard);
};
function ipjGetAnchorsNameListPlainText(textAreaElement)
{
var strPattern = "<a [^<>]*name=[\"\']([^\"\']*)[\'\"][^>]*>"
var strAnchorList = "";
var htmlstr=textAreaElement.value;
var rx = new RegExp(strPattern,"gi");
var matches=rx.exec(htmlstr);
while (matches!=null && matches[1]!=null){
strAnchorList += "," + matches[1];
htmlstr=htmlstr.substring(matches.index+matches[0].length-1);
rx = new RegExp(strPattern,"gi");
matches=rx.exec(htmlstr);
}
return strAnchorList;
}
function ipjStoreCaret(textAreaElement){
if (textAreaElement.createTextRange) textAreaElement.caretPos=document.selection.createRange().duplicate();
}
function ipjInsertAtCaret(text, txtarea){
if (typeof text=="undefined") return;
text=unescape(text);
if (text!="false") {
if (txtarea.createTextRange && txtarea.caretPos){
var caretPos=txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
} else if (txtarea.selectionStart || txtarea.selectionStart == '0') { //Gecko
var startPos=txtarea.selectionStart;
var endPos=txtarea.selectionEnd;
txtarea.value=txtarea.value.substring(0, startPos)
+text
+txtarea.value.substring(endPos, txtarea.value.length);
txtarea.focus();
txtarea.selectionStart=startPos+text.length;
txtarea.selectionEnd=startPos+text.length;
}else{
txtarea.value+=text;
txtarea.focus();
}
}
}
function ipjCopyToClipboard(textAreaElement){
if (document.all){
window.clipboardData.setData("Text", textAreaElement.value);
}
else{
ipjGeckoSetClipboard(textAreaElement.value);
}
}
function ipjPasteFromClipboard(textAreaElement){
var text=""
if (document.all){
text = (window.clipboardData.getData('Text')==null?"":window.clipboardData.getData('Text'));
}
else{
text=ipjGeckoGetClipboard();
}
if (text!="") textAreaElement.value=text;
}
function ipjCopyTextToClipboard(text){
text=unescape(text);
if (text!="false") {
if (document.all){
window.clipboardData.setData("Text", text);
}
else{
ipjGeckoSetClipboard(text);
}
}
}
function ipjGeckoSetClipboard(text){
try{
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
}
catch(e){
alert(e);
alert("To use clipboard functionality in Firefox:\nType \"about:config\" into the address bar.\nThen change the \"signed.applets.codebase_principal_support\" setting to true.");
return;
}
var str = Components.classes["@mozilla.org/supports-string;1"].
createInstance(Components.interfaces.nsISupportsString);
if (!str) return false;
str.data=text;
var trans = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
if (!trans) return false;
trans.addDataFlavor("text/unicode");
trans.setTransferData("text/unicode",str,text.length * 2);
var clipid=Components.interfaces.nsIClipboard;
var clip = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);
if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);
}
function ipjGeckoGetClipboard(){
try{
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
}
catch(e){
alert(e);
alert("To use clipboard functionality in Firefox:\nType \"about:config\" into the address bar.\nThen change the \"signed.applets.codebase_principal_support\" setting to true.");
return;
}
var clip = Components.classes["@mozilla.org/widget/clipboard;1"].
getService(Components.interfaces.nsIClipboard);
if (!clip) return "";
var trans = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
if (!trans) return "";
trans.addDataFlavor("text/unicode");
clip.getData(trans,clip.kGlobalClipboard);
var str=new Object();
var strLength=new Object();
trans.getTransferData("text/unicode",str,strLength);
if (str) str=str.value.QueryInterface(Components.interfaces.nsISupportsString);
if (str) return str.data.substring(0,strLength.value/2);
else return "";
}
function ipjInitUnorderedListMenu(sectionMenuElementID){
var sfEls = document.getElementById(sectionMenuElementID).getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++){
sfEls[i].onmouseover=function(){
this.className+=" sfhover";
}
sfEls[i].onmouseout=function(){
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
function ipjInitUnorderedListMenuItemsActive(sectionMenuElementID){
var strList=null;
try
{
strList = eval('ipActivePageDefIds_' + sectionMenuElementID + ';');
}
catch (e)
{}
var sfEls = document.getElementById(sectionMenuElementID).getElementsByTagName("LI");
if (strList)
for (var i=0; i<sfEls.length; i++){
{
var strPageDefId = sfEls[i].id.replace('pageid','');
for (var j=0;j<strList.length;j++)
{
if (strList[j]==strPageDefId)
{
intLevel = sfEls[i].getAttribute('level');
if (sfEls[i].className.length>0)
{
sfEls[i].className = sfEls[i].className + ' ipf-active' + intLevel;
}
else
{
sfEls[i].className = 'ipf-active' + intLevel;
}
break;
}
}
}
}
}
function ipjOpenCalendarButtonClick(ctlID, doAutoPostBack, localize)
{
var iframeElem = document.getElementById(ctlID+"_ifrCalendarPage");
if (iframeElem.src.indexOf('DateTimeControlIframe')<0) {
var pathToIframe = iAppendVirtualPath(ipVirDir, "/CM/WebUI/UserControls/DateTimeControlIframe.aspx?ctlID=" + ctlID + "&doAutoPostBack=" + doAutoPostBack + "&localize=" + localize);
iframeElem.src=pathToIframe;
if (!document.all) iframeElem.height=parseInt(iframeElem.height)+20;
}
iframeElem.style.display=(iframeElem.style.display=="block"?"none":"block");
}
function ipjClearCalendarButtonClick(ctlID, doAutoPostBack)
{
if (document.getElementById(ctlID+"_txtDate")) document.getElementById(ctlID+"_txtDate").value="";
if (document.getElementById(ctlID+"_hdnDateValueForQuestionnaireResponses")) document.getElementById(ctlID+"_hdnDateValueForQuestionnaireResponses").value="";
if (document.getElementById(ctlID+"_dd24Hours")) document.getElementById(ctlID+"_dd24Hours").selectedIndex=0;
if (document.getElementById(ctlID+"_dd12Hours")) document.getElementById(ctlID+"_dd12Hours").selectedIndex=0;
if (document.getElementById(ctlID+"_ddMinute")) document.getElementById(ctlID+"_ddMinute").selectedIndex=0;
if (document.getElementById(ctlID+"_ddAMPM")) document.getElementById(ctlID+"_ddAMPM").selectedIndex=0;
if (doAutoPostBack) __doPostBack('','');
}
function ipjCalendarDaySelectedClick(ctlID, strDate, strDateValueForQuestionnaireResponses, doAutoPostBack)
{
document.getElementById(ctlID+"_txtDate").value=strDate;
document.getElementById(ctlID+"_hdnDateValueForQuestionnaireResponses").value=strDateValueForQuestionnaireResponses;
if (doAutoPostBack) __doPostBack('','');
else document.getElementById(ctlID+"_ifrCalendarPage").style.display="none";
}
var ipjActiveTabsIDs=new Array();
var ipjTabControlID = "";
function ipjRegisterTabControl(ctlID){
ipjTabControlID=ctlID;
}
function ipjRegisterTab(tabID){
ipjActiveTabsIDs.push(tabID);
}
function ipjSelectTab(tabID)
{
if (tabID=="") return;
if (!document.getElementById('tabsLoadedIndicator')) return;
for (i=0; i<ipjActiveTabsIDs.length; i++){
if (ipjActiveTabsIDs[i]!=tabID) ipjDeSelectTab(ipjActiveTabsIDs[i]);
}
if (document.getElementById('div'+tabID)) document.getElementById('div'+tabID).style.display = "block";
if (document.getElementById('btn'+tabID)) document.getElementById('btn'+tabID).className = "ipb-tabitem-selected";
document.getElementById(ipjTabControlID+"_hdnCurrentSelectedTabID").value=tabID;
ipjSetEditorsVisible();
}
function ipjDeSelectTab(tabID)
{
if (tabID=="") return;
if (!document.getElementById('tabsLoadedIndicator')) return;
if (document.getElementById('div'+tabID)) document.getElementById('div'+tabID).style.display = "none";
if (document.getElementById('btn'+tabID)) document.getElementById('btn'+tabID).className = "ipb-tabitem";
}
var ipjModalChooseAsset_MediaURL = "";
var ipjModalChooseAsset_MediaType = "";
function ipjTree_ModalChooseAssetMainTab(queryStrParam, assetMediaType, altTag, desc, assetType, fileSize, width, height)
{
var queryStrParam=unescape(queryStrParam);
var assetMediaType=unescape(assetMediaType);
var altTag=unescape(altTag);
var desc=unescape(desc);
var assetType=unescape(assetType);
var fileSize=unescape(fileSize);
var width=unescape(width);
var height=unescape(height);
if (ipjFindObj(ipAltTagOrTitleLabelClientID)) ipjFindObj(ipAltTagOrTitleLabelClientID).innerHTML = "Title:";
if (ipjFindObj(ipAltTagOrTitleTextBoxClientID)) ipjFindObj(ipAltTagOrTitleTextBoxClientID).value=altTag;
ipjFindObj(ipLabelAltTagTitle).innerHTML = "Title:";
ipjFindObj(ipLabelWidthpxTitle).innerHTML = "";
ipjFindObj(ipLabelHeightpxTitle).innerHTML = "";
ipjFindObj(ipLabelAltTag).innerHTML=altTag;
ipjFindObj(ipLabelDescription).innerHTML=desc;
ipjFindObj(ipLabelAssetType).innerHTML=assetType;
ipjFindObj(ipLabelFileSize).innerHTML=fileSize;
ipjFindObj(ipLabelWidthpx).innerHTML = "";
ipjFindObj(ipLabelHeightpx).innerHTML = "";
ipjFindObj(ipImgMainClientID).src = ipAssetFactory + "?Mode=Thumbnail&Width=240&Height=240&" + queryStrParam;
ipjModalChooseAsset_ResetDetailsVisibility();
ipjModalChooseAsset_MediaType=assetMediaType;
switch(assetMediaType){
case "Document":
break;
case "Image":
if (ipjFindObj(ipAltTagOrTitleLabelClientID)) ipjFindObj(ipAltTagOrTitleLabelClientID).innerHTML = "Alt Tag:";
ipjFindObj(ipLabelAltTagTitle).innerHTML = "Alt Tag:";
ipjFindObj(ipLabelWidthpxTitle).innerHTML = "Width:";
ipjFindObj(ipLabelHeightpxTitle).innerHTML = "Height:";
ipjFindObj(ipLabelWidthpx).innerHTML=width;
ipjFindObj(ipLabelHeightpx).innerHTML=height;
break;
case "Flash":
ipjModalChooseAsset_MediaURL = ipAssetFactory + "?" + queryStrParam;
ipjModalChooseAsset_SetFlashDetailsVisible();
break;
case "WindowsMedia":
ipjModalChooseAsset_MediaURL = ipAssetFactory + "?" + queryStrParam;
ipjModalChooseAsset_SetAudioVideoDetailsVisible();
break;
case "QuickTime":
ipjModalChooseAsset_MediaURL = ipAssetFactory + "?" + queryStrParam;
ipjModalChooseAsset_SetAudioVideoDetailsVisible();
break;
case "RealMedia":
ipjModalChooseAsset_MediaURL = ipAssetFactory + "?" + queryStrParam;
ipjModalChooseAsset_SetAudioVideoDetailsVisible();
break;
}
}
function ipjModalChooseAsset_ResetDetailsVisibility()
{
ipjFindObj("divAssetDetailsStandard").style.display="block";
ipjFindObj("divAssetDetailsFlash").style.display="none";
ipjFindObj("divAssetDetailsFlashPreviewTag").innerHTML = "";
ipjFindObj("divAssetDetailsFlashPreviewTag").style.display = "none";
ipjFindObj("divAssetDetailsFlashProperties").style.display = "block";
ipjFindObj("chkAssetDetailsFlashPreview").checked=false;
ipjFindObj("divAssetDetailsAudioVideo").style.display="none";
ipjFindObj("divAssetDetailsAudioVideoPreviewTag").innerHTML = "";
ipjFindObj("divAssetDetailsAudioVideoPreviewTag").style.display = "none";
ipjFindObj("divAssetDetailsAudioVideoProperties").style.display = "block";
ipjFindObj("chkAssetDetailsAudioVideoPreview").checked=false;
if (ipjFindObj("rblOpenIn") && ipjFindObj("rblOpenIn_2").checked) {
ipjFindObj("rblOpenIn_0").checked=true;
ipjFindObj("rblOpenIn_1").checked=false;
ipjFindObj("rblOpenIn_2").checked=false;
}
}
function ipjModalChooseAsset_SetFlashDetailsVisible()
{
ipjFindObj("divAssetDetailsStandard").style.display="none";
ipjFindObj("divAssetDetailsAudioVideo").style.display="none";
ipjFindObj("divAssetDetailsFlash").style.display="block";
if (ipjFindObj("rblOpenIn")) {
ipjFindObj("rblOpenIn_0").checked=false;
ipjFindObj("rblOpenIn_1").checked=false;
ipjFindObj("rblOpenIn_2").checked=true;
}
}
function ipjModalChooseAsset_FlashPreviewChecked(chkPreview)
{
if (chkPreview.checked){
ipjFindObj("divAssetDetailsFlashProperties").style.display = "none";
ipjFindObj("divAssetDetailsFlashPreviewTag").style.display = "block";
ipjFindObj("divAssetDetailsFlashPreviewTag").innerHTML = ipjModalChooseAsset_GetFlashTag(true, false, ipjModalChooseAsset_MediaURL);
}
else{
ipjFindObj("divAssetDetailsFlashProperties").style.display = "block";
ipjFindObj("divAssetDetailsFlashPreviewTag").style.display = "none";
ipjFindObj("divAssetDetailsFlashPreviewTag").innerHTML = "";
}
}
function ipjModalChooseAsset_SetAudioVideoDetailsVisible()
{
ipjFindObj("divAssetDetailsStandard").style.display="none";
ipjFindObj("divAssetDetailsFlash").style.display="none";
ipjFindObj("divAssetDetailsAudioVideo").style.display="block";
if (ipjFindObj("rblOpenIn")) {
ipjFindObj("rblOpenIn_0").checked=false;
ipjFindObj("rblOpenIn_1").checked=false;
ipjFindObj("rblOpenIn_2").checked=true;
}
}
function ipjModalChooseAsset_AudioVideoPreviewChecked(chkPreview)
{
if (chkPreview.checked){
ipjFindObj("divAssetDetailsAudioVideoProperties").style.display = "none";
ipjFindObj("divAssetDetailsAudioVideoPreviewTag").style.display = "block";
var strTag="";
switch(ipjModalChooseAsset_MediaType){
case "QuickTime":
strTag=ipjModalChooseAsset_GetQuickTimeTag(true, false, ipjModalChooseAsset_MediaURL);
break;
case "RealMedia":
strTag=ipjModalChooseAsset_GetRealMediaTag(true, false, ipjModalChooseAsset_MediaURL);
break;
default:
strTag=ipjModalChooseAsset_GetWindowsMediaTag(true, false, ipjModalChooseAsset_MediaURL);
break;
}
ipjFindObj("divAssetDetailsAudioVideoPreviewTag").innerHTML = strTag;
}
else{
ipjFindObj("divAssetDetailsAudioVideoProperties").style.display = "block";
ipjFindObj("divAssetDetailsAudioVideoPreviewTag").style.display = "none";
ipjFindObj("divAssetDetailsAudioVideoPreviewTag").innerHTML = "";
}
}
function ipjModalChooseAsset_GetFlashTag(isPreview, useDefaults, mediaURL)
{
var strTag = ""
strTag += "<object codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtFlashWidth).value>200?200:ipjFindObj(ipTxtFlashWidth).value):ipjFindObj(ipTxtFlashWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtFlashHeight).value>200?200:ipjFindObj(ipTxtFlashHeight).value):ipjFindObj(ipTxtFlashHeight).value)) + "\"";
strTag += " align=\"" + (useDefaults?"baseline":ipjFindObj(ipDdlFlashHtmlAlign).value) + "\"";
strTag += " classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\">\n";
strTag += " <param name=\"movie\" value=\"" + mediaURL + "\"/>\n";
if (window.ipTxtFlashBackgroundColor && ipjFindObj(ipTxtFlashBackgroundColor).value!="") {
strTag += " <param name=\"bgcolor\" value=\"" + (useDefaults?"":ipjFindObj(ipTxtFlashBackgroundColor).value) + "\"/>\n";
}
if (window.ipChkFlashTransparent && ipjFindObj(ipChkFlashTransparent).checked){
strTag += " <param name=\"wmode\" value=\"transparent\"/>\n";
}
strTag += " <param name=\"quality\" value=\"" + (useDefaults?"high":ipjFindObj(ipDdlFlashQuality).value) + "\"/>\n";
strTag += " <param name=\"menu\" value=\"" + (useDefaults?"false":ipjFindObj(ipChkFlashMenu).checked) + "\"/>\n";
strTag += " <param name=\"loop\" value=\"" + (useDefaults?"false":ipjFindObj(ipChkFlashLoop).checked) + "\"/>\n";
strTag += " <param name=\"play\" value=\"" + (useDefaults?"true":ipjFindObj(ipChkFlashPlay).checked) + "\"/>\n";
if (!(window.ipChkFlashInsertEmbedTag && !ipjFindObj(ipChkFlashInsertEmbedTag).checked)){
strTag += " <embed pluginspage=\"http://www.macromedia.com/go/getflashplayer\"";
strTag += " align=\"" + (useDefaults?"baseline":ipjFindObj(ipDdlFlashHtmlAlign).value) + "\"";
strTag += " src=\"" + mediaURL + "\"";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtFlashWidth).value>200?200:ipjFindObj(ipTxtFlashWidth).value):ipjFindObj(ipTxtFlashWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtFlashHeight).value>200?200:ipjFindObj(ipTxtFlashHeight).value):ipjFindObj(ipTxtFlashHeight).value)) + "\"";
strTag += " type=\"application/x-shockwave-flash\"";
if (window.ipTxtFlashBackgroundColor && ipjFindObj(ipTxtFlashBackgroundColor).value!="") {
strTag += " bgcolor=\"" + (useDefaults?"":ipjFindObj(ipTxtFlashBackgroundColor).value) + "\"";
}
if (window.ipChkFlashTransparent && ipjFindObj(ipChkFlashTransparent).checked){
strTag += " wmode=\"transparent\"";
}
strTag += " quality=\"" + (useDefaults?"high":ipjFindObj(ipDdlFlashQuality).value) + "\"";
strTag += " menu=\"" + (useDefaults?"false":ipjFindObj(ipChkFlashMenu).checked) + "\"";
strTag += " loop=\"" + (useDefaults?"false":ipjFindObj(ipChkFlashLoop).checked) + "\"";
strTag += " play=\"" + (useDefaults?"true":ipjFindObj(ipChkFlashPlay).checked) + "\">";
strTag += " </embed>\n";
}
strTag += "</object>";
return strTag;
}
function ipjModalChooseAsset_GetWindowsMediaTag(isPreview, useDefaults, mediaURL)
{
var strTag ="";
strTag += "<object";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoWidth).value>200?200:ipjFindObj(ipTxtAudioVideoWidth).value):ipjFindObj(ipTxtAudioVideoWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoHeight).value>200?200:ipjFindObj(ipTxtAudioVideoHeight).value):ipjFindObj(ipTxtAudioVideoHeight).value)) + "\"";
strTag += " align=\"" + (useDefaults?"baseline":ipjFindObj(ipDdlAudioVideoAlign).value) + "\"";
strTag += " classid=\"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6\">\n";
strTag += " <param name=\"url\" value=\"" + mediaURL + "\"/>\n";
strTag += " <param name=\"autostart\" value=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoAutoStart).checked)) + "\"/>\n";
strTag += " <param name=\"uimode\" value=\"" + (useDefaults?"full":(ipjFindObj(ipChkAudioVideoShowControls).checked)?"full":"none") + "\"/>\n";
if (!(window.ipChkAudioVideoInsertEmbedTag && !ipjFindObj(ipChkAudioVideoInsertEmbedTag).checked)){
strTag += " <embed ";
strTag += " pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer\"";
strTag += " align=\"" + (useDefaults?"":ipjFindObj(ipDdlAudioVideoAlign).value) + "\"";
strTag += " src=\"" + mediaURL + "\"";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoWidth).value>200?200:ipjFindObj(ipTxtAudioVideoWidth).value):ipjFindObj(ipTxtAudioVideoWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoHeight).value>200?200:ipjFindObj(ipTxtAudioVideoHeight).value):ipjFindObj(ipTxtAudioVideoHeight).value)) + "\"";
strTag += " type=\"application/x-mplayer2\"";
if (isPreview && !document.all && location.href.indexOf("ModalChooseAsset.aspx")>=0) {
strTag += " showcontrols=\"0\"";
strTag += " autostart=\"0\">";
}
else{
strTag += " showcontrols=\"" + (useDefaults?"1":(ipjFindObj(ipChkAudioVideoShowControls).checked?1:0)) + "\"";
strTag += " autostart=\"" + (useDefaults?"1":(ipjFindObj(ipChkAudioVideoAutoStart).checked?1:0)) + "\">";
}
strTag += " </embed>\n";
}
strTag += "</object>";
return strTag;
}
function ipjModalChooseAsset_GetQuickTimeTag(isPreview, useDefaults, mediaURL)
{
var strTag ="";
strTag += "<object codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\"";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoWidth).value>200?200:ipjFindObj(ipTxtAudioVideoWidth).value):ipjFindObj(ipTxtAudioVideoWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoHeight).value>200?200:ipjFindObj(ipTxtAudioVideoHeight).value):ipjFindObj(ipTxtAudioVideoHeight).value)) + "\"";
strTag += " classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\">\n";
strTag += " <param name=\"src\" value=\"" + mediaURL + "\"/>\n";
strTag += " <param name=\"autoplay\" value=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoAutoStart).checked)) + "\"/>\n";
strTag += " <param name=\"controller\" value=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoShowControls).checked)) + "\"/>\n";
if (!(window.ipChkAudioVideoInsertEmbedTag && !ipjFindObj(ipChkAudioVideoInsertEmbedTag).checked)){
strTag += " <embed ";
strTag += " pluginspage=\"http://www.apple.com/quicktime/download/\"";
strTag += " src=\"" + mediaURL + "\"";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoWidth).value>200?200:ipjFindObj(ipTxtAudioVideoWidth).value):ipjFindObj(ipTxtAudioVideoWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoHeight).value>200?200:ipjFindObj(ipTxtAudioVideoHeight).value):ipjFindObj(ipTxtAudioVideoHeight).value)) + "\"";
strTag += " type=\"video/quicktime\"";
strTag += " controller=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoShowControls).checked)) + "\"";
strTag += " autoplay=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoAutoStart).checked)) + "\">";
strTag += " </embed>\n";
}
strTag += "</object>";
return strTag;
}
function ipjModalChooseAsset_GetRealMediaTag(isPreview, useDefaults, mediaURL)
{
var strTag ="";
strTag += "<object";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoWidth).value>200?200:ipjFindObj(ipTxtAudioVideoWidth).value):ipjFindObj(ipTxtAudioVideoWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoHeight).value>200?200:ipjFindObj(ipTxtAudioVideoHeight).value):ipjFindObj(ipTxtAudioVideoHeight).value)) + "\"";
strTag += " classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\">\n";
strTag += " <param name=\"src\" value=\"" + mediaURL + "\"/>\n";
strTag += " <param name=\"autostart\" value=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoAutoStart).checked)) + "\"/>\n";
strTag += " <param name=\"controls\" value=\"" + (useDefaults?"All":(ipjFindObj(ipChkAudioVideoShowControls).checked)?"All":"ImageWindow") + "\"/>\n";
if (!(window.ipChkAudioVideoInsertEmbedTag && !ipjFindObj(ipChkAudioVideoInsertEmbedTag).checked)){
strTag += " <embed ";
strTag += " pluginspage=\"http://www.real.com/products/player/\"";
strTag += " src=\"" + mediaURL + "\"";
strTag += " width=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoWidth).value>200?200:ipjFindObj(ipTxtAudioVideoWidth).value):ipjFindObj(ipTxtAudioVideoWidth).value)) + "\"";
strTag += " height=\"" + (useDefaults?200:(isPreview?(ipjFindObj(ipTxtAudioVideoHeight).value>200?200:ipjFindObj(ipTxtAudioVideoHeight).value):ipjFindObj(ipTxtAudioVideoHeight).value)) + "\"";
strTag += " controls=\"" + (useDefaults?"All":(ipjFindObj(ipChkAudioVideoShowControls).checked)?"All":"ImageWindow") + "\"";
strTag += " autostart=\"" + (useDefaults?"true":(ipjFindObj(ipChkAudioVideoAutoStart).checked)) + "\">";
strTag += " </embed>\n";
}
strTag += "</object>";
return strTag;
}
function ipEditLink(itemID)
{
document.getElementById('hdnUserAction').value='Edit;' + itemID;
__doPostBack('', '');
};
function ipAddLink(itemID)
{
document.getElementById('hdnUserAction').value='Add;' + itemID;
__doPostBack('', '');
};
var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1);
var __theFormPostData = "";
var __theFormPostCollection=new Array();
function WebForm_InitCallback(){
__theFormPostData = "";
__theFormPostCollection=new Array();
var objForm = document.forms['IronPointForm'];
if (!objForm){
objForm=document.IronPointForm;
}
var count=objForm.elements.length;
var element;
for (var i=0; i<count; i++){
element=objForm.elements[i];
var tagName=element.tagName.toLowerCase();
if (tagName == "input") {
var type=element.type;
if ((type == "text" || type == "hidden" || type == "password" ||
((type == "checkbox" || type == "radio") && element.checked)) &&
(element.id != "__EVENTVALIDATION")) {
WebForm_InitCallbackAddField(element.name, element.value);
}
}
else if (tagName == "select") {
var selectCount=element.options.length;
for (var j=0; j<selectCount; j++){
var selectChild=element.options[j];
if (selectChild.selected==true){
WebForm_InitCallbackAddField(element.name, element.value);
}
}
}
else if (tagName == "textarea") {
WebForm_InitCallbackAddField(element.name, element.value);
}
}
}
function WebForm_InitCallbackAddField(name, value){
var nameValue=new Object();
nameValue.name=name;
nameValue.value=value;
__theFormPostCollection[__theFormPostCollection.length]=nameValue;
__theFormPostData += name + "=" + WebForm_EncodeCallback(value) + "&";
}
function WebForm_EncodeCallback(parameter)
{
if (encodeURIComponent){
return encodeURIComponent(parameter);
}
else{
return escape(parameter);
}
}
function ipjDoXmlHttpRequestSynchronous(strCallerId, strURL, strPostData)
{
WebForm_InitCallback();
var xmlHttp=iGetXmlHttpObject();
if (xmlHttp==null)
{
alert ('Browser does not support HTTP Request');
return;
}
xmlHttp.open('POST',strURL,false);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var strData=new String;
if (strCallerId.length>0)
{
strData = __theFormPostData + '__CALLBACKID=' + WebForm_EncodeCallback(strCallerId) + '&__CALLBACKPARAM=';
}
if (strPostData.length>0)
{
strData+=WebForm_EncodeCallback(strPostData);
}
xmlHttp.send(strData);
return xmlHttp.responseText;
}
function ipjDoXmlHttpRequest(strCallerId, strURL, strPostData, ptrStateChangeFunc)
{
WebForm_InitCallback();
var xmlHttp=iGetXmlHttpObject();
if (xmlHttp==null)
{
alert ('Browser does not support HTTP Request');
return;
}
xmlHttp.onreadystatechange=function()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=='complete')
{
ptrStateChangeFunc(xmlHttp);
}
}
xmlHttp.open('POST',strURL,true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var strData=new String;
if (strCallerId.length>0)
{
strData = __theFormPostData + '__CALLBACKID=' + WebForm_EncodeCallback(strCallerId) + '&__CALLBACKPARAM=';
}
if (strPostData.length>0)
{
strData+=WebForm_EncodeCallback(strPostData);
}
xmlHttp.send(strData);
}
function ipjDoXmlHttpRequestFromModal(returnValue, postbackArgs)
{
if (returnValue)
{
if (postbackArgs.length==3)
{
ipjDoXmlHttpRequest(postbackArgs[0],postbackArgs[1],postbackArgs[2]);
}
}
}
function ipjCreateXMLDOM(strResponseText)
{
var vXMLDoc;
if (window.ActiveXObject)
{
vXMLDoc = new ActiveXObject("Microsoft.XMLDOM");
vXMLDoc.async=false;
vXMLDoc.loadXML(strResponseText);
}
else if(document.implementation.createDocument)
{
var vParser=new DOMParser();
vXMLDoc = vParser.parseFromString(strResponseText, "text/xml");
}
return vXMLDoc;
}
function iGetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
function ipjSessionKeepAlive()
{
var objXMLHttp=iGetXmlHttpObject();
var strURL = iAppendVirtualPath(ipVirDir, "/CM/WebUI/Admin/SessionKeepAlive.aspx?dt=" + new Date().getTime());
objXMLHttp.open('GET', strURL, true);
objXMLHttp.send(null);
}
function getKeyCode(e)
{
if (window.event)
return window.event.keyCode;
else if (e)
return e.which;
else
return null;
}
function ipKeyRestrict(e, validchars)
{
var key='', keychar='';
key=getKeyCode(e);
if (key==null) return true;
keychar=String.fromCharCode(key);
keychar=keychar.toLowerCase();
validchars=validchars.toLowerCase();
if (validchars.indexOf(keychar) !=-1)
return true;
if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
return true;
return false;
}