
/*****************************************************************************************************************
Professional Consulting Services, Inc. Proprietary Notice
Copyright Professional Consulting Services, Inc. 2000, 2001, 2002, 2003, 2004, 2005
1415 North Dayton, Suite 3 South, Chicago, IL 60622, USA.  

This file, the code contained herein are collectively classified as ‘PCS Tools’ owned by Professional Consulting 
Services, Inc.  These are part of the Professional Consulting Services, Inc. (‘PCS’) class library.   All rights 
reserved by PCS. All materials are proprietary, ownership of PCS except as otherwise permitted by written agreement
with PCS, the following are prohibited: copying, modifying, distributing, transmitting, displaying, reproducing, 
publishing, licensing, reproducing, reverse engineering, disassembling, creating derivative work from, transferring,
or selling portions or the entirety of the work in any form or any information from the code, other uses of the 
work inconsistent with U.S. and applicable foreign copyright and related laws.
Certain content of the code is licensed from third parties. All such third party content and all intellectual 
property rights related to that content belong to the respective third parties. User may not remove any copyright, 
trademark, or other intellectual property or proprietary notice or legend contained in the code.

This code may only be used by a Client of PCS or a Client of an approved business partner of PCS. Upon receipt by 
PCS of final payment for all amounts invoiced to Client under this Agreement in which any PCS Tools is incorporated,
PCS grants to Client, a perpetual, non-exclusive, nontransferable license to use, execute, reproduce (only as PCS 
may in its sole discretion consent to in writing) and prepare derivative works, all for Client’s internal purposes 
only, based upon the PCS Tools as incorporated into the work product which is the subject of this Agreement and in 
connection with the use, operation, modification and maintenance of the work product, but Client shall not (x) 
license, sublicense, sell, assign, convey, transfer or disclose to any third party any PCS Tools or otherwise 
permit use of the PCS Tools (including timesharing or network use) by any third party; (y) utilize the PCS Tools 
as independent programming or development tools or templates, or (z) translate, decompile, disassemble or reverse 
engineer all or any part of the PCS Tools (nor permit any third party to do the same).  This Agreement does not 
convey to Client any ownership right in the PCS Tools, but constitutes only a license to use the PCS Tools in 
accordance with all of the terms of this Agreement.  Title to the PCS Tools and the right to grant licenses to 
use the PCS Tools shall at all times remain vested in PCS or its affiliates or licensors. 
******************************************************************************************************************/

/*
Created By	:	Harshada S. Apte.
Created On	:	27 Jun 05
Description	:	Trim function
*/
var boolInfoChange=false;
function trim(pString)
{
	return pString.replace(/(^\s*)|(\s*$)/g, "");
}

//checks textbox for blank if yes returns true otherwise false
function isTxtBlank(txtTextBox)
{
	var strTxt=document.getElementById(txtTextBox);
	if(trim(strTxt.value)=="")
		return true;
	else
		return false; 
}

//checks text is numeric or not   strformat(i=integer,f=decimal/float)
function isNumeric(txtTextBox,strFormat)
{
	var strTxt=document.getElementById(txtTextBox);
	var RegExp="";
	if(!trim(strTxt.value)=="")
	{
		if(strFormat=='i')
			RegExp=/^\d{1,}$/		
		else if(strFormat=='f')
			RegExp=/^\d{1,}($|\.\d{1,2})$/
		if(!RegExp.test(trim(strTxt.value)))
			return false;
	}
	return true;
}

