

/*
Localization strings. Note that the actual string values are in res.asp
*/
var G_C_CLOSE = "Close";
var G_C_FORM_PRINTING = "The form is being printed.";
var G_C_T_APPROVED = "Approved";
var G_C_T_COMPLETED = "Completed";
var G_C_T_TIMEOUT = "Timed Out";
var G_C_T_REJECTED = "Rejected";
var G_C_T_DNF = "Did Not Finish";
var G_C_T_FAILED = "Failed";
var G_C_T_CANCELLED = "Cancelled";
var G_C_T_SKIPPED = "Skipped";
var G_C_T_PENDING = "Pending Activation";
var G_C_T_NOTIFIED = "Notified";
var G_C_T_IN_PROGRESS = "In Progress";
var G_C_T_REASSIGNED = "Reassigned";
var G_C_WF_Slip_Name = "Name / Comments";
var G_C_WF_TaskCompleted = "Completed";
var G_C_Status = "Status";
var G_C_OK = "OK";
var G_C_Cancel = "Cancel";
var G_C_Close = "Close";
var G_C_Complete = "Complete";
var G_C_Approve = "Approve";
var G_C_Reject = "Reject";
var G_C_CommentUser = "User";
var G_C_CommentDate = "Date";
var G_C_CommentComment = "Comment";

/*
These are the iMarkup client helper routines.
*/
var UsingForm;

// This function is a front-end to the JS replace method
// NOTE: Be careful for loops - do not allow findstr to exist in replacestr
function ReplaceAll(str,findstr,replacestr)
{
	while (str.indexOf(findstr)!=-1)
	{
		str=str.replace(findstr, replacestr);
	}
	return str;
}

function StripSpace(name)
{
	name=ReplaceAll(name," ","&nbsp;");
	return(name);
}
function StripQuote(name)
{
	name=ReplaceAll(name,"'","");
	name=ReplaceAll(name,"\"","");
	return(name);
}
// Used because the \u character is a bad one in JavaScript since it looks like the start of Unicode
function StripU(name)
{
	name=ReplaceAll(name,"\\u","");
	return(name);
}
function HTML_CR(sString)
{
	var ret;
	ret = ReplaceAll(sString,"\x0d\x0a","<br>");
	ret = ReplaceAll(sString,"\x0a","<br>");
	return ret;
}
function StripCR(sString)
{
	var ret;
	ret = ReplaceAll(sString,"\x0d","");
	ret = ReplaceAll(sString,"\x0a","");
	return ret;
}
function EncodeNextPage(url)
{
	url = ReplaceAll(url,"&","-amp;");
	url = ReplaceAll(url,"#","-pound;");
	url = ReplaceAll(url,"-amp;portaltype","&portaltype");
	return(url);
}

function LTrim(str) 
{
	if (str=="")
		return "";
	for (var i=0; str.charAt(i)<=" "; i++);
	return str.substring(i,str.length);
}

function RTrim(str)
{
	if (str=="")
		return "";
	for (var i=str.length-1; str.charAt(i)<=" "; i--);
	return str.substring(0,i+1);
}

function Trim(str)
{
	return LTrim(RTrim(str));
}

function IsNumeric(sText)
{
	var ValidChars = "0123456789";
	var Char;
	for (i = 0; i < sText.length; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
			return false;
	}
	return true;
}

function iDialogTabsBegin(postlocation,otherstuff)
{
	UsingForm=false;
	if ( "undefined" != typeof(postlocation) && postlocation!="" )
	{
		document.write("<form ID=DialogForm NAME=DialogForm ACTION='" + postlocation + "' METHOD='POST' " + otherstuff + " >")
		UsingForm=true;
	}
	
	document.write("<table cellpadding=0 cellspacing=0 width=100%>")
	document.write("<tr><td width=100%>")
	document.write("  <table width=100% cellpadding=0 cellspacing=0><tr>")
}

function iDialogActiveTab(name,icon,disabled)
{
	name=StripSpace(name);
	var disablestr="";
	if ( "undefined" != typeof(disabled) && disabled!=false )
	{
		disablestr=" style='color:gray;' ";
	}
	if (name!="")
	{
		document.write("<td class='TabActive'" + disablestr + ">")
		document.write("&nbsp;&nbsp;&nbsp;")
		if ( "undefined" != typeof(icon) && icon!="" )
		{
			document.write(icon);
			document.write("&nbsp;");
		}
		document.write(name)
		document.write("&nbsp;&nbsp;&nbsp;</td>")
	}
}

function iDialogActiveTab2(name,icon,disabled)
{
	name=StripSpace(name);
	var disablestr="";
	if ( "undefined" != typeof(disabled) && disabled!=false )
	{
		disablestr=" style='color:gray;' ";
	}
	if (name!="")
	{
		document.write("<td class='TabActive2'" + disablestr + ">")
		document.write("&nbsp;&nbsp;&nbsp;")
		if ( "undefined" != typeof(icon) && icon!="" )
		{
			document.write(icon);
			document.write("&nbsp;");
		}
		document.write(name)
		document.write("&nbsp;&nbsp;&nbsp;</td>")
	}
}

function iDialogInactiveTab(name,link,options,icon,disabled)
{
	name=StripSpace(name);
	var disablestr="";
	if ( "undefined" != typeof(disabled) && disabled!=false )
	{
		disablestr=" style='color:gray;' ";
	}
	document.write("<td class='TabInactive'>")
	document.write("<A class='TabText' href='" +link+ "' " + options + disablestr + ">");
	document.write("&nbsp;&nbsp;&nbsp;")
	if ( "undefined" != typeof(icon) && icon!="" )
	{
		document.write(icon);
		document.write("&nbsp;");
	}
	document.write(name)
	document.write("&nbsp;&nbsp;&nbsp;</td>")
	document.write("</A>");
}

function iDialogDoneTab()
{
	document.write("<td width=100% class='TabTop'>&nbsp;</td>")
}

function iDialogTabs()
{
	document.write("</tr></table>")
	document.write("</td></tr>")
	document.write("<tr><td>")
	document.write("<TABLE class='DialogTable' cellSpacing=0 cellPadding=0><tr><td colspan=100 class='DialogSpacerSmall'></td></tr>");
}

