<!--
function changeRowClass(row, cssClass)
{
	row.className = cssClass;
}
	
function showLayer(layer)
{
	document.getElementById(layer).style.display = '';
	document.getElementById(layer).style.visibility = 'visible';
}

function hideLayer(layer)
{
	document.getElementById(layer).style.display = 'none';
	document.getElementById(layer).style.visibility = 'hidden';
}

function closeAllPopupLayers()
{
	var elements = document.getElementsByTagName('div');
	for (var i = 0; i < elements.length; i++)
	{
		if (elements[i].id.substring(0,8) == "obj_msg_")
		{
			hideLayer(elements[i].id);
		}
	}
}

function getPosition(id)
{
	var curleft = curtop = 0;
	var obj = document.getElementById(id);
	if (obj.offsetParent)
	{
		do 
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	else if (obj.x)
	{
		curleft = obj.x;
		curtop = obj.y;
	}
	var result = new Array(curleft, curtop);
	return result;
}

function showTutorial(URL)
{
	window.open("index.cfm?fuseaction=help.tutorial&tutorial="+URL,'video_tutorial','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=498');
}
		
function checkAll(bigCheck,formname,fieldname)
{
	var field = eval("document." + formname + "." + fieldname);
	for(var i = 0; i < field.length; i++) 
	{
		field[i].checked = bigCheck;
	}
}

function setSortBy(strOrder,strSort,strFormName) 
{
	var form = eval("document." + strFormName);
	setFormFieldVal(form,'orderBy',strOrder,false);
	setFormFieldVal(form,'sortBy',strSort,true);
}
	
function CleanWordFormat( lstIDs )
{
	var idList = lstIDs.split(',');
	for (i = 0; i < idList.length; i++)
	{
		if ( FCKeditorAPI.GetInstance(idList[i]) )
		{
			var oEditor = FCKeditorAPI.GetInstance(idList[i]) ;
			var html = oEditor.EditorWindow.document.getElementsByTagName('body')[0].innerHTML;
		
			html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
			html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
		
			// Remove mso-xxx styles.
			html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
		
			// Remove margin styles.
			html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
			html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
		
			html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
			html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
		
			//html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
		
			html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
		
			html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
		
			html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
			html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
		
			// Remove FONT face attributes.
			html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
			html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
			html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
		
			// Remove class="MsoNormal"
			html = html.replace( / class="MsoNormal"/gi, '' ) ;
			
			// Remove Class attributes
			//html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
		
			// Remove styles.
			// html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
		
			// Remove style, meta and link tags
			html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
			html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
		
			// Remove empty styles.
			html = html.replace( /\s*style="\s*"/gi, '' ) ;
		
			html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
		
			html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
		
			// Remove Lang attributes
			html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
		
			html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
		
			html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
		
			// Remove XML elements and declarations
			html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
		
			// Remove w: tags with contents.
			html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
		
			// Remove Tags with XML namespace declarations: <o:p><\/o:p>
			html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
		
			// Remove comments [SF BUG-1481861].
			html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
		
			html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
		
			html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
		
			// Remove "display:none" tags.
			html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
		
			// Remove language tags
			html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
		
			// Remove onmouseover and onmouseout events (from MS Word comments effect)
			html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
			html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
		
			// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
			html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
		
			// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
			html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
			html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
		
			oEditor.EditorWindow.document.getElementsByTagName('body')[0].innerHTML = html;
		}
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  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=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Check browser version
function checkBrowser() {

	if (document.all) {
	  document.loginForm.submit();
	}
	else if (document.layers) {
	  alert("This application requires Microsoft Internet Explorer version 5 or Netscape 6 and above.");
	}
	else if (document.getElementById) {
	  alert("You are using Netscape 6. Beware that occasional crashes and screen refresh errors might occur due to bugs in Netscape 6.");
	  document.loginForm.submit();
	}
	else {
	  alert("This application requires Microsoft Internet Explorer version 5 or Netscape 6 and above.");
	}
	
	
}

/* changeLayer */
function swapLayer(srcLayer,dstLayer) {
	alert('hello world');
}

/* Set Fuseaction */
function setFuseaction(form,fuseAction) {
	form.fuseaction.value=fuseAction;
}

/* Set Field Value*/
function setFormFieldVal(form,field,val,blSubmit) {
	eval('form.' + field + '.value=\'' + val + '\'');
	if(blSubmit) {
		form.submit();
	}
	//form.fuseaction.value=fuseAction;
}

var newWindow = null;
function makeWindow(url,width,height){
	//check if window already exists
	if ( !newWindow || newWindow.closed){
		//modify window variables
		var w = width;
		var h = height;
		var x = 100;
		var y = 150;
		if (document.all)
		{
			var xMax = screen.width, yMax = screen.height;
			x = ((xMax/2) - (w/2));
			y = ((yMax/2) - (h/2));
		}
		else if (document.layers) 
		{
			var xMax = window.outerWidth, yMax = window.outerHeight;
			x = ((xMax/2) - (w/2));
			y = ((yMax/2) - (h/2));
		}
		
		options = "screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x + ",toolbar=0,status=0,menubar=0,scrollbars=auto,resizable=0,width=" + w +",height=" + h;
	
		//store new window object in global variable
		newWindow = window.open(url,"modifyWindow",options);
		newWindow.document.close();
	} else {
			//window already exists, so bring it forward
			newWindow.document.close();
			newWindow = window.open(url,"modifyWindow",options);
			newWindow.focus();
	}
}

//move from one select box to the other
function moveVal(from,to) {
	var strText,strVal,optionName;
	for(var ctr=0; ctr < from.options.length; ctr++) {
		if(from.options[ctr].selected) {
			strText=from.options[ctr].text;
			strVal=from.options[ctr].value;
			optionName=new Option(strText, strVal);
			to.options[to.options.length]=optionName;
		}
	}
	//delete them from current one
	while(from.selectedIndex != -1) {
		from.options[from.selectedIndex] = null;
	}
}
//give a drop down object it'll select all the options
function selectall(obj) {
	for(var ctr=0; ctr < obj.length; ctr++) {
		obj.options[ctr].selected=true;
	}
}

/* link chooser */
function getLink() { 
	var theLink = unescape(showModalDialog('index.cfm?fuseaction=pagebuilder.linkchooser','', 'dialogWidth:650px; dialogHeight:530px; resizable: yes; help: no; status: no; scroll: no;'));
	//var beginIndex = theLink.indexOf('href=') + 6;
	//theLink = theLink.substr(beginIndex);
	//var endIndex = theLink.indexOf('\'');
	//alert(theLink);
	if (theLink == "undefined")
	{
		return ("");
	}
	else
	{
		return theLink;
	}
}

//-->