//Check for information change on page
function chkInfoChange(tblID)
{
	var tblCtrl=document.getElementById(tblID);
	var ctrlInput=tblCtrl.getElementsByTagName("input");
	var ctrlSelect=tblCtrl.getElementsByTagName("select");
	var ctrlTxtArea=tblCtrl.getElementsByTagName("textarea");
	for(var iCnt=0;iCnt<ctrlInput.length;iCnt++)
	{
		if(ctrlInput[iCnt].type=='text')
			ctrlInput[iCnt].onchange=function(){boolInfoChange=true; return;} 
		else if(ctrlInput[iCnt].type=='checkbox')
		{
			ctrlInput[iCnt].onclick=function(){boolInfoChange=true; return;} 
		}
	}
	for(var iCnt=0;iCnt<ctrlSelect.length;iCnt++)
	{
		if(ctrlSelect[iCnt].type=='select-one')
			ctrlSelect[iCnt].onchange=function(){boolInfoChange=true; return};		
	}
	for(var iCnt=0;iCnt<ctrlTxtArea.length;iCnt++)
	{
		ctrlTxtArea[iCnt].onchange=function(){boolInfoChange=true; return};				
	}
	
}
//checks if list is empty/item not selected 
function isListEmpty(strLstId)
{
	var lst=document.getElementById(strLstId),iSel=lst.selectedIndex;
	if(lst.length==0)
		return true;
	else
		return false;
}

/////////////CheckBoxList Functions
function isListChecked(strChkList)
{
	var chkList=document.getElementById(strChkList);
	var chkItems=chkList.getElementsByTagName("input");
	for(var iCnt=0;iCnt<chkItems.length;iCnt++)
	 if(chkItems[iCnt].checked==true) return true;
	return false; 						
}
//set click event for provided checkbox list 
function setChkEvent(lstChkCtrl)
{
	var lstC=document.getElementById(lstChkCtrl);
	var chkInput=lstC.getElementsByTagName("input");
	for(var iCount=0;iCount<chkInput.length;iCount++)
	{
		
		chkInput[iCount].onclick=function(){chkUnchkListItems(lstChkCtrl,this)};
		//alert(chkInput[iCount].onclick);
	}
}
//toggle selections of Checkbox List 
function chkUnchkListItems(strChkList,sender)
{
	var chkList=document.getElementById(strChkList);
	var chkItems=chkList.getElementsByTagName("input");
	var chkLabel=chkList.getElementsByTagName("label");
	var inText=sender.parentElement.childNodes[1].innerText.toUpperCase();
	boolInfoChange=true;
	if(sender.checked==true)
	{
		
		if((inText=='ALL')||(inText=='N/A')||(inText=='NATL')||(inText=='NONE'))
		{
			for(var iCnt=0;iCnt<chkItems.length;iCnt++)
					chkItems[iCnt].checked=false;
			sender.checked=true;		  
		}
		else
		{
			var inTxt=""
			for(var i=0;i<chkItems.length;i++)
			{
				inTxt=chkLabel[i].innerText.toUpperCase();
				if((inTxt=='ALL')||(inTxt=='N/A')||(inTxt=='NATL')||(inTxt=='NONE'))
					chkItems[i].checked=false;
			}	
		} 
	}
}
//ask for the confirmation when click on control
//useful for asp.net server controls  client side(javascript) code
function confirmAction(cmdCtrl,strMsg)
{
	var cmdLCtrl=document.getElementById(cmdCtrl);
	if(strMsg==undefined) 
		strMsg="Are you sure to Save and Continue";
	cmdLCtrl.onclick=function(){return confirm(strMsg)};
}

//value from dropdown selected or not
function isDropdownSelect(strDropList)
{
	var dropList=document.getElementById(strDropList);
	if(dropList.selectedIndex==0) 
		return false; 						
	else
		return true; 						
}
//disable ctrlTo for the iCtrlIndex selectedindex of parent list 
//lstCtrl when the client list value is not applicable
function isListNA(lstCtrl,ctrlTo,iCtrlIndex)
{
	var lstFrm=document.getElementById(lstCtrl);
	var ctlTo=document.getElementById(ctrlTo);
	 boolInfoChange=true;
	if(lstFrm.selectedIndex==iCtrlIndex) 
	{
		ctlTo.disabled=true; 
		if(ctlTo.type=='text')
			ctlTo.value="";
		if(ctlTo.type=='textarea')
			ctlTo.value="";	
		else if(ctlTo.type=='select-one')
			ctlTo.selectedIndex=0;
	}
	else
		ctlTo.disabled=false;
			
}
//clear list box
function ClearListBox(strLstId)
{
	var lst=document.getElementById(strLstId);
	lst.innerText="";
}