function iDialogTabs2()
{
	document.write("</tr></table>")
	document.write("</td></tr>")
	document.write("<tr><td>")
	document.write("<TABLE class='DialogTable2' cellSpacing=0 cellPadding=0><tr><td colspan=100 class='DialogSpacerSmall'></td></tr>");
}

function iDialogTabsEnd()
{
	document.write("</table>")
	document.write("</td></tr>")
	document.write("</table>")

	if (UsingForm)
	{
		document.write("</FORM>");
	}
}

function iDialogOptionTab(option,link,prompt)
{
	option=StripSpace(option);
	document.write("<td class='TabOption'>")
	if ( "undefined" != typeof(prompt) && prompt!="" )
	{
		document.write(" <A onclick='if (!confirm(\" "+prompt+" \")){return false;}' class='DialogOptionsText' href='"+link+"'>"+option+"</A>&nbsp;&nbsp;&nbsp;&nbsp;");
	}
	else
	{
		if ( "undefined" != typeof(link) && link!="" )
		{
			document.write(" <A class='DialogOptionsText' href='"+link+"'>"+option+"</A>&nbsp;&nbsp;&nbsp;&nbsp;");
		}
		else
		{
			document.write(" <SPAN class='DialogOptionsTextCurrent'>"+option+"</SPAN>&nbsp;&nbsp;&nbsp;&nbsp;");
		}
	}
	document.write("</td>")
}

function iDialogOptionTabFunc(option,func)
{
	option=StripSpace(option);
	document.write("<td class='TabOption'>")
	document.write(" <A class='DialogOptionsText' href='#' onclick='"+func+";return false;'>"+option+"</A>&nbsp;&nbsp;&nbsp;&nbsp;");
	document.write("</td>")
}

function iDialogColumnBegin()
{
	document.write("<tr class='DialogColumns'>");
}

function iDialogColumn(name)
{
	if (name=="")
	{
		name="&nbsp;";
	}
	document.write("<td>"+name+"</td>");
}

function iDialogColumnRight(name)
{
	if (name=="")
	{
		name="&nbsp;";
	}
	document.write("<td align=right>"+name+"</td>");
}

function iDialogColumnCenter(name)
{
	if (name=="")
	{
		name="&nbsp;";
	}
	document.write("<td align=center>"+name+"</td>");
}

function iDialogColumnEnd()
{
	document.write("</tr><tr><td colspan=100 class='DialogSpacerSmall'></td></tr>");
}

function iDialogColumnEndClose()
{
	document.write("</tr>");
}

var dialogspace;
var dialogentry;
var dialogentryhot;
var dialogentrydesc;

function iDialogEntryBegin(WhiteBackground,Close)
{
	if (WhiteBackground)
	{
		if (Close)
		{
			dialogspace="DialogWhiteSpaceClose";
		}
		else
		{
			dialogspace="DialogWhiteSpace";
		}
		dialogentry="DialogWhiteEntry";
		dialogentryhot="DialogWhiteEntryHot";
		dialogentrydesc="DialogWhiteDesc";
	}
	else
	{
		if (Close)
		{
			dialogspace="DialogSpaceClose";
		}
		else
		{
			dialogspace="DialogSpace";
		}
		dialogentry="DialogEntry";
		dialogentryhot="DialogEntryHot";
		dialogentrydesc="DialogDesc";
	}
	document.write("<tr><td colspan=100 class='"+dialogspace+"'></td></tr><tr class='"+dialogentry+"'>");
}

function iDialogEntryX(right,center,hot,name,link,prompt,popup)
{
	if (name=="")
	{
		name="&nbsp;";
	}
	var centertag;
	if (center)
		centertag="<td>&nbsp;&nbsp;&nbsp;";
	else if (right)
		centertag="<td align=right>";
	else
		centertag="<td>";
	var hottag;
	if (hot)
		hottag=dialogentryhot;
	else
		hottag=dialogentry;
	if (link!="" && "undefined" != typeof(link))
	{
		var TARGET="";
		if (popup)
		{
			TARGET = "TARGET=_blank";
		}
		if ( "undefined" != typeof(prompt) && prompt!="" )
		{
			document.write(centertag+"<A "+TARGET+" onclick='if (!confirm(\" "+prompt+" \")){return false;}' class='"+hottag+"' href='"+link+"'>"+name+"</A></td>");
		}
		else
		{
			document.write(centertag+"<A "+TARGET+" class='"+hottag+"' href='"+link+"'>"+name+"</A></td>");
		}
	}
	else
	{
		document.write(centertag+name+"</td>");
	}
}

function iDialogEntry(name,link,prompt,popup)
{
	iDialogEntryX(false,false,false,name,link,prompt,popup);
}

function iDialogEntryHot(name,link,prompt)
{
	iDialogEntryX(false,false,true,name,link,prompt,false);
}

function iDialogEntryCenter(name,link,prompt)
{
	iDialogEntryX(false,true,false,name,link,prompt,false);
}

function iDialogEntryRight(name,link,prompt)
{
	iDialogEntryX(true,false,false,name,link,prompt,false);
}

function iDialogEntryTagX(center,tag)
{
	var centertag;
	if (center)
		centertag="<td align='center'>";
	else
		centertag="<td>";
	document.write(centertag+tag+"</td>");
}

function iDialogEntryTag(tag)
{
	iDialogEntryTagX(false,tag);
}

function iDialogEntryTagCenter(tag)
{
	iDialogEntryTagX(true,tag);
}

function iDialogEntryEnd1()
{
	document.write("</tr>");
}

// This description is placed 1 column to the right in the table
function iDialogDescEntry(desc)
{
	if (desc!="")
	{
		document.write("<tr class='"+dialogentrydesc+"'><td></td><td colspan=100>"+desc+"</td></tr>");
	}
}

// This description is placed to the extreme left of the table
function iDialogDescEntryLeft(desc)
{
	if (desc!="")
	{
		document.write("<tr class='"+dialogentrydesc+"'><td colspan=100>"+desc+"</td></tr>");
	}
}

function iDialogEntrySpacer()
{
	document.write("<tr><td colspan=100 class='DialogSpacer'></td></tr>");
}
function iDialogEntrySpacerSmall()
{
	document.write("<tr><td colspan=100 class='DialogSpacerSmall'></td></tr>");
}