//'showIndex' is index of 'indexCtl' for which 'showCtl' contol to unhide
function ShowHide(showIndex,indexCtl,showCtl)
{
	var iCtl=document.getElementById(indexCtl)
	var sCtl=document.getElementById(showCtl)
	if(iCtl.selectedIndex==showIndex) 
		sCtl.style.display="block";	
	else sCtl.style.display="none"; 
}


/////////date validation functions/////////////

//validate dates and checks if from date is greater than to date
//returns error message
function Check_From_To_Date(strId1,strId2,strMsg)
{
	var ErrMsgs="";
	var txtDt1=document.getElementById(strId1);
	var txtDt2=document.getElementById(strId2);
	var bValid=true;
	if(!isValidDate(txtDt1,"0"))
	{
		ErrMsgs+=" - Invalid From-Date.\n"
		if(!Ctl)Ctl=txtDt1,bValid=false;
	}
	if(!isValidDate(txtDt2,"0"))
	{
		ErrMsgs+=" - Invalid To-Date.\n"
		if(!Ctl)Ctl=txtDt2,bValid=false;
	}
	if(bValid && Date.parse(txtDt1.value) > Date.parse(txtDt2.value))
	{
		if(strMsg==undefined)
			ErrMsgs+=" - From-date cannot be greater than Thru-date.\n"
		else
			ErrMsgs+=" - "+strMsg+"\n"
		bValid = true;
	}
	return ErrMsgs
}

/*
	var ErrMsgs="";
	var txtDt1=document.getElementById(strId1);
	var txtDt2=document.getElementById(strId2);
	var bValid=true;
	if(!isValidDate(strId1))
	{
		ErrMsgs+=" - Invalid From-Date.\n"
	}
	if(!isValidDate(strId2))
	{
		ErrMsgs+=" - Invalid To-Date.\n"
	}
	if(bValid && (txtDt1.value > txtDt2.value))
	{
		if(strMsg==undefined)
		ErrMsgs+=" - From-date cannot be greater than To-date.\n"
		else
		ErrMsgs+=' - '+strMsg+'\n'
	}
	return ErrMsgs;
}*/

//Fuction to validate date MMDDYYYY format.
function isValidDate(txtCtl, strDefValue) 
{
	
	if(InvalidDate(txtCtl,strDefValue))
		return false;
	else
		return true;
}
function InvalidDate(txtCtl, strDefValue)
{
	
	var RegExp=/^(0?[1-9]|10|11|12)[/](0?[1-9]|[12][0-9]|30|31)[/](\d{4})$/
	strSource=trim(txtCtl.value);
	
	if(!strSource.length)
	{
		if(strDefValue=="0")txtCtl.value="01/01/1900";
		else if(strDefValue=="1") txtCtl.value="";//use server date(today)
		else txtCtl.value=strDefValue;
		return false;
	}
	var Parts=strSource.match(RegExp);
	if(!Parts) return true;
	else
	{
		var Month=parseInt(Parts[1]),Day=parseInt(Parts[2]),Year=parseInt(Parts[3]);
		var bInvalid=((Month==4||Month==6||Month==9||Month==11)&&Day==31)||(Month==2 && (Day>29 ||(Day==29 && !Year%4 && Year%100)))
		if(!bInvalid)if(Year<1753)txtCtl.value="01/01/1753"
		return bInvalid
	}
}

function Check_Date(strId,strDefValue)
{
	txtDate=document.getElementById(strId);
	if(txtDate.value!="")
	{	
		if(!strDefValue)strDefValue="0"
		if(InvalidDate(txtDate,strDefValue))
		{
			return false;
		}
	}
	else
	{
		return false;
	}
	return true;		
}

	/*
	// Checks for the following valid date formats:
	//MMDDYYYY
	var datePat = /^(\d{1,2})(\d{1,2})(\d{4})$/; // requires 4 digit year
	var Vdate = document.getElementById(txtDate);
	var dateStr = Vdate.value;
	if(dateStr.length!=8) return false;
	var matchArray = dateStr.match(datePat); // is the format ok?
	if (matchArray == null) 
	{
		return false;
	}
	month = matchArray[1]; // parse date into variables
	day = matchArray[2];
	year = matchArray[3];
	if (month < 1 || month > 12) 
	{ // check month range
		return false;
	}
	if (day < 1 || day > 31) 
	{
		return false;
	}
	if ((month==4 || month==6 || month==9 || month==11) && day==31) 
	{
		return false;
	}
	if (month == 2) 
	{ 
		// check for february 29th
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day>29 || (day==29 && !isleap)) 
		{
			return false;
		}
	}
	return true;
}*/

//validate dates and checks if from date is greater than to date
//returns error message (ALLOW NULL ENTRIES)
function Check_From_To_Date_Allow_Null(strId1,strId2,strMsg)
{
	var ErrMsgs="";
	var txtDt1=document.getElementById(strId1);
	var txtDt2=document.getElementById(strId2);
	var bValid=true;
	if(!isValidDateAllowNull(txtDt1,"0"))
	{
		ErrMsgs+=" - Invalid From-Date.\n"
		ErrMsgs+=' - '+strMsg+'\n'
		 bValid=false;
		return ErrMsgs;
	}
	if(!isValidDateAllowNull(txtDt2,"0"))
	{
		ErrMsgs+=" - Invalid To-Date.\n"
		ErrMsgs+=' - '+strMsg+'\n'
		bValid=false;
		return ErrMsgs;
	}
	//alert(txtDt1.value);
	//alert(txtDt2.value);
	if(bValid && Date.parse(txtDt1.value) > Date.parse(txtDt2.value))
	{
		ErrMsgs+=" - From-date cannot be greater than To-date.\n"
		bValid=false;
		return ErrMsgs;
	}
	return ErrMsgs;
}

//Function to validate input date(ALLOW NULL ENTRIES)
function isValidDateAllowNull(txtCtl, strDefValue)
{

	// Checks for the following valid date formats:
	//MMDDYYYY
	//var Vdate = document.getElementById(txtDate);
	var dateStr = txtCtl.value;
	if (dateStr == "")//Allow Null value in Date entry.
	{
		return true;
	} 
	else		//Check for valid date format.
	{
		return isValidDate(txtCtl, strDefValue);
	}
}
/////////date validation functions end/////////////

//email ID Validation

function isValidEmailId(txtEMailId)
{
	var strText=document.getElementById(txtEMailId);
	if(/@.*@|\.\.|@\.|\.@|^\./.test(strText)||!/^[^ ]+@[a-zA-Z0-9\-\.]+\.[a-zA-Z]+$/.test(strText.value))
		return false;
	else
		return true;
}

//display error function      
//Page must contain Header User control with Name UCHeader
//ErrMsg is the error string to be displayed
//errType :- 1:client/validation, 2:alert 3:server
var Ctl="",ErrMsg="";
function DisplayErrorIfAny(errType)
{
	var lblErrDisplay=document.getElementById("UCHeader_lblErrDisplay");		
	if(ErrMsg.length)
	{
		//var ctrCtl=document.getElementById(Ctl);		
		if(errType==1)
		 lblErrDisplay.innerText=ErrMsg;	
		if(errType==2)
		 alert(lblErrDisplay.innerText);
		if(errType==3)
		 lblErrDisplay.innerText=ErrMsg;	
		ErrMsg='';  //Ctl=null;
		lblErrDisplay.focus();
		return true; //there are errors 
	}
	else
	{
		ErrMsg="";
		lblErrDisplay.innerText=ErrMsg;	
	}
	return false;   //no errors
}