function iDialogEntryEnd2()
{
	document.write("<tr><td colspan=100 class='"+dialogspace+"'></td></tr>");
}

function IsWindows()
{
	if ( navigator.userAgent.indexOf("Win") != -1 )
	{
		return true;
	}
	return false;
}

// Is the browser IE?
//function IsIE()
//{ if (document.layers) return false; else return true; }
function IsIE()
{
	if ( navigator.userAgent.indexOf("MSIE") != -1 && navigator.appName.indexOf("Microsoft") != -1 )
	{
		return true;
	}
	return false;
}

function TestBrowser()
{
	if ( !IsIE() )
	{
		alert("This browser is not supported by the iMarkup Plug-in")
		return false;
	}
	else if (navigator.appVersion.substr(0, 1) < 4)
	{
		alert("This browser is not supported by the iMarkup Plug-in")
		return false;
	}
	return true;
}

function iMarkupClientVersion()
{
	if ( "object" != typeof(ClientiMarkupObject) || "undefined" == typeof(ClientiMarkupObject.clientVersion))
	{
		return 0;
	}
	return ClientiMarkupObject.clientVersion;
}

// A "safe" function to get the top-most iMarkup window
function GetTopiMarkupWindow(pWnd)
{
	var Curr;
	// If we are passed a window, then use it. Otherwise, use current window
	if (pWnd)
		Curr=pWnd;
	else
		Curr=window;
	var PrevCurr=Curr;
	while (Curr!=top)
	{
		if (Curr.closed)
		{
			return PrevCurr;
		}
		try
		{
			if (Curr.location.href.indexOf("home.asp")!=-1)
			{
				return Curr;
			}
		}
		// This is caught a parent is in a different domain
		// Since you cannot access the location property
		catch(e)
		{
			return PrevCurr;
		}
		// If the parent is the same as me, then just return me
		if (Curr == Curr.parent)
		{
			return Curr;
		}
		PrevCurr = Curr;
		Curr = Curr.parent
		if (Curr.closed)
		{
			return PrevCurr;
		}
	}
	return Curr;
}
function GetiMarkupNavWindow(pWnd)
{
	
		var OpenerTop = GetTopiMarkupWindow(pWnd);
		var TempTest=false;
		try
		{
			// Because of bugs in IE, sometimes the opener windows class throws exceptions
			// so we must catch those. In these cases, we cannot navigate or refresh the opener (parent).
			// NOTE: Sometimes .closed is blank ... therefore we use closed!=true instead of closed==true
			TempTest = (OpenerTop && OpenerTop.closed!=true && OpenerTop.frames && 
				OpenerTop.frames['homeleft'] && OpenerTop.frames['homeleft'].closed!=true && 
				OpenerTop.frames['homeleft'].frames && 
				OpenerTop.frames['homeleft'].frames['homenav_left'] && OpenerTop.frames['homeleft'].frames['homenav_left'].closed!=true);
		}
		catch (e)
		{
			
			return null;
		}
		if (TempTest)
		{
			return OpenerTop.frames['homeleft'].frames['homenav_left'];
		}
		else
		{
			return null;
		}
	
}
function iEnableObject(id)
{
	if (iGetObject(id) && typeof(iGetObject(id).disabled) == "boolean")
	{
		iGetObject(id).disabled=false;
	}
}
function iDisableObject(id)
{
	if (iGetObject(id) && typeof(iGetObject(id).disabled) == "boolean")
	{
		iGetObject(id).disabled=true;
	}
}
function iGetObject (id) {
	if (document.layers)
		return document[id];
	else if (document.all)
		return document.all[id];
	else if (document.getElementById)
	{
		// Firefox must return undefined so we can check result with typeof
		if (document.getElementById(id)==null)
			return undefined;
		else
			return document.getElementById(id);		
	}
}
function iGetObjectParent (id) {
	if (parent.opener.document.layers)
		return parent.opener.document[id];
	else if (parent.opener.document.all)
		return parent.opener.document.all[id];
	else if (parent.opener.document.getElementById)
	{
		// Firefox must return undefined so we can check result with typeof
		if (parent.opener.document.getElementById(id)==null)
			return undefined;
		else
			return parent.opener.document.getElementById(id);
	}
}
function iHideObject (id) {
	if (document.layers)
	{
		if (document[id])
			document[id].visibility  = 'hide';
	}
	else if (document.all)
	{
		if (document.all[id])
			document.all[id].style.display = 'none';
	}
	else if (document.getElementById)
	{
		if (document.getElementById(id)!=null)
			document.getElementById(id).style.display = 'none';
	}
}
function iShowObject (id) {
	if (document.layers)
	{
		if (document[id])
			document[id].visibility = 'visible';
	}
	else if (document.all)
	{
		if (document.all[id])
			document.all[id].style.display = 'inline';
	}
	else if (document.getElementById)
	{
		if (document.getElementById(id)!=null)
		    document.getElementById(id).style.display = 'inline';
	}
}
function iWaitCursor()
{
	if (document && document.body && document.body.style && typeof(document.body.style.cursor)!="undefined")
		document.body.style.cursor = 'wait';	
}
function setClassObject (id,classname) {
	if (document.layers)
		document[id].className = classname;
	else if (document.all)
		document.all[id].className = classname;
	else if (document.getElementById)
	    document.getElementById(id).className = classname;
}
function isVisibleObject (id) {
	if (document.layers)
		return document[id].visibility == 'visible';
	else if (document.all)
		return document.all[id].style.display == 'inline';
	else if (document.getElementById)
	    return document.getElementById(id).style.display == 'inline';
}

function GetFileType(URLstring)
{
// Get the file name, then get the file type from the URL passed in
	var TempFileName
	TempFileName = URLstring
	var startPos
	var endPos
	startPos = TempFileName.lastIndexOf("/")
	if ( startPos>0 )
		TempFileName = TempFileName.substr(startPos, TempFileName.length-startPos)
	endPos = TempFileName.indexOf("?")
	if ( endPos>0 )
		TempFileName = TempFileName.substr(0, endPos)

// now find the "."		
	startPos = TempFileName.lastIndexOf(".")
	if ( startPos>0 )
		TempFileName = TempFileName.substr(startPos, TempFileName.length-startPos)
	else
		TempFileName = ""

	return TempFileName.toLowerCase();
}

function setcookievalue(name,value) { document.cookie=name+"="+escape(value)+";path=" }
function getcookievalue(name)
{
	var temp=document.cookie+";";
	var Pos=temp.indexOf("=",temp.indexOf(name+"="));
	if (temp.indexOf(name+"=")==-1) return "";
	return unescape(temp.substring(Pos+1,temp.indexOf(";",Pos)));
}
function delcookie(sName)
{
  document.cookie = sName + "=''" + "; expires=Fri, 31 Dec 1999 23:59:59 GMT;path=";
}
// NOTE: This must match the imarkupsubs version
function HTMLString(string)
{
	if (typeof(string) != "string")
	{
		return string;
	}
	string=string.replace(/&/g,"&amp;");
	string=ReplaceAll(string, "'", "&#39;");
	string=ReplaceAll(string, "<", "&lt;");
	string=ReplaceAll(string, ">", "&gt;");
	string=ReplaceAll(string, "\"", "&quot;");
	string=ReplaceAll(string, "\\", "&#92;");
	return string;
}
function StripString(string)
{
	if (typeof(string) != "string")
	{
		return string;
	}
	string=ReplaceAll(string, "\\", "");
	string=ReplaceAll(string, "'", "");
	string=ReplaceAll(string, "\"", "");
	string=ReplaceAll(string, "<", "");
	string=ReplaceAll(string, ">", "");
	string=ReplaceAll(string, "&", "");
	string=ReplaceAll(string, " ", "");
	string=ReplaceAll(string, ",", "");
	return string;
}

function XMLString(string)
{
	string=string.replace(/&/g,"&amp;");
	string=ReplaceAll(string, ">", "&gt;");
	string=ReplaceAll(string, "<", "&lt;");
	return string;
}
function FromXMLString(string)
{
	string=ReplaceAll(string, "&gt;", ">");
	string=ReplaceAll(string, "&lt;", "<");
	// Must be AFTER &gt; and &lt;
	string=ReplaceAll(string, "&amp;", "&");
	return string;
}
// This funtion will simply remove all XML tags from a string
function RemoveXML(string)
{
	while (string.indexOf("<")!=-1)
	{
		if (string.indexOf(">")==-1)		// Just a "safety" catch for no trailing >
		{
			return string;
		}
		string=string.slice(0,string.indexOf("<")) + string.slice(string.indexOf(">",string.indexOf("<"))+1);
	}
	// If the string has a non-white space character, then return it
	for (var i=0;i<string.length;i++)
	{
		if (string.substr(i,1)!=" " && string.substr(i,1)!="\n" && string.substr(i,1)!="\r" && string.substr(i,1)!="\t")
		{
			return string;
		}
	}
	
	return "";			// No actual string
}

function iMin(v1,v2)
{ return v1 < v2 ? v1 : v2; }
function iMax(v1,v2)
{ return v1 > v2 ? v1 : v2; }

// This function will pop-up a message window if someone sends me a message
function IMessage(uid, sender)
{
	if (uid==0)
		return;

	gid=0;		// We are just ignoring the group at this point

	winLeft = (screen.width>1200) ? 150 : 50
	winWidth = (screen.width>801) ? 500 : 400
	
	winTop = (screen.height>1000) ? 150 : 50
	winHeight = (screen.height>601) ? 430 : 400
	
	winOptions = "top="+winTop+",left="+winLeft+",width="+winWidth+",height="+winHeight+",status=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no"

	// Add optional eform popup parm
	

	// The name of the window is some unique value so that if 2 people call the
	// IMessage function for the same message, it will NOT create a new window -
	// it will merely give the first one focus
	wndObject = window.open("", "IMz"+gid+"z"+uid, winOptions)
	
	if (wndObject)
	{
		if (wndObject.location=="about:blank")
		{
			var URL;
			URL="im_user.asp?uid="+uid;
			if (sender)
			{
				URL=URL+"&sender=1";
			}
			wndObject.location.href = URL;
		}
		wndObject.focus();
	}
	else
	{
		alert("Please disable popup blockers for the iMarkup Server");
	}
}

function iGetScrollPosition(windowOrFrame)
{ 
	if (IsIE()) 
		return (windowOrFrame.document.body.scrollTop);  // Internet Explorer 
	else 
		return (windowOrFrame.pageYOffset);              // Netscape 
} 
function iSetScrollPosition(windowOrFrame,pOffset)
{ 
// scrollTo works for all browsers
//	windowOrFrame.document.body.scrollTop=pOffset;  // Internet Explorer 
	windowOrFrame.scrollTo(0,pOffset);
} 
function SetNoWorkgroup()
{
	if (iMarkupClientVersion() >= 250)
	{
		ClientiMarkupObject.SetWorkgroup('',0,'',0);
	}
}

// This function is used to create a popup window based on the inputed window handle
function iPopupWin(p_win,left,top,height,width,URL,ShowURL)
{
	winOptions = "top="+top+",left="+left+",status=no,scrollbars=yes,resizable=yes,location=no"
	if (ShowURL==1)
		winOptions=winOptions+",location=yes"
	else
		winOptions=winOptions+",location=no"
	if (height!=0 && width!=0)
	{
		winOptions = winOptions + ",width="+width+",height="+height;
	}

	// Add optional eform popup parm
	
		hWin = p_win.open(
			URL,
			"_blank", 
			winOptions);
		if (hWin)
		{
			hWin.focus();
		}
		else
		{
			alert("Please disable popup blockers for the iMarkup Server");
		}
	
}
function iPopup(left,top,height,width,URL,ShowURL)
{
	iPopupWin(window,left,top,height,width,URL,ShowURL);
}

function ShowHelp(pTopic)
{
	return "<a class='iHotLink' href='#' onclick='OpenHelp(&#39;" + pTopic + "&#39;);return false;'><img  onMouseover='iShowTip(&#39;Click for Help&#39;, 170)' onMouseout='iHideTip()'  align='middle' class='ButtonImage' src='images/ques_small.gif' WIDTH='16' HEIGHT='16'></A>";
}