function Check_From_To_Date_AllowNullValues(strQId1,strQId2,strMsg)
{
	var ErrMsgs="";
	var txtQDt1=document.getElementById(strQId1);
	var txtQDt2=document.getElementById(strQId2);
	var bQValid=true;

//	if(!isValidDate(strId1,"0"))
//	{
//		ErrMsgs+=" - Invalid From-Date.\n"
//	}
//	if(!isValidDate(strId2,"1"))
//	{
//		ErrMsgs+=" - Invalid To-Date.\n"
//	}
	if(bQValid && (txtQDt1.value > txtQDt2.value) &&  isValidDate(strQId1,"0") && isValidDate(strQId2,"1"))
	{
		ErrMsgs+=" - From-date cannot be greater than To-date.\n"
		ErrMsgs+=' - '+strMsg+'\n'
	}
	return ErrMsgs;
}
function chkNew(txtReqCtrl)
{
	var txtReqC=document.getElementById(txtReqCtrl);
	if(trim(txtReqC.value)=='')
	boolInfoChange=true;
}
//function to ask confirmation of exit without saving
function isExitWithoutSave()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to exit without saving information?');
	return boolYN;
}

function GetRequiredHelpContext(intmainpageId,intsubpageId,intfieldId)
{   
   //var cord=getPos(sender);
     
    if (intsubpageId!=0 && intfieldId!=0)
    {
      if (intmainpageId==100)
      window.open("../Help/HelpPage.aspx?MainPageId="+intmainpageId+"&SubPageId="+intsubpageId+"&FieldId="+intfieldId,"Help","width=410,height=600,maximize=yes,toolbar=no,scrollbars=yes resize=yes,top=40,left=40")
      else
      
//    window.open("TryForHelp.aspx?MainPageId="+intmainpageId+"&SubPageId="+intsubpageId+"&FieldId="+intfieldId,"resize=no,top=40,left=40,width="+ screen.availWidth-10 +"maximize=no,toolbar=no,scrollbars=yes")
      window.open("../Help/HelpPage.aspx?MainPageId="+intmainpageId+"&SubPageId="+intsubpageId+"&FieldId="+intfieldId,"Help","width=380,height=400,maximize=yes,toolbar=no,scrollbars=no resize=yes,top=40,left=40")
    }
    else 
 
     {
//    window.open("TryForHelp.aspx?MainPageId="+intmainpageId+"&SubPageId="+intsubpageId+"&FieldId="+intfieldId,"resize=no,top=40,left=40,width="+ screen.availWidth-10 +"maximize=no,toolbar=no,scrollbars=yes")
      window.open("../Help/HelpPage.aspx?MainPageId="+intmainpageId+"&SubPageId="+intsubpageId+"&FieldId="+intfieldId,"Help","width=410,height=600,maximize=yes,toolbar=no,scrollbars=yes resize=yes,top=40,left=40")
    }
   
     
}
function getPos(anchorname)
{
	var x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
	var y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
	if(isNaN(window.screenX))
	{
		x=x-document.body.scrollLeft+window.screenLeft;
		y=y-document.body.scrollTop+window.screenTop;
	}
	else
	{
		x=x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
	}

	var coordinates=new Object();
	coordinates.x=x,coordinates.y=y;
	return coordinates;
}
function AnchorPosition_getPageOffsetLeft (el)
{
	var ol=el.offsetLeft;
	while((el=el.offsetParent)!= null)ol += el.offsetLeft;
	return ol;
}
function AnchorPosition_getPageOffsetTop (el)
{
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) ot += el.offsetTop;
	return ot;
}

function CheckBlankForAllFields( arrFields )
{
	ErrMsg = "";
	var txtMsg = " cannot be blank.\n";
	var lstMsg = "  is not selected.\n";
	for( var i=0; i < arrFields.length; i++ )
	{
		if( arrFields[i][0].substr(0,1) == "t" )
		{
			if( trim(eval("document.getElementById('" + arrFields[i][0] + "').value")) == ""  )
				ErrMsg = ErrMsg + arrFields[i][1] + txtMsg;
		}else{
			if( eval("document.getElementById('" + arrFields[i][0] + "').selectedIndex") == -1 || ( eval("document.getElementById('" + arrFields[i][0] + "').selectedIndex") == 0) )
				ErrMsg = ErrMsg + arrFields[i][1] + lstMsg;	
		}
	}
}

function ClearForm( arrFields )
{
	ErrMsg = "";
	for( var i=0; i < arrFields.length; i++ )
	{
		if( arrFields[i].substr(0,1) == "t" )
			eval("document.getElementById('" + arrFields[i] + "').value=''");
		else
			eval("document.getElementById('" + arrFields[i] + "').selectedIndex=0");
	}
	DisplayErrorIfAny(1);
}