function OpenHelp(pTopic)
{
	winLeft = (screen.width>1200) ? 500 : 200
	winWidth = 400
	winTop = (screen.height>1000) ? 300 : 200
	winHeight = 150
	iPopup(winLeft, winTop, winHeight, winWidth, "phelp.asp?topic=" + pTopic, 0);
}
// Common form viewing function
function OpenForm(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload)
{
	return OpenFormEx(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload,0,0,0,0)
}
function OpenForm2(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload,pKV_WFID)
{
	return OpenFormEx2(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload,0,0,0,0,pKV_WFID)
}
function OpenFormEx(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload,pCon_WFID,pCon_FORMID,pNotifyOnly,pCTConfigMode)
{
	return OpenFormEx2(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload,pCon_WFID,pCon_FORMID,pNotifyOnly,pCTConfigMode,"");
}
function OpenFormEx2(pFORMID,pFORMINSTID,pTESTMODE,pWFID,pSUID,pWFDirect,pDownload,pCon_WFID,pCon_FORMID,pNotifyOnly,pCTConfigMode,pKV_WFID)
{
	
		winLeft = (screen.width>1200) ? 150 : 50
		winWidth = (screen.width>1200) ? screen.width - 150 - winLeft : screen.width - 100 - winLeft
		winTop = (screen.height>1000) ? 150 : 50
		winHeight = (screen.height>1000) ? (screen.height - 250 - winTop) : (screen.height - 200 - winTop)
	
	
	winOptions = "top="+winTop+",left="+winLeft+",width="+winWidth+",height="+winHeight+",status=no,scrollbars=yes,resizable=yes"
	// IE 7 supports a better fullscreen option (only when gFormMaximized=1 or gFormMaximized=true)
	

	// Add optional eform popup parm
	

	var DebugFlag = "";
	
		hWin = window.open("form.asp?formid=" + pFORMID + "&forminstid=" + pFORMINSTID + "&testmode=" + pTESTMODE + "&download=" + pDownload + "&wfid=" +pWFID + "&suid=" +pSUID + "&wfdirect=" + pWFDirect + "&con_wfid=" + pCon_WFID + "&con_formid=" + pCon_FORMID + "&notifyonly=" + pNotifyOnly + "&ctconfigmode=" + pCTConfigMode + "&kv_wfid=" + pKV_WFID + DebugFlag, "_blank", winOptions);
		if (hWin)
		{
			hWin.focus();
			return true;
		}
		else
		{
			alert("Please disable popup blockers for the iMarkup Server");
			return false;
		}
	
}
/*
Because of bugs in new Acrobat's, we must use this function to popup Acrobat
windows with NO options on the window.open (otherwise Acrobat opens the actual PDF 
in the wrong window)
*/
function OpenAcrobat(pGID,pDID,pVer,pWFID)
{
	// We no longer need the DoPDFFirst logic in Acro 6 and 7 - REMOVED
	// NOTE: We now add the showpdf to tell the iMarkup plugin NOT to use show_pdf.asp page
	var hWin;
	hWin = window.open("review.asp?gid=" + pGID + "&did=" + pDID + "&ver=" + pVer + "&wfid=" + pWFID + "&showpdf=show_pdf.asp", "_blank", "");
	if (hWin)
		hWin.focus();
	return hWin;
}
// Open acrobat for a specific URL
function OpenAcrobatURL(pGID,pRSID,pWFID)
{
	// We no longer need the DoPDFFirst logic in Acro 6 and 7 - REMOVED
	// NOTE: We now add the showpdf to tell the iMarkup plugin NOT to use show_pdf.asp page
	var hWin;
	hWin = window.open("review.asp?gid=" + pGID + "&rsid=" + pRSID + "&wfid=" + pWFID + "&showpdf=show_pdf.asp", "_blank", "");
	if (hWin)
		hWin.focus();
	return hWin;
}
/*
Normalize getting CSS style objects for each browser.
*/
function iGetCSSStyle(pClassName)
{
	// We use a try-catch because of potential security exceptions like
	// if they configure a remote .css file instead of a local one
	try
	{
		for (var s=document.styleSheets.length-1;s>=0;s--)
		{ 
			if("cssRules" in document.styleSheets[0]) // DOM 2 CSS compliant browsers 
			{
				for (var r=0;r<document.styleSheets[s].cssRules.length;r++)
				{ 
					if (document.styleSheets[s].cssRules[r].selectorText)
					{
						if (document.styleSheets[s].cssRules[r].selectorText.toUpperCase() == pClassName.toUpperCase())
							return document.styleSheets[s].cssRules[r].style; 
					}
				} 
			}
			else if("rules" in document.styleSheets[0]) // MSIE 5+ 
			{
				for (var r=0;r<document.styleSheets[s].rules.length;r++)
				{ 
					if (document.styleSheets[s].rules[r].selectorText)
					{
						if (document.styleSheets[s].rules[r].selectorText.toUpperCase() == pClassName.toUpperCase())
							return document.styleSheets[s].rules[r].style; 
					}
				} 
			}
		}
	}
	catch(e)
	{
		return null;
	}
} 
/*
Normalize the HTML insertion for multiple browsers
*/
function iInsertHTML(pWhereObject,pHTML)
{
	if (pWhereObject)
	{
		// IE browsers can use insertAdjacentHTML
		if (pWhereObject.insertAdjacentHTML)
		{
			pWhereObject.insertAdjacentHTML('beforeEnd',pHTML);
		}
		// Netscape and Mozilla
		else
		{
			var r = pWhereObject.ownerDocument.createRange();
			r.setStartBefore(pWhereObject);
			var parsedHTML = r.createContextualFragment(pHTML);
			pWhereObject.appendChild(parsedHTML);
		}
	}
	else
	{
		alert("Could not insert HTML for object");
	}
}
/*
Normalize the HTML object removal for multiple browsers
*/
function iRemoveNode(pNode)
{
	if (typeof(pNode) == "object")
	{
		var parent = pNode.parentNode;
		if (typeof(parent) == "object")
			parent.removeChild(pNode);
	}
}

function iGetObjPosition(pObj)
{
	var point = new iPoint();
	point.x = 0;
	point.y = 0;
	var Obj = iGetObject(pObj);
	while (Obj)
	{
		point.x += Obj.offsetLeft;
		point.y += Obj.offsetTop;
		Obj = Obj.offsetParent
	}
	return point;
}

function iGetObjSize(pObj)
{
	var point = new iPoint();
	point.x = 0;
	point.y = 0;
	var Obj = iGetObject(pObj);
	if (Obj)
	{
		point.x += Obj.offsetWidth;
		point.y += Obj.offsetHeight;
	}
	return point;
}

function iGetWindowSize()
{
	if (window.innerWidth)
	{
		return new iPoint(window.innerWidth,window.innerHeight)
	}
	else if (document.documentElement && document.documentElement.clientWidth!=0)
	{
		return new iPoint(document.documentElement.clientWidth,document.documentElement.clientHeight)
	}
	else
	{
		return new iPoint(document.body.clientWidth,document.body.clientHeight)
	}
}

// Functions to help when dealing w/ points
function iPoint(x, y)
{ this.x = x; this.y = y; }
iPoint.prototype.min = function(that)
{ return new iPoint( Math.min( this.x, that.x ), Math.min( this.y, that.y ) ); }
iPoint.prototype.max = function(that)
{ return new iPoint( Math.max( this.x, that.x ), Math.max( this.y, that.y ) ); }
iPoint.prototype.toString = function()
{ return this.x + "," + this.y; }
iPoint.prototype.distanceFrom = function(that)
{
    var dx = this.x - that.x;
    var dy = this.y - that.y;
    return Math.sqrt(dx*dx + dy*dy);
}
iPoint.prototype.lerp = function(that, t)
{
	return new iPoint(this.x + (that.x - this.x) * t, this.y + (that.y - this.y) * t);
}

/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
var TotalResizes=0;
var tip_offsetfromcursorX=12 //Customize x offset of tooltip
var tip_offsetfromcursorY=10 //Customize y offset of tooltip
var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
document.write('<div id="tip_tooltip"></div>') //write out tooltip DIV
document.write('<img id="tip_pointer" style="position:absolute;left:-300px;z-index:9001;visibility:hidden;" src="images/tip.gif">') //write out pointer image
var tip_ie=document.all
var tip_ns6=document.getElementById && !document.all
var tip_enabletip=false
if (tip_ie||tip_ns6)
var tip_obj=document.all? document.all["tip_tooltip"] : document.getElementById? document.getElementById("tip_tooltip") : ""
var tip_pointerobj=document.all? document.all["tip_pointer"] : document.getElementById? document.getElementById("tip_pointer") : ""
function ietruebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body }
var ForceTop=false;
function iShowTipTop(thetext, thewidth, thecolor)
{ ForceTop=true; iShowTip(thetext, thewidth, thecolor); }
function iShowTip(thetext, thewidth, thecolor)
{
	
// Only do tip if it was successfully created
	if (!tip_obj) return;
  // This is a hack because the tooltips causes the refresh button to "wiggle" when
  // the content list is resized
	if (TotalResizes>2) return false;
	if (thetext==""){return;} if (tip_ns6||tip_ie) {
		if (typeof thewidth!="undefined") tip_obj.style.width=thewidth+"px"
		if (typeof thecolor!="undefined" && thecolor!="") tip_obj.style.backgroundColor=thecolor;
		tip_obj.innerHTML=thetext
		tip_enabletip=true
		return false } }