function chkTxtMaxLen(text,long) 
{
	//func to restrict max length on multiline textbox.
	var txt = document.getElementById(text);
	var maxlength = new Number(long); // Change number to your max length.
	if (txt.value.length > maxlength)
	{
		txt.value = txt.value.substring(0,maxlength);
	}
	
}
function setChangeInfo()
{   // set boolInfoChange to true
	boolInfoChange = true;
	
}
/* Commented Code
//function to ask confirmation to save and continue to Content Details Tab
function isSaveContinueToContentDetails()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "Content Details Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to Audience Tab
function isSaveContinueToAudience()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "Audience Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to Audience Tab by PopUp page 
function isSaveContinueToAudience1()
{
	var boolYN=true;
	if(boolInfoChange)
	window.open('../MessageDetails/MMS_ConfirmPopUp.aspx','Select','resizable=no,scrollbars=no,width=420,height=210,toolbar=no,top=300,left=400');
	
//	boolYN=confirm('Are you sure to "Save and Continue" to "Audience Tab" ?');
	//return boolYN;
}
function LoadConfirmPopUp()
{
	if(boolInfoChange)
	{
	window.open('../MessageDetails/MMS_ConfirmPopUp.aspx','Select','resizable=no,scrollbars=no,width=420,height=210,toolbar=no,top=300,left=400');
	 	
	}
	else
	{ document.getElementById("hidInfoChange").value= "2";} // No - exit without saving 
}

//function to ask confirmation to save and continue to ITInfo Tab
function isSaveContinueToITInfo()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "IT Info Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to Approval Info Tab
function isSaveContinueToApprovalInfo()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "Approval Info Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to Message Board Tab
function isSaveContinueToMessageBoard()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "Message Board Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to CSR Tab
function isSaveContinueToCSR()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "CSR Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to Language Tab
function isSaveContinueToLanguage()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "Language Tab" ?');
	return boolYN;
}
//function to ask confirmation to save and continue to Language Tab
function isSaveContinueToCampaign()
{
	var boolYN=true;
	if(boolInfoChange)
	boolYN=confirm('Are you sure to "Save and Continue" to "Campaign Tab" ?');
	return boolYN;
}
*/

//Function for showing Help
function ShowHelp(PageTitle,TabTitle,SubTabTitle,FieldTitle)
{
	var objWindow;
	var verticalPosition;
	var iTop;
	var iLeft;
	var iHeight;
	var iWidth;
	/*if ((PageTitle == 'Help Maintenance') //&& (SectionName == 'Help Maintenance'))
	{
		iHeight = 600;
		iWidth = 800;
		iTop = (screen.height - iHeight) / 2
		iLeft = (screen.width - iWidth) / 2
		strServerName=location.hostname.toString();
		strURL=location.toString().split("/");
		
		objWindow = window.open('http://'+strServerName+'/'+strURL[3]+'/Help/MMS_Help.aspx?TitleName='+TitleName+'&SectionName='+SectionName+'&TabName='+TabName+'&TabSubSection='+TabSubSection, 'OnlineHelp', "height=" + iHeight + ",width=" + iWidth + ",top=" + iTop + ",left=" + iLeft + ",resizable=yes,maximize=yes,toolbar=no,scrollbars=yes");
	}
	else*/
	
	{
		iHeight = 550;
		iWidth = 500;
		iTop = (screen.height - iHeight) / 2
		iLeft = (screen.width - iWidth) / 2
		strServerName=location.hostname.toString();
		strURL=location.toString().split("/");
		
		objWindow = window.open('http://'+strServerName+'/'+strURL[3]+'/Help/MMS_Help.aspx?PageTitle='+PageTitle+'&TabTitle='+TabTitle+'&SubTabTitle='+SubTabTitle+'&FieldTitle='+FieldTitle, 'OnlineHelp', "height=" + iHeight + ",width=" + iWidth + ",top=" + iTop + ",left=" + iLeft + ",resizable=no,maximize=no,toolbar=no,scrollbars=yes");
	}
	
}