function positiontip(e){
if (tip_enabletip){
var tip_nondefaultpos=false
var tip_curX=(tip_ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var tip_curY=(tip_ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var tip_winwidth=tip_ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var tip_winheight=tip_ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
var tip_rightedge=tip_ie&&!window.opera? tip_winwidth-event.clientX-tip_offsetfromcursorX : tip_winwidth-e.clientX-tip_offsetfromcursorX
var tip_bottomedge=tip_ie&&!window.opera? tip_winheight-event.clientY-tip_offsetfromcursorY : tip_winheight-e.clientY-tip_offsetfromcursorY
var tip_leftedge=(tip_offsetfromcursorX<0)? tip_offsetfromcursorX*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (tip_rightedge<tip_obj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
//tip_obj.style.left=tip_curX-(tip_obj.offsetWidth/2)+"px"
// actually, we now just place the tip at the far right edge of the screen
tip_obj.style.left=(tip_winwidth-tip_obj.offsetWidth)+"px"
tip_nondefaultpos=true
}
else if (tip_curX<tip_leftedge)
tip_obj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tip_obj.style.left=tip_curX+tip_offsetfromcursorX-offsetdivfrompointerX+"px"
tip_pointerobj.style.left=tip_curX+tip_offsetfromcursorX+"px"
}
//same concept with the vertical position
//note we now position the tip below the cursor if it would have a negative top
if ( (tip_bottomedge<tip_obj.offsetHeight && tip_curY-tip_obj.offsetHeight-tip_offsetfromcursorY>0) || ForceTop){
tip_obj.style.top=tip_curY-tip_obj.offsetHeight-tip_offsetfromcursorY+"px"
tip_nondefaultpos=true
}
else{
tip_obj.style.top=tip_curY+tip_offsetfromcursorY+offsetdivfrompointerY+"px"
tip_pointerobj.style.top=tip_curY+tip_offsetfromcursorY+"px"
}
tip_obj.style.visibility="visible"
if (!tip_nondefaultpos)
tip_pointerobj.style.visibility="visible"
else
tip_pointerobj.style.visibility="hidden"
}
}
function iHideTip(){
ForceTop=false;
// Only do tip if it was successfully created
if (!tip_obj) return;
if (tip_ns6||tip_ie){
tip_enabletip=false
tip_obj.style.visibility="hidden"
tip_pointerobj.style.visibility="hidden"
tip_obj.style.left="-1000px"
tip_obj.style.backgroundColor=''
tip_obj.style.width=''
}
}
document.onmousemove=positiontip
/***********************************************/

// XML client requests
var iXMLObject=null;
var iXMLCallback=null;

function iXMLStateChange()
{
	// The only state we are interested in is "loaded"
	if (iXMLObject.readyState == 4)
	{
		// only if "OK"
		if (iXMLObject.status == 200)
		{
			iXMLCallback();
		}
// This error is hit commonly when requests are cancelled
//		else
//		{
//			alert("There was a problem retrieving the XML data: " + iXMLObject.statusText);
//		}
	}
}

function iSendXML(pURL)
{
	if (iXMLCallback == null)
		// Syncronous - blocking
		iXMLObject.open("GET", pURL, false);
	else
		// Async - non blocking with callback
		iXMLObject.open("GET", pURL, true);
	iXMLObject.send(null);
	
	// If the request is SYNCRONOUS, then check the status here
	if (iXMLCallback == null)
	{
		if (iXMLObject.status == 200)
		{
			return true;
		}
		else
		{
			alert("There was a problem retrieving the XML data: " + iXMLObject.statusText);
			return false;
		}
	}
	return true;
}

function iGetXML(pCallback)
{
	iXMLCallback = pCallback;
	// Return the existing object if there is one
	if (iXMLObject!=null)
	{
		// First cancel any current request
		iXMLObject.abort();
		if (pCallback)
			iXMLObject.onreadystatechange = iXMLStateChange;
		return true;
	}
	
	// See if browser natively supports XMLHttpRequest (Firefox, netscape, apple)
	if (window.XMLHttpRequest)
	{
		iXMLObject = new XMLHttpRequest();
		if (!iXMLObject)
		{
			alert("Could not create XML object: XMLHttpRequest");
			return false;
		}
		if (pCallback)
			iXMLObject.onreadystatechange = iXMLStateChange;
		return true;
		
	}
	// branch for IE/Windows ActiveX version
	else if (window.ActiveXObject)
	{
		try
		{
			iXMLObject = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			alert("You must enable 'Run ActiveX controls and plug-ins' and 'Script ActiveX controls marked safe for scripting' in the Internet Options->Security->Custom Level settings")
			return false;
		}
		if (!iXMLObject)
		{
			alert("Could not create XML object: Microsoft.XMLHTTP");
			return false;
		}
		if (pCallback)
			iXMLObject.onreadystatechange = iXMLStateChange;
		return true;
	}
}
function iXMLGetRecord(pObj,pName)
{
	var temprec;
	temprec = pObj.getElementsByTagName(pName);
	if (temprec==null)
		return null;
	if (temprec.length!=1)
		return null;
	return temprec[0].childNodes[0];
}
function iXMLGetRecords(pObj,pName)
{
	var temprec;
	temprec = pObj.getElementsByTagName(pName);
	if (temprec==null)
		return null;
	return temprec;
}
function iXMLGetValue(pObj,pName)
{
	var temprec;
	temprec = pObj.getElementsByTagName(pName);
	if (temprec==null)
		return "";
	if (temprec.length!=1)
		return "";
	return temprec[0].childNodes[0].nodeValue;
}
// Location structure for nav tree
function iLocation(pNavType,pID,pType,pContext,pParent)
{
	this.navtype = pNavType;
	this.id = pID;
	this.type = pType;
	this.context = pContext;
	this.parent = pParent;
	this.children = new Array();
	this.processed = false;
	this.add_dynamically = false;
	this.is_expanded = false;
	this.show_plus = 0;
	this.loctop = 0;
	this.text = "";
	this.icon = "";
}

function SetDocAnnotations(pGID,pDID,pVer,pVerString,pDocName,pWFID,pSTID,pSUID,pReadOnly)
{
	
		if ( iMarkupClientVersion() >= 253)
		{
			// Set the read-only flag if appropriate
			if ( iMarkupClientVersion() >= 263 )
			{
				// ' Set the markup Readonly mode for the WF
				if (pReadOnly)
					ClientiMarkupObject.ReadOnlyMode=1
				else
					ClientiMarkupObject.ReadOnlyMode=0
			}

			ClientiMarkupObject.docGID=pGID
			ClientiMarkupObject.docDID=pDID
			ClientiMarkupObject.docVersion=pVer
			if ( iMarkupClientVersion() >= 263 )
			{
				ClientiMarkupObject.docVersionStr=pVerString;
			}
			ClientiMarkupObject.docName=pDocName;

			if ( iMarkupClientVersion() >= 330 )
			{
				ClientiMarkupObject.userWFID=pWFID;
				ClientiMarkupObject.userSTID=pSTID;
				ClientiMarkupObject.userSUID=pSUID;
			}
			// Note that if the WFID/STID/SUID are not set, the client will not send up
			// a GetUsers request
			ClientiMarkupObject.SetDocument();
		}
		else
		{
			alert("You do not have the iMarkup Plug-in installed.");
			return false;
		}
	
	return true;
}

function SetRSAnnotations(pGID,pRSID,pRSName,pWFID,pSTID,pSUID,pReadOnly)
{
	if ( iMarkupClientVersion() >= 250 )
	{
		// Set the read-only flag if appropriate
		if ( iMarkupClientVersion() >= 263 )
		{
			if (pReadOnly)
				ClientiMarkupObject.ReadOnlyMode=1;
			else
				ClientiMarkupObject.ReadOnlyMode=0;
		}
			
		if ( iMarkupClientVersion() >= 330 )
		{
			ClientiMarkupObject.userWFID=0;
			ClientiMarkupObject.userSTID=0;
			ClientiMarkupObject.userSUID=0;
		}
		ClientiMarkupObject.SetWorkgroup("",pGID,pRSName,pRSID);

	}
}

function ClosePopupRefresh()
{
	

	// We use top so that if we are called from a framed window (doc_comment_bar.asp), we still work
	if (top && top.window && top.window.opener)
	{
		try		// opener.location could throw an error
		{
			// If there is an OnGo methodon parent, call that to refresh parent form.
			// This is seen when completing a form task from a kview with a prompt.
			if (top.window.opener.OnGo)
			{
				top.window.opener.OnGo()
			}
			else
			{
				// Reset the href RATHER than .reload() to avoid the Cancel Retry 
				// IE message when "refreshing" a page with a form. 
//				top.window.opener.location.reload();
				top.window.opener.location.href = top.window.opener.location.href;
			}
		}
		catch(e)
		{
		}
		top.close();
	}
	else
	{
		
		// Just navigate to the home page on an error
		try
		{
			if (top && top.window)
			{
				top.window.location.href = "home.asp?gid=0";
			}
			else
			{
				window.location.href = "home.asp?gid=0";
			}
		}
		// Permissions may not let me look at top.window
		catch (e)
		{
			window.location.href = "home.asp?gid=0";
		}
	}
}
var iNavTimerID=0;
var iNavTimerReplace;
var iNavTimerURL;
var iNavTimerWnd;
var iNavTimerCount;
// This function assists the iNavigate in case it needs to wait for the nav frame to finish loading
// It will attempt a few times to "find" the iNavTimerWnd.NavNavigate function.
function iNavTimer()
{
	window.clearInterval(iNavTimerID);
	iNavTimerID=0;
	iNavTimerCount++;
	if (iNavTimerWnd.NavNavigate)
	{
		iNavTimerWnd.NavNavigate(iNavTimerReplace,iNavTimerURL);
	}
	else
	{
		if (iNavTimerCount<=5)
		{
			iNavTimerID = window.setInterval("iNavTimer()", 700);
		}
		// If we have tried too many times, then just navigate to the home page
		else
		{
			
			window.location.href = "home.asp?gid=0";
		}
	}
}
function iNavigate(pReplace,pURL)
{
	
		if (iNavTimerID)
		{
			window.clearInterval(iNavTimerID);
			iNavTimerID=0;
		}
		var NavWnd = GetiMarkupNavWindow();
		if (NavWnd)
		{
			// It is possible we are called before the nav frame has loaded (in which case NavNavigate
			// wont be available yet)
			if (NavWnd.NavNavigate)
			{
				NavWnd.NavNavigate(pReplace,pURL);
			}
			else
			{
				// Let's give the frame a few seconds to fully load so we can complete the navigate
				iNavTimerReplace=pReplace;
				iNavTimerURL=pURL;
				iNavTimerWnd=NavWnd;
				iNavTimerCount=0;
				iNavTimerID = window.setInterval("iNavTimer()", 700);
			}
		}
		else
		{
			
			try
			{
				if (top && top.window)
				{
					// Just navigate to the home page on an error
					top.window.location.href = "home.asp?gid=0";
				}
				else
				{
					window.location.href = "home.asp?gid=0";
				}
			}
			// Permissions may not let me look at top.window
			catch (e)
			{
				window.location.href = "home.asp?gid=0";
			}
		}
	
}
// Deletes a thing in the left side nav tree (if it exists)
function iDeleteNavObj(pID,pType)
{
	var NavWnd = GetiMarkupNavWindow();
	if (NavWnd && NavWnd.iDeleteNavObj)
	{
		NavWnd.iDeleteNavObj(pID,pType);
	}
	else
	{
		// This is hit sometimes on first load when nav page is not loaded yet
	}
}
// Contracts a thing in the left side nav tree (if it exists)
function iContractNavObj(pID,pType)
{
	var NavWnd = GetiMarkupNavWindow();
	if (NavWnd && NavWnd.iContractNavObj)
	{
		NavWnd.iContractNavObj(pID,pType);
	}
	else
	{
		// This is hit sometimes on first load when nav page is not loaded yet
	}
}


var tFocusObj=null;
function iSetFocusLoaded()
{
	if (tFocusObj && iGetObject(tFocusObj))
	{
		iGetObject(tFocusObj).focus();
	}
	else
	{
		if (tFocusObj)
		{
			alert("Could not set focus to " + tFocusObj);
		}
	}
}

// Call this to set focus to a field after page is loaded
function iSetFocus(pObject)
{
	// ensure no existing onload
	if (window.onload != null)
	{
		alert("iSetFocus: Multiple onload statements")
	}
	tFocusObj = pObject;
	window.onload = iSetFocusLoaded;
}

// NOTE: This is copied in imarkupsubs.asp as asp code
function iIconPath(pType,pNumber)
{
	if (pNumber>0)
		return "images/icons/" + pNumber + ".gif"
	else if (pNumber<0)
		return "custom/icons/" + Math.abs(pNumber) + ".gif"
	else
	{
		if (pType=="k")
			return "images/kv_small.gif"
		else if (pType=="e")
			return "images/form_small.gif"
		else if (pType=="w")
			return "images/workflow_small.gif"
		else if (pType=="wct")
			return "wf/portal_action.gif"
	}
}
function IconChoose(pType,pCurr,pReturnIMG,pReturnVal)
{
	winLeft = (screen.width>1200) ? 100 : 50
	winWidth = (screen.width - 100 - winLeft>700) ? 700 : screen.width - 100 - winLeft
	
	winTop = (screen.height>1000) ? 100 : 50
	winHeight = (screen.height>1000) ? (screen.height - 300 - winTop) : (screen.height - 100 - winTop)

	iPopup(winLeft, winTop, winHeight, winWidth, 
		"icon_choose.asp?gid=" + 0 + "&type=" + pType + "&curr=" + pCurr + "&returnstr=" + pReturnIMG  + "&returnval=" + pReturnVal, 
		0);
}

// Just a hack to kill the enter key on a form (to prevent the auto-submit)
function KillEnter()
{
	if (event.keyCode == 13)
		event.returnValue=false;
}

function iLong(pObj)
{
	var Temp;
	Temp = parseInt(pObj);
	if (isNaN(Temp))
		Temp = 0;
	return Temp;
}

function iGetDocOffset(pObject)
{
	var curr=0;
	while( pObject.tagName.toUpperCase() != "BODY" )
	{
		curr += pObject.offsetTop;
		pObject = pObject.offsetParent;
	}
	return curr;
}

function iFireChange(pObject, pDocument)
{
	// On IE, the onchange event (for imarkup event form fields) does not seem to be
	// called when the value changes via javascript. So fire that event with code!
	if (pObject.fireEvent)
	{
		// Only fire the event if the onchange handler is being caught
		if (pObject.onchange)
		{
			pObject.fireEvent("onchange");
		}
	}
	// Other browsers use a different JavaScript method
	else
	{
		var evt = pDocument.createEvent("HTMLEvents");
		if (evt && evt.initEvent && pObject.dispatchEvent)
		{
			evt.initEvent("change",true,true);
			pObject.dispatchEvent( evt );
		}
	}
}


