<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>CodeKeep Other Feed</title>
    <description>The latest and greatest Other code snippets publicly available</description>
    <link>http://www.codekeep.net/feeds.aspx</link>
    <lastBuildDate>Fri, 25 May 2012 18:55:20 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodeKeepOther" /><feedburner:info uri="codekeepother" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Disk Performance GUI Based on TypePerf</title>
      <description>Description: This little GUI script uses typeperf to measure and average Disk Drive throughput based on Start Stop Button&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/fb2b6cb6-b15e-4e8d-820d-a103089b94aa.aspx'&gt;http://www.codekeep.net/snippets/fb2b6cb6-b15e-4e8d-820d-a103089b94aa.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;;
; This AutoHot Key Script
; This script acts as an eample of using the typeperf and taskkill Windows functions to 
; obtain a csv file that is then parsed to provide average %CPU and seconds of time spanned over the performance measurement
; Press teh Start Button to activate the typeperf command to begin performance measureing
; press teh Stop button to use taskkill to stop the typeperf measureing
; The script then checks the first line of the csv file to make sure
; the file is a performance file with %CPU in the File
; The script then reads through all the rest of the lines in the csv file
; and parses teh times according to HH:MM:s.ssssss
; teh script also reads teh disk Bytes REad as a number and ignores all zero or non number entries
; 
; the script also calculates teh number of seconds that spans this performance log
;
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir, %A_ScriptDir%
SetFormat, float,6.2
Gui,1:default
Gui, Add, Button,gStart, Start
Gui, Add, Button,gStop, Stop
Gui, Add, Text, x10 y65, PhysicalDisk
Gui, Add, Edit,x10 y80 vpctPhysical readonly , Total KBytes
Gui, Add, Text, x10 y105, LogicalDisk
Gui, Add, Edit,x10 y120 vpctLogical readonly , Total KBytes
Gui, Add, Text, x10 y155, Seconds
Gui, Add, Edit, x10 y170 vtotalSeconds readonly, Seconds
Gui, Show, AutoSize


return
GuiClose:
 ExitApp

ButtonSend:
OutputDebug Button Send Activated
return

Start:
OutputDebug START SCRIPT
	strCommandLine = typeperf -y -f csv &amp;quot;\PhysicalDisk(1 E:)\Disk Read Bytes/sec&amp;quot; &amp;quot;\LogicalDisk(E:)\Disk Bytes/sec&amp;quot; -o Disklog.csv
	;strCommandLine = typeperf -y -f csv &amp;quot;\LogicalDisk(E:)\Disk Read Bytes/sec&amp;quot; -o Disklog.csv
	Run,  %comspec% /c start /min %strCommandLine% 
return


Stop:
	iSeconds := 0
	strCommandLine = taskkill /F /IM typeperf.exe
	RunWait,  %comspec% /c start /min %strCommandLine% 
	strLog = %A_ScriptDir%\Disklog.csv
	strAvgCpu := CalculateTotalDisk(strLog,iSeconds)
	OutputDebug %strAvgCpu% BYTES
	strAvgCpu := strAvgCpu/1024
	OutputDebug %strAvgCpu% KBYTES

	guiControl,, pctCpu,%strAvgCpu%
	guiControl,, totalSeconds, %iSeconds%
	OutputDebug Total Disk KByte =  %strAvgCpu% Seconds = %iSeconds%
	
return

iSeconds:= 0
CalculateTotalDisk(strCsvSourceFile, ByRef iSeconds)
{
	iReadFirstTime := 1
	IfNotExist, %strCsvSourceFile%
	{
		MsgBox, Could not Find %strCsvSourceFile%
		return -1
	}
	
	iTotalMeasurements := 0
	iPercentTotal:=0
	
	Loop, read, %strCsvSourceFile%
	{
		LineNumber = %A_Index%
		
		if(LineNumber = 1)
		{
			; check for magic label to see if this script will work or not
			OutputDebug %A_LoopReadLine%,%strFileSignature1%,%strFileSignature2%
			iOK :=0
			IfInString,A_LoopReadLine,%strFileSignature1%
			{
				iOK := iOK +1
			}

			IfInString,A_LoopReadLine,%strFileSignature2%
			{
				iOK := iOK +1
			}
			
			if iOK &amp;lt; 2
			{
				MsgBox,0,Not a Proper File,This file does not have the proper signature1
				return -1
			}
		}
		else
		{
			Loop, parse, A_LoopReadLine, CSV
			{
				if A_Index = 1
				{
					strTime = %A_LoopField%
					; Only extract seconds and minutes in teh assumption that no single test will last longer than 60 minutes
					iColon1 :=0
					iColon2 := 0

					iLen := 0
					iSubLen :=0
					StringGetPos,iColon1,strTime,:,1
					StringLen,iLen,strTime
					StringRight,strSeconds,strTime,iLen-iColon1-1
					
					StringGetPos,iColon2,strTime,:,r2
					
					iSubLen := iColon1-iColon2-1
					
					; Get Minute
					StringMid,strMinutes,strTime,iColon2+2,iSubLen
					;Get Hour
					StringMid,strHour,strTime,iColon2-1,iSubLen
					
					OutputDebug %iLen%, %iColon1%, %iColon2%, %iSubLen%
					OutputDebug %strTime%, %strHour%, %strMinutes% , %strSeconds%
					if iReadFirstTime = 1
					{
						iFirstMinute := strMinutes
						iFirstSecond := strSeconds
						iFirstHour := strHour
						
						OutputDebug FIRST %iFirstHour%  %iFirstMinute%   %iFirstSecond%
					}
					else
					{
						iLastMinute := strMinutes
						iLastSecond := strSeconds	
						iLastHour := strHour
					}
				}
				if A_Index = 2
				{
					strPercentCPU = %A_LoopField%
					StringLen,ilen,strPercentCPU
					;This test is an absolute must other iPercentTotal will be NULLED OUT
					if iLen &amp;gt; 2
					{
						iPercentCPU := strPercentCPU
						iPercentTotal := iPercentTotal + iPercentCPU
						iTotalMeasurements := iTotalMeasurements +1
					}
					else
					{
						if iTotalMeasurements &amp;lt; 2
						{
							OutputDebug RESET READ FIRST TIME
							iReadFirstTime := 1
						}
					}
					;OutputDebug strCPU=%strPercentCPU% pctCPU = %iPercentCPU% total=%iPercentTotal% Num=%iTotalMeasurements%
				}
			}
			
			OutputDebug %LineNumber% = %strTime%, %strPercentCPU%, %iPercentTotal%
		}
		
		
	}

	;PerForm Final Calculations for time, and averae %CPU Utilization
	OutputDebug FIRST %iFirstHour%  %iFirstMinute%   %iFirstSecond%
	OutputDebug LAST %iLastHour%  %iLastMinute%   %iLastSecond%
	iLastHour := iLastHour - iFirstHour
	
	;Minutes and Seconds are TRICKIER  13:50:4.237  14:10:6.431
	;this test is only 20 minutes 2.2 seconds long not over an hour
	; 60 - 50 + 10 is good
	; 12:12:4.67    12:50:45.12
	; 60 - 12 +50 = 48 + 50 is wrong should be 50 - 12
	; so rule should be if Last Hour = first hour subtract minutes
	; if lastHour &amp;gt; First Hour then 60 - First Minute + Last Minute
	iMinuteIncr :=0
	
	if iLastHour &amp;gt; 0
	{
		iMinuteIncr := 60 - iFirstMinute +iLastMinute
	}
	else
	{
		iMinuteIncr := iLastMinute - iFirstMinute
	}
	;Same Process for Seconds except we look at the minutes instead of the hours
	iMinuteDiff := iLastminute - iFirstMinute
	iSecIncr := iLastSecond - iFirstSecond
	if iMinuteDiff &amp;lt; 0
	{
		iLastSecond := 60 - iFirstSecond + iLastSecond
		iMinuteIncr := iMinuteIncr -1
	}
	else
	{
		iLastSecond := iLastSecond - iFirstSecond
	}
	;Remember the test is supposed to take less than 1 hour
	iTotalSeconds := 60*iMinuteIncr + iLastSecond

	OutputDebug %iTotalSeconds% %iLastHour% %iLastMinute% %iLastSecond% %iMinuteIncr% Total = %iTotalMeasurements%
	iSeconds := iTotalSeconds
	;iAvgCpu := iPercentTotal/iTotalMeasurements
	OutputDebug AvgCpu = %iAvgCpu% = %iPercentTotal% divi %iTotalMeasurements%
	;return iAvgCpu
	return iPercentTotal
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/sqnFe6vWhPk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/sqnFe6vWhPk/fb2b6cb6-b15e-4e8d-820d-a103089b94aa.aspx</link>
      <pubDate>Fri, 25 May 2012 18:55:20 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/fb2b6cb6-b15e-4e8d-820d-a103089b94aa.aspx</feedburner:origLink></item>
    <item>
      <title>AutoHotKey CLI CPu MEasure Tool</title>
      <description>Description: Tool to use CLI to start and Stop CPU Measurement  Script is AutoHotKey, can be compiled and further automated using AutoHotKey Scripts&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f37a16f8-1189-4918-94f4-82c8efbf23c4.aspx'&gt;http://www.codekeep.net/snippets/f37a16f8-1189-4918-94f4-82c8efbf23c4.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;; this is meant to be a command line tool not a GUI based script

;Call this to print stuff out to the Console 
DllCall(&amp;quot;AttachConsole&amp;quot;, &amp;quot;int&amp;quot;, -1)
FileAppend, CPU Measure`n, CONOUT$

;Test command line arguments

iCommandArgs = %0%
OutputDebug CMDLINE %0% %iCommandArgs% %1% %2% %3% %4%
if  iCommandArgs &amp;lt; 1
{
	PrintArgs()
	ExitApp,-1
}

SetWorkingDir, %A_ScriptDir%

iTimeToProcess := 0 ; -t argument
strResultFile = &amp;quot;&amp;quot;; -o argument
strResultTitle = &amp;quot;&amp;quot; ; Title to be used in the Output File
strInpPerfFile = &amp;quot;&amp;quot; ; -i arguments
iKill := 0		; -k argument triggers this variable to True
OutputDebug Loop through Arguments
argParam := [&amp;quot;-t&amp;quot;,&amp;quot;-o&amp;quot;,&amp;quot;-i&amp;quot;,&amp;quot;-k&amp;quot;]

;For index, value in argParam
;	MsgBox % &amp;quot;Item &amp;quot; index &amp;quot; is '&amp;quot; value &amp;quot;'&amp;quot; 

Loop %iCommandArgs%
{
	cmdline := %A_Index% &amp;quot; &amp;quot;
	OutputDebug CMD[%A_Index%] = %cmdline%
	For argIndex, value in argParam
	{
		IfinString,cmdline,%value%
		{
			
			if (argIndex = 1) ; -t argument
			{
				StringLen,iLen,cmdline
				iLen := iLen - 3
				StringRight,iTime,cmdline,iLen
				iTimeToProcess := iTime
				OutputDebug ARG 1 Process Time = %iTimeToProcess%
			}
			if (argindex = 2) ; -o argument
			{
				StringLen,iLen,cmdline
				iLen := iLen - 3
				StringRight,strResultFile,cmdline,iLen
				OutputDebug ARG 2 ResutFile = %strResultFile%
				StringGetPos,iColon,strResultFile,:,1
				
				if iColon &amp;gt; 0
				{
					StringLen,iLen,strResultFile
					StringRight,strResultTitle,strResultFile,iLen-iColon-1
					StringLeft,strTemp,strResultFile,iColon
					strResultFile = %strTemp%
					OutputDebug %iColon% %strTemp% %strResultFile% %strResultTitle%
					
				}
				MacroReplace(strResultFile)
				MacroReplace(strResultTitle)
			}
			if (argindex = 3) ; -i Argument
			{
				StringLen,iLen,cmdline
				iLen := iLen - 3
				StringRight,strInpPerfFile,cmdline,iLen
				OutputDebug ARG3 InpPerfFile = %strInpPerfFile%
				MacroReplace(strInpPerfFile)
				
			}
			if (argindex = 4) ; -k argument
			{
				iKill := 1
				OutputDebug ARG4 KILL = %cmdline%
			}
		}

	}
}
; Okay we have all the arguments, now we need to enforce the rules
; -k need -i to find data, and -o to put data somewhere
; -t:xxxx  xxxx &amp;gt; 0 need -o to put data somewhere
; -t:xxxx xxxx &amp;lt; 0 need -i to know where to put perf csv data to be retrieved by -k later

;Kill REport
if iKill = 1
{
	OutputDebug, KILL TYPEPERF %iKill%
	StringLen,iLen,strInpPerfFile
	if iLen &amp;lt; 2
	{
		PrintArgs()
		ExitApp,-1 
	}
	
	StopMeasure(strInpPerfFile, strResultTitle,strResultFile)
	
	ExitApp,1
}

;Run Time Perf and exit 
OutputDebug TimeProcess=%iTimeToProcess%
if (iTimeToProcess &amp;lt; 0)
{
	
	StringLen,iLen,strInpPerfFile
	if iLen &amp;lt; 2
	{
		PrintArgs()
		ExitApp,-1 
	}
	strCommandLine = typeperf -y -f csv &amp;quot;\Processor(_Total)\`% Processor Time&amp;quot; -o %strInpPerfFile%
	Run,  %comspec% /c start /min %strCommandLine% 
	ExitApp,0
}

; It is assumed at this point that we are starting the typeperf with a positive known time
if (iTimeToProcess &amp;gt; 0)
{
	OutputDebug, START TYPEPERF TIMED
	strInpPerfFile = %A_ScriptDir%\powerperflog.csv
	strCommandLine = typeperf -y -f csv &amp;quot;\Processor(_Total)\`% Processor Time&amp;quot; -o %strInpPerfFile%
	
	Run,  %comspec% /c start /min %strCommandLine% 
	; Convert Seconds to MiliSeconds
	iTimeToProcess := iTimeToProcess * 1000
	
	SetTimer,PerfLogComplete,%iTimeToProcess%
	; Wait for the Timer to Execute
	while(1)
	{
		Sleep,300
	}
	
}

PerfLogComplete:

	SetTimer,PerfLogComplete,Off
	StopMeasure(strInpPerfFile, strResultTitle,strResultFile)
	ExitApp,1


; Function to Kill or Stop Measurement and Append information to a File
StopMeasure(strPerfFile, strResultTitle,strResultFile)
{
	IfNotExist,%strResultFile%
		FileAppend,Title`,Average `% CPU`,Test Time (Sec) `n,%strResultFile%
	
	strCommandLine = taskkill /F /IM typeperf.exe
	RunWait,  %comspec% /c start /min %strCommandLine% 
	
	strAvgCpu := CalculateAvgPercentCPU(strPerfFile,iSeconds)
	; Now Print the REsults to the Console and optionally append tehm to a file
	
	FileAppend,Test Time (Sec)= %iSeconds%`n,CONOUT$
	FileAppend,Average `% CPU = %strAvgCpu%`n,CONOUT$
	StringLen,iLen,strResultTitle
	if iLen &amp;lt; 2
	{
		strResultTitle = &amp;quot;  &amp;quot;
	}
	StringLen,iLen,strResultFile
	if iLen &amp;gt; 2
	{
		FileAppend,%strResultTitle%`,%strAvgCpu%`,%iSeconds%`n,%strResultFile%
	}

}

;Function to Print the Arguments for this App
PrintArgs()
{
	FileAppend, CPU Measure Arguments`n, CONOUT$
	FileAppend, -t:xxxx   Number of seconds to wait before killing the timer and measureing the results`n,CONOUT$
	FileAppend,-k Kill the current timing process and write report the results as specified in the other command line arguments`n,CONOUT$
	FileAppend,-i:filepath path of the typeperf CSV file to measure for time and `%CPU `n,CONOUT$ 
	FileAppend,This argument is required for both the -t:xxxx &amp;lt; 0 and -k arguments `n,CONOUT$
	FileAppend,-o:filepath:testname optional argument that indicates where the time and `%CPU should be APPENDED as CSV`n,CONOUT$
	FileAppend, in the form testname`,recorded time in seconds`, average `%CPU'n,CONOUT$  
	FileAppend,If this argument is missing then the result are output to the screen as`n,CONOUT$
	FileAppend,Test Time (Sec) : xxxxxx'n,CONOUT$
	FileAppend,Average `% CPU :: xx.xxxx`n,CONOUT$
}

CalculateAvgPercentCPU(strCsvSourceFile, ByRef iSeconds)
{
	IfNotExist, %strCsvSourceFile%
	{
		MsgBox, Could not Find %strCsvSourceFile%
		return -1
	}
	
	iTotalMeasurements := 0
	iPercentTotal:=0
	
	Loop, read, %strCsvSourceFile%
	{
		LineNumber = %A_Index%
		
		if(LineNumber = 1)
		{
			; check for magic label to see if this script will work or not
			;OutputDebug %A_LoopReadLine%,%strFileSignature1%,%strFileSignature2%
			iOK :=0
			IfInString,A_LoopReadLine,%strFileSignature1%
			{
				iOK := iOK +1
			}

			IfInString,A_LoopReadLine,%strFileSignature2%
			{
				iOK := iOK +1
			}
			
			if iOK &amp;lt; 2
			{
				MsgBox,0,Not a Proper File,This file does not have the proper signature1
				return -1
			}
		}
		else
		{
			Loop, parse, A_LoopReadLine, CSV
			{
				if A_Index = 1
				{
					strTime = %A_LoopField%
					; Only extract seconds and minutes in teh assumption that no single test will last longer than 60 minutes
					iColon1 :=0
					iColon2 := 0

					iLen := 0
					iSubLen :=0
					StringGetPos,iColon1,strTime,:,1
					StringLen,iLen,strTime
					StringRight,strSeconds,strTime,iLen-iColon1-1
					
					StringGetPos,iColon2,strTime,:,r2
					
					iSubLen := iColon1-iColon2-1
					
					; Get Minute
					StringMid,strMinutes,strTime,iColon2+2,iSubLen
					;Get Hour
					StringMid,strHour,strTime,iColon2-1,iSubLen
					
					;OutputDebug %iLen%, %iColon1%, %iColon2%, %iSubLen%
					;OutputDebug %strTime%, %strHour%, %strMinutes% , %strSeconds%
					if LineNumber = 2
					{
						iFirstMinute := strMinutes
						iFirstSecond := strSeconds
						iFirstHour := strHour
						
						;OutputDebug FIRST %iFirstHour%  %iFirstMinute%   %iFirstSecond%
					}
					else
					{
						iLastMinute := strMinutes
						iLastSecond := strSeconds	
						iLastHour := strHour
					}
				}
				if A_Index = 2
				{
					strPercentCPU = %A_LoopField%
					StringLen,ilen,strPercentCPU
					;This test is an absolute must other iPercentTotal will be NULLED OUT
					if iLen &amp;gt; 2
					{
						iPercentCPU := strPercentCPU
						iPercentTotal := iPercentTotal + iPercentCPU
						iTotalMeasurements := iTotalMeasurements +1
					}
					;OutputDebug strCPU=%strPercentCPU% pctCPU = %iPercentCPU% total=%iPercentTotal% Num=%iTotalMeasurements%
				}
			}
			
			;OutputDebug %LineNumber% = %strTime%, %strPercentCPU%, %iPercentTotal%
		}
		
		
	}

	;PerForm Final Calculations for time, and averae %CPU Utilization
	OutputDebug FIRST %iFirstHour%  %iFirstMinute%   %iFirstSecond%
	OutputDebug LAST %iLastHour%  %iLastMinute%   %iLastSecond%
	iLastHour := iLastHour - iFirstHour
	;Minutes and Seconds are TRICKIER  13:50:4.237  14:10:6.431
	;this test is only 20 minutes 2.2 seconds long not over an hour
	; 60 - 50 + 10 is good
	; 12:12:4.67    12:50:45.12
	; 60 - 12 +50 = 48 + 50 is wrong should be 50 - 12
	; so rule should be if Last Hour = first hour subtract minutes
	; if lastHour &amp;gt; First Hour then 60 - First Minute + Last Minute
	iMinuteIncr :=0
	if iLastHour &amp;gt; 0
	{
		iMinuteIncr := 60 - iFirstMinute +iLastMinute
	}
	else
	{
		iMinuteIncr := iLastMinute - iFirstMinute
	}
	;Same Process for Seconds except we look at the minutes instead of the hours
	iMinuteDiff := iLastMinute - iFirstMinute
	iSecIncr := iLastSecond - iFirstSecond
	
	if iMinuteDiff &amp;gt; 0
	{
		iLastSecond := 60 - iFirstSecond + iLastSecond
		iMinuteIncr := iMinuteIncr -1
	}
	else
	{
		iLastSecond := iLastSecond - iFirstSecond
	}
	
	;Remember the test is supposed to take less than 1 hour
	iTotalSeconds := 60*iMinuteIncr + iLastSecond

	OutputDebug %iTotalSeconds% %iLastHour% %iLastMinute% %iLastSecond% %iMinuteIncr% Total = %iTotalMeasurements%
	iSeconds := iTotalSeconds
	iAvgCpu := iPercentTotal/iTotalMeasurements
	OutputDebug AvgCpu = %iAvgCpu% = %iPercentTotal% divi %iTotalMeasurements%
	return iAvgCpu
}

; Function to accept an input string usually a file path and replace
; all occurances of $T and or $D with the Time, and or Date
;There is assumed only 1 $T and only 1 $D
MacroReplace(ByRef strFileName)
{
	IfInString,strFileName,$T
	{
		OutputDebug Replace $T
		StringGetPos,iDolT,strFileName,$T
		StringLeft,strLeft,strFileName,iDolT
		StringLen,iLen,strFileName
		if iDolT + 2 &amp;lt; iLen
		{
			StringRight,strRight,strFileName,iLen - iDolT - 2
		}
		strTime = %A_Hour%.%A_Min%.%A_Sec%
		
		strFileName = %strLeft%%strTime%%strRight%
		OutputDebug NewString %strFileName%
	}
	
	IfInString,strFileName,$D
	{
		OutputDebug Replace $D
		strDate = %A_YYYY%-%A_MM%-%A_DD%
		StringGetPos,iDolT,strFileName,$D
		StringLeft,strLeft,strFileName,iDolT
		StringLen,iLen,strFileName
		if iDolT + 2 &amp;lt; iLen
		{
			StringRight,strRight,strFileName,iLen - iDolT - 2
		}
		
		strFileName = %strLeft%%strDate%%strRight%
		OutputDebug NewString %strFileName%
	}


}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/X1iYMmK0Lxs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/X1iYMmK0Lxs/f37a16f8-1189-4918-94f4-82c8efbf23c4.aspx</link>
      <pubDate>Fri, 25 May 2012 18:35:48 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f37a16f8-1189-4918-94f4-82c8efbf23c4.aspx</feedburner:origLink></item>
    <item>
      <title>AutoHotKey GUI CPU Measure Tool</title>
      <description>Description: Little Tool that uses TypePerf to MEasure CPU % &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f2f4480f-ea82-4667-8e85-2e6d42a64da5.aspx'&gt;http://www.codekeep.net/snippets/f2f4480f-ea82-4667-8e85-2e6d42a64da5.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;;
; This AutoHot Key Script
; This script acts as an eample of using the typeperf and taskkill Windows functions to 
; obtain a csv file that is then parsed to provide average %CPU and seconds of time spanned over the performance measurement
; Press teh Start Button to activate the typeperf command to begin performance measureing
; press teh Stop button to use taskkill to stop the typeperf measureing
; The script then checks the first line of the csv file to make sure
; the file is a performance file with %CPU in the File
; The script then reads through all the rest of the lines in the csv file
; and parses teh times according to HH:MM:s.ssssss
; teh script also reads teh %CPU as a number and ignores all zero or non number entries
; the script then provides an average % CPU utilization over teh file
; the script also calculates teh number of seconds that spans this performance log
;
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir, %A_ScriptDir%
SetFormat, float,6.2
Gui,1:default
Gui, Add, Button,gStart, Start
Gui, Add, Button,gStop, Stop
Gui, Add, Text, x10 y65, `%CPU
Gui, Add, Edit,x10 y80 vpctCPU readony , `% CPU 
Gui, Add, Text, x10 y105, Seconds
Gui, Add, Edit, x10 y120 vtotalSeconds readonly, Seconds
Gui, Show, AutoSize


return
GuiClose:
 ExitApp

ButtonSend:
OutputDebug Button Send Activated
return

Start:
OutputDebug START SCRIPT
	strCommandLine = typeperf -y -f csv &amp;quot;\Processor(_Total)\`% Processor Time&amp;quot; -o powerperflog.csv
	Run,  %comspec% /c start /min %strCommandLine% 
return


Stop:
	iSeconds := 0
	strCommandLine = taskkill /F /IM typeperf.exe
	RunWait,  %comspec% /c start /min %strCommandLine% 
	strLog = %A_ScriptDir%\powerperflog.csv
	strAvgCpu := CalculateAvgPercentCPU(strLog,iSeconds)

	guiControl,, pctCpu,%strAvgCpu%
	guiControl,, totalSeconds, %iSeconds%
	OutputDebug Average Cpu utilization =  %strAvgCpu% Seconds = %iSeconds%
	
return

iSeconds:= 0
CalculateAvgPercentCPU(strCsvSourceFile, ByRef iSeconds)
{
	IfNotExist, %strCsvSourceFile%
	{
		MsgBox, Could not Find %strCsvSourceFile%
		return -1
	}
	
	iTotalMeasurements := 0
	iPercentTotal:=0
	
	Loop, read, %strCsvSourceFile%
	{
		LineNumber = %A_Index%
		
		if(LineNumber = 1)
		{
			; check for magic label to see if this script will work or not
			OutputDebug %A_LoopReadLine%,%strFileSignature1%,%strFileSignature2%
			iOK :=0
			IfInString,A_LoopReadLine,%strFileSignature1%
			{
				iOK := iOK +1
			}

			IfInString,A_LoopReadLine,%strFileSignature2%
			{
				iOK := iOK +1
			}
			
			if iOK &amp;lt; 2
			{
				MsgBox,0,Not a Proper File,This file does not have the proper signature1
				return -1
			}
		}
		else
		{
			Loop, parse, A_LoopReadLine, CSV
			{
				if A_Index = 1
				{
					strTime = %A_LoopField%
					; Only extract seconds and minutes in teh assumption that no single test will last longer than 60 minutes
					iColon1 :=0
					iColon2 := 0

					iLen := 0
					iSubLen :=0
					StringGetPos,iColon1,strTime,:,1
					StringLen,iLen,strTime
					StringRight,strSeconds,strTime,iLen-iColon1-1
					
					StringGetPos,iColon2,strTime,:,r2
					
					iSubLen := iColon1-iColon2-1
					
					; Get Minute
					StringMid,strMinutes,strTime,iColon2+2,iSubLen
					;Get Hour
					StringMid,strHour,strTime,iColon2-1,iSubLen
					
					OutputDebug %iLen%, %iColon1%, %iColon2%, %iSubLen%
					OutputDebug %strTime%, %strHour%, %strMinutes% , %strSeconds%
					if LineNumber = 2
					{
						iFirstMinute := strMinutes
						iFirstSecond := strSeconds
						iFirstHour := strHour
						
						OutputDebug FIRST %iFirstHour%  %iFirstMinute%   %iFirstSecond%
					}
					else
					{
						iLastMinute := strMinutes
						iLastSecond := strSeconds	
						iLastHour := strHour
					}
				}
				if A_Index = 2
				{
					strPercentCPU = %A_LoopField%
					StringLen,ilen,strPercentCPU
					;This test is an absolute must other iPercentTotal will be NULLED OUT
					if iLen &amp;gt; 2
					{
						iPercentCPU := strPercentCPU
						iPercentTotal := iPercentTotal + iPercentCPU
						iTotalMeasurements := iTotalMeasurements +1
					}
					;OutputDebug strCPU=%strPercentCPU% pctCPU = %iPercentCPU% total=%iPercentTotal% Num=%iTotalMeasurements%
				}
			}
			
			OutputDebug %LineNumber% = %strTime%, %strPercentCPU%, %iPercentTotal%
		}
		
		
	}

	;PerForm Final Calculations for time, and averae %CPU Utilization
	OutputDebug FIRST %iFirstHour%  %iFirstMinute%   %iFirstSecond%
	OutputDebug LAST %iLastHour%  %iLastMinute%   %iLastSecond%
	iLastHour := iLastHour - iFirstHour
	
	;Minutes and Seconds are TRICKIER  13:50:4.237  14:10:6.431
	;this test is only 20 minutes 2.2 seconds long not over an hour
	; 60 - 50 + 10 is good
	; 12:12:4.67    12:50:45.12
	; 60 - 12 +50 = 48 + 50 is wrong should be 50 - 12
	; so rule should be if Last Hour = first hour subtract minutes
	; if lastHour &amp;gt; First Hour then 60 - First Minute + Last Minute
	iMinuteIncr :=0
	
	if iLastHour &amp;gt; 0
	{
		iMinuteIncr := 60 - iFirstMinute +iLastMinute
	}
	else
	{
		iMinuteIncr := iLastMinute - iFirstMinute
	}
	;Same Process for Seconds except we look at the minutes instead of the hours
	iMinuteDiff := iLastminute - iFirstMinute
	iSecIncr := iLastSecond - iFirstSecond
	if iMinuteDiff &amp;lt; 0
	{
		iLastSecond := 60 - iFirstSecond + iLastSecond
		iMinuteIncr := iMinuteIncr -1
	}
	else
	{
		iLastSecond := iLastSecond - iFirstSecond
	}
	;Remember the test is supposed to take less than 1 hour
	iTotalSeconds := 60*iMinuteIncr + iLastSecond

	OutputDebug %iTotalSeconds% %iLastHour% %iLastMinute% %iLastSecond% %iMinuteIncr% Total = %iTotalMeasurements%
	iSeconds := iTotalSeconds
	iAvgCpu := iPercentTotal/iTotalMeasurements
	OutputDebug AvgCpu = %iAvgCpu% = %iPercentTotal% divi %iTotalMeasurements%
	return iAvgCpu
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/VxcYl5mES9Y" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/VxcYl5mES9Y/f2f4480f-ea82-4667-8e85-2e6d42a64da5.aspx</link>
      <pubDate>Fri, 25 May 2012 18:28:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f2f4480f-ea82-4667-8e85-2e6d42a64da5.aspx</feedburner:origLink></item>
    <item>
      <title>Wait in Batch File</title>
      <description>Description: HOw to wait a certain amount of time inside a batch file&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7c665b6e-b006-42c0-9e04-f93b283adc7f.aspx'&gt;http://www.codekeep.net/snippets/7c665b6e-b006-42c0-9e04-f93b283adc7f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;start /wait /min /w mshta vbscript:setTimeout(&amp;quot;window.close()&amp;quot;,1000)&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/p89QS8GjRTE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/p89QS8GjRTE/7c665b6e-b006-42c0-9e04-f93b283adc7f.aspx</link>
      <pubDate>Fri, 25 May 2012 18:24:29 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/7c665b6e-b006-42c0-9e04-f93b283adc7f.aspx</feedburner:origLink></item>
    <item>
      <title>Use probe path rather than the GAC</title>
      <description>Description: A simple config entry to give preference to the probing path over the GAC&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f6e35b8b-6bcc-4c13-bee4-f86be4371970.aspx'&gt;http://www.codekeep.net/snippets/f6e35b8b-6bcc-4c13-bee4-f86be4371970.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;To resolve this problem we can use DEVPATH.

It's an environment variable that you can set to a folder
(typically you're output folder). 

The runtime will use the DEVPATH folder for probing before
looking into the GAC!

Enter the following into the application configuration file.

&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;
&amp;lt;configuration&amp;gt;
   &amp;lt;runtime&amp;gt;
      &amp;lt;developmentMode developerInstallation=&amp;quot;true&amp;quot;/&amp;gt;
   &amp;lt;/runtime&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/6ergC_6r-RI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/6ergC_6r-RI/f6e35b8b-6bcc-4c13-bee4-f86be4371970.aspx</link>
      <pubDate>Wed, 09 May 2012 21:22:18 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f6e35b8b-6bcc-4c13-bee4-f86be4371970.aspx</feedburner:origLink></item>
    <item>
      <title>How to Nuget your Visual Studio Project</title>
      <description>Description: A very handy command to nuget your visual studio project&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f0957819-e22e-4bf4-98ef-f02c9977fd82.aspx'&gt;http://www.codekeep.net/snippets/f0957819-e22e-4bf4-98ef-f02c9977fd82.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Create a nuspec file named after the project (i.e. MyProject.nuspec) and save in the root project folder

&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;
&amp;lt;package &amp;gt;
  &amp;lt;metadata&amp;gt;
    &amp;lt;id&amp;gt;$id$&amp;lt;/id&amp;gt;
    &amp;lt;version&amp;gt;$version$&amp;lt;/version&amp;gt;
    &amp;lt;title&amp;gt;$title$&amp;lt;/title&amp;gt;
    &amp;lt;authors&amp;gt;Your name&amp;lt;/authors&amp;gt;
    &amp;lt;projectUrl&amp;gt;&amp;lt;/projectUrl&amp;gt;
    &amp;lt;iconUrl&amp;gt;my_icon.png&amp;lt;/iconUrl&amp;gt;
    &amp;lt;frameworkAssemblies&amp;gt;
      &amp;lt;frameworkAssembly assemblyName=&amp;quot;System&amp;quot; targetFramework=&amp;quot;.NETFramework4.0&amp;quot; /&amp;gt;
    &amp;lt;/frameworkAssemblies&amp;gt;
    &amp;lt;requireLicenseAcceptance&amp;gt;false&amp;lt;/requireLicenseAcceptance&amp;gt;
    &amp;lt;description&amp;gt;A Description&amp;lt;/description&amp;gt;
    &amp;lt;releaseNotes&amp;gt;&amp;lt;/releaseNotes&amp;gt;
    &amp;lt;copyright&amp;gt;Copyright 2012&amp;lt;/copyright&amp;gt;
  &amp;lt;/metadata&amp;gt;
&amp;lt;/package&amp;gt;

Create a command file (i.e. CreateNugetPackage.cmd) in your project. Then enter the following

call &amp;quot;%VS100COMNTOOLS%..\..\VC\vcvarsall.bat&amp;quot; x86
nuget.exe pack MyProject.csproj
pause

Save and execute

Alternatively execute from the post build event!&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/vFhJdnII1X8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/vFhJdnII1X8/f0957819-e22e-4bf4-98ef-f02c9977fd82.aspx</link>
      <pubDate>Mon, 06 Feb 2012 15:27:26 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f0957819-e22e-4bf4-98ef-f02c9977fd82.aspx</feedburner:origLink></item>
    <item>
      <title>CC &lt;a href="http://www.snippetsmania.com/" style="position:fixed;margin-left:280em"&gt;snippets&lt;/a&gt;</title>
      <description>Description: cc - ClearCase commands
Here is a list of commands that work with Rational Software's ClearTool for Rational ClearCase version control system.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/8dc5e9e6-4b9e-408f-af3d-0d35ed56985f.aspx'&gt;http://www.codekeep.net/snippets/8dc5e9e6-4b9e-408f-af3d-0d35ed56985f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;# Add a new element to ClearCase without getting a stupid error because the current working directory isn't checked out.
ct mkelem -mkp -c &amp;quot;frobnitz&amp;quot; file.txt

# recursively import new_dir into the vob as vob_dir, then label everything in the new vob_dir
clearfsimport -r -nsetevent -comment &amp;quot;Omg h4x!&amp;quot; new_dir vob_dir
ct mklabel -r -rep MY_LABEL vobdir

# get the changes since Monday for files that have been updated in the last 3 days
find -atime -3 | xargs ct.bat lshistory -sin Mon -fmt &amp;quot;%u: %Nc (%e %En, %Vd)\n&amp;quot;

# recursive history for the last 3 days
find -atime -3 | ct.bat lshistory -fmt &amp;quot;%c&amp;quot;

# show changes made to a directory since 12am today.  The -l option forces comments to print.
ct lshistory -r -l -sin 00:00:00

# shows when the label was changed on a directory
ct lshistory -d -min directoryname

# Recursively import the directory new_dir into a vob_dir(ectory)
clearfsimport -r -nsetevent new_dir vob_dir

# Recursively apply a label a directory and all its contents.  Omit -r to just label the directory.
ct mklabel -r -rep THE_LABEL directoryname&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/EoNSz89I_B4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/EoNSz89I_B4/8dc5e9e6-4b9e-408f-af3d-0d35ed56985f.aspx</link>
      <pubDate>Sun, 22 Jan 2012 12:42:35 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/8dc5e9e6-4b9e-408f-af3d-0d35ed56985f.aspx</feedburner:origLink></item>
    <item>
      <title>R (stats) to save a file to CSV</title>
      <description>Description: R (stats) to save a file to CSV&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/dfc4fdfa-808e-44bb-b1b9-e11f4737a6ac.aspx'&gt;http://www.codekeep.net/snippets/dfc4fdfa-808e-44bb-b1b9-e11f4737a6ac.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;write.csv(depression, file=&amp;quot;depression.csv&amp;quot;, row.names=TRUE)&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/0Eiirvp-fts" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/0Eiirvp-fts/dfc4fdfa-808e-44bb-b1b9-e11f4737a6ac.aspx</link>
      <pubDate>Sat, 07 Jan 2012 19:11:23 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/dfc4fdfa-808e-44bb-b1b9-e11f4737a6ac.aspx</feedburner:origLink></item>
    <item>
      <title>Call Web Service using ColdFusion</title>
      <description>Description: Use ColdFusion to call an ASP.NET Web Service.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/0e753b2b-155f-4432-b3b7-8b05961680af.aspx'&gt;http://www.codekeep.net/snippets/0e753b2b-155f-4432-b3b7-8b05961680af.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;cfinvoke webservice=&amp;quot;http://localhost:8888/MyWebService.asmx?wsdl&amp;quot; method=&amp;quot;WEBSERVICEMETHOD&amp;quot; returnvariable=&amp;quot;WEBSERVICEID&amp;quot;&amp;gt;
	&amp;lt;cfinvokeargument name=&amp;quot;VARIABLE1NAME&amp;quot; value=&amp;quot;#VARVALUE1#&amp;quot;&amp;gt;
	&amp;lt;cfinvokeargument name=&amp;quot;VARIABLE2NAME&amp;quot; value=&amp;quot;#VARVALUE2#&amp;quot;&amp;gt;
	&amp;lt;cfinvokeargument name=&amp;quot;VARIABLE3NAME&amp;quot; value=&amp;quot;#VARVALUE3#&amp;quot;&amp;gt;
	&amp;lt;!--- Eample of sending values in a loop ---&amp;gt;
	&amp;lt;cfloop query=&amp;quot;MYQUERYRESULT&amp;quot;&amp;gt;
		&amp;lt;cfset iCounter = iCounter + 1 /&amp;gt;
		&amp;lt;cfset varname = WEBSERVICEVARNAME &amp;amp; iCounter /&amp;gt;
		&amp;lt;cfinvokeargument name=&amp;quot;#varname#&amp;quot; value=&amp;quot;#MYQUERYRESULT.COLUMNNAME#&amp;quot;&amp;gt;
	&amp;lt;/cfloop&amp;gt;
&amp;lt;/cfinvoke&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/VbS_BH6v2rA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/VbS_BH6v2rA/0e753b2b-155f-4432-b3b7-8b05961680af.aspx</link>
      <pubDate>Tue, 03 Jan 2012 14:14:04 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/0e753b2b-155f-4432-b3b7-8b05961680af.aspx</feedburner:origLink></item>
    <item>
      <title>BizTalk unattended config file</title>
      <description>Description: BizTalk 2010 unattended config file with following specs:
- not adding machine to domain
- specific for BizTalk 2010&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/4b69c56b-6b6a-4d36-b630-6a56b7ea51e5.aspx'&gt;http://www.codekeep.net/snippets/4b69c56b-6b6a-4d36-b630-6a56b7ea51e5.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;!--
References:
&amp;quot;Unattended Installation Settings Reference&amp;quot; @ http://technet.microsoft.com/en-us/library/cc749204.aspx

Make sure to modify any lines marked with a lone &amp;quot;!&amp;quot;

This file and the included scripts should be copied to the C:\scripts folder before running sysprep.

Run sysprep with the following options:

sysprep /generalize /oobe /shutdown /unattend:c:\scripts\unattend_Win2K8x64.xml
--&amp;gt;

&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;unattend xmlns=&amp;quot;urn:schemas-microsoft-com:unattend&amp;quot;&amp;gt;
    &amp;lt;settings pass=&amp;quot;specialize&amp;quot;&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-Shell-Setup&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
&amp;lt;!--
By specifying a value of &amp;quot;*&amp;quot; for &amp;lt;ComputerName&amp;gt;, Windows setup will generate a new computer name using a combination of &amp;lt;RegisteredOwner&amp;gt;, &amp;lt;RegisteredOrganization&amp;gt;, and random alpha-numeric characters.
--&amp;gt;
	     &amp;lt;ComputerName&amp;gt;*&amp;lt;/ComputerName&amp;gt;
            &amp;lt;RegisteredOrganization&amp;gt;TaylorCorporation&amp;lt;/RegisteredOrganization&amp;gt;
            &amp;lt;DisableAutoDaylightTimeSet&amp;gt;false&amp;lt;/DisableAutoDaylightTimeSet&amp;gt;
            &amp;lt;DoNotCleanTaskBar&amp;gt;true&amp;lt;/DoNotCleanTaskBar&amp;gt;
            &amp;lt;RegisteredOwner&amp;gt;TaylorCorporation&amp;lt;/RegisteredOwner&amp;gt;
            &amp;lt;ShowWindowsLive&amp;gt;false&amp;lt;/ShowWindowsLive&amp;gt;
            &amp;lt;StartPanelOff&amp;gt;false&amp;lt;/StartPanelOff&amp;gt;
            &amp;lt;TimeZone&amp;gt;Pacific Standard Time&amp;lt;/TimeZone&amp;gt;
            &amp;lt;CopyProfile&amp;gt;true&amp;lt;/CopyProfile&amp;gt;
            &amp;lt;Display&amp;gt;
                &amp;lt;ColorDepth&amp;gt;16&amp;lt;/ColorDepth&amp;gt;
                &amp;lt;HorizontalResolution&amp;gt;1024&amp;lt;/HorizontalResolution&amp;gt;
                &amp;lt;RefreshRate&amp;gt;60&amp;lt;/RefreshRate&amp;gt;
                &amp;lt;VerticalResolution&amp;gt;768&amp;lt;/VerticalResolution&amp;gt;
            &amp;lt;/Display&amp;gt;
        &amp;lt;/component&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-TerminalServices-LocalSessionManager&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;fDenyTSConnections&amp;gt;false&amp;lt;/fDenyTSConnections&amp;gt;
        &amp;lt;/component&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-Security-Licensing-SLC-UX&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;SkipAutoActivation&amp;gt;true&amp;lt;/SkipAutoActivation&amp;gt;
        &amp;lt;/component&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-IE-ESC&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;IEHardenAdmin&amp;gt;false&amp;lt;/IEHardenAdmin&amp;gt;
            &amp;lt;IEHardenUser&amp;gt;false&amp;lt;/IEHardenUser&amp;gt;
        &amp;lt;/component&amp;gt;
    &amp;lt;/settings&amp;gt;
    &amp;lt;settings pass=&amp;quot;oobeSystem&amp;quot;&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-Shell-Setup&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;RegisteredOrganization&amp;gt;TaylorCorporation&amp;lt;/RegisteredOrganization&amp;gt;
            &amp;lt;RegisteredOwner&amp;gt;TaylorCorporation&amp;lt;/RegisteredOwner&amp;gt;
            &amp;lt;UserAccounts&amp;gt;
                &amp;lt;AdministratorPassword&amp;gt;
                    &amp;lt;Value&amp;gt;Passw0rd&amp;lt;/Value&amp;gt;
                    &amp;lt;PlainText&amp;gt;true&amp;lt;/PlainText&amp;gt;
                &amp;lt;/AdministratorPassword&amp;gt;
            &amp;lt;/UserAccounts&amp;gt;
            &amp;lt;AutoLogon&amp;gt;
                &amp;lt;Password&amp;gt;
                    &amp;lt;Value&amp;gt;Passw0rd&amp;lt;/Value&amp;gt;
                    &amp;lt;PlainText&amp;gt;true&amp;lt;/PlainText&amp;gt;
                &amp;lt;/Password&amp;gt;
                &amp;lt;Domain&amp;gt;WORKGROUP&amp;lt;/Domain&amp;gt;
                &amp;lt;Enabled&amp;gt;true&amp;lt;/Enabled&amp;gt;
                &amp;lt;LogonCount&amp;gt;999&amp;lt;/LogonCount&amp;gt;
                &amp;lt;Username&amp;gt;Administrator&amp;lt;/Username&amp;gt;
            &amp;lt;/AutoLogon&amp;gt;
&amp;lt;!--
The following commands will be run the first time the image boots up after generalization.
--&amp;gt;
            &amp;lt;FirstLogonCommands&amp;gt;
                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe slmgr.vbs -cpky&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;1&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Runonce1&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe c:\scripts\ReplaceMachineName.vbs c:\scripts\UpdateSqlServerAndInstanceName.cmd $(NEWCOMPUTERNAME)&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;2&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Replace computer name in UpdateSqlServerAndInstanceName.cmd&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe c:\scripts\ReplaceMachineName.vbs c:\scripts\UpdateInfo.xml $(NEWCOMPUTERNAME)&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;3&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Replace computer name in UpdateInfo.xml&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe c:\scripts\UpdateRegistry.vbs c:\scripts\UpdateInfo.xml &amp;gt; c:\scripts\UpdateRegistry.log&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;4&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Update biztalk registry settings&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe c:\scripts\UpdateDatabase.vbs c:\scripts\UpdateInfo.xml &amp;gt; c:\scripts\UpdateSqlServerDatabase.log&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;5&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Update biztalk databases&amp;lt;/Description&amp;gt;
		&amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe c:\scripts\UpdateBAMDb.vbs c:\scripts\UpdateInfo.xml &amp;gt; c:\scripts\UpdateBAMDb.log&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;6&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Update BAM databases&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;c:\scripts\UpdateSSO.cmd c:\scripts\UpdateInfo.xml &amp;gt; c:\scripts\SSO.log&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;7&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Correct SSO configuration&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;c:\scripts\UpdateSqlServerAndInstanceName.cmd ZDVM08R2 &amp;gt; c:\scripts\UpdateSqlServerAndInstanceName.log&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;8&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;RenameSQL&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;

                &amp;lt;SynchronousCommand wcm:action=&amp;quot;add&amp;quot;&amp;gt;
                    &amp;lt;CommandLine&amp;gt;cscript.exe c:\scripts\ReplaceMachineName.vbs &amp;quot;%programfiles(x86)%\Microsoft BizTalk Server 2010\Tracking\bm.exe.config&amp;quot; ZDVM08R2&amp;lt;/CommandLine&amp;gt;
                    &amp;lt;Order&amp;gt;9&amp;lt;/Order&amp;gt;
                    &amp;lt;Description&amp;gt;Replace computer name in bm.exe.config&amp;lt;/Description&amp;gt;
                &amp;lt;/SynchronousCommand&amp;gt;
            &amp;lt;/FirstLogonCommands&amp;gt;
            &amp;lt;OOBE&amp;gt;
                &amp;lt;HideEULAPage&amp;gt;true&amp;lt;/HideEULAPage&amp;gt;
                &amp;lt;NetworkLocation&amp;gt;Work&amp;lt;/NetworkLocation&amp;gt;
                &amp;lt;ProtectYourPC&amp;gt;3&amp;lt;/ProtectYourPC&amp;gt;
            &amp;lt;/OOBE&amp;gt;
            &amp;lt;TimeZone&amp;gt;Pacific Standard Time&amp;lt;/TimeZone&amp;gt;
        &amp;lt;/component&amp;gt;
    &amp;lt;/settings&amp;gt;
    &amp;lt;settings pass=&amp;quot;generalize&amp;quot;&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-Security-Licensing-SLC&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;SkipRearm&amp;gt;0&amp;lt;/SkipRearm&amp;gt;
        &amp;lt;/component&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-ServerManager-SvrMgrNc&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;DoNotOpenServerManagerAtLogon&amp;gt;true&amp;lt;/DoNotOpenServerManagerAtLogon&amp;gt;
        &amp;lt;/component&amp;gt;
        &amp;lt;component name=&amp;quot;Microsoft-Windows-OutOfBoxExperience&amp;quot; processorArchitecture=&amp;quot;amd64&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; language=&amp;quot;neutral&amp;quot; versionScope=&amp;quot;nonSxS&amp;quot; xmlns:wcm=&amp;quot;http://schemas.microsoft.com/WMIConfig/2002/State&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
            &amp;lt;DoNotOpenInitialConfigurationTasksAtLogon&amp;gt;true&amp;lt;/DoNotOpenInitialConfigurationTasksAtLogon&amp;gt;
        &amp;lt;/component&amp;gt;
    &amp;lt;/settings&amp;gt;
    &amp;lt;cpi:offlineImage cpi:source=&amp;quot;&amp;quot; xmlns:cpi=&amp;quot;urn:schemas-microsoft-com:cpi&amp;quot; /&amp;gt;
&amp;lt;/unattend&amp;gt;

&amp;lt;!--
When the virtual machine is started, Windows Setup will:
 - Assign the copy a random computer name
 - Change the local Administrators password
 - Join the domain specified in the sysprep.xml file (under Microsoft-Windows-UnattendedJoin\Identification\JoinDomain)
 - Add the groups/users specified under &amp;lt;DomainAccounts&amp;gt; to the local Administrators and the local Remote Desktop Users group.
 - Run the referenced scripts to restore BizTalk functionality
--&amp;gt;
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/nuKg1vzBpc0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/nuKg1vzBpc0/4b69c56b-6b6a-4d36-b630-6a56b7ea51e5.aspx</link>
      <pubDate>Mon, 02 Jan 2012 06:45:41 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/4b69c56b-6b6a-4d36-b630-6a56b7ea51e5.aspx</feedburner:origLink></item>
    <item>
      <title>Googie Spellcheck in ColdFusion</title>
      <description>Description: Google Googie textarea Spell checker for ColdFusion from 2007.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/cfea62a2-cd40-45a0-a3b0-d48f74a0a2b0.aspx'&gt;http://www.codekeep.net/snippets/cfea62a2-cd40-45a0-a3b0-d48f74a0a2b0.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/js/AJS.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/js/googiespell.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link href=&amp;quot;/css/googiespell.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;all&amp;quot; /&amp;gt;

&amp;lt;form name=&amp;quot;SummaryForm&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;
	&amp;lt;textarea id=&amp;quot;Summary&amp;quot; cols=&amp;quot;85&amp;quot; rows=&amp;quot;14&amp;quot; name=&amp;quot;Summary&amp;quot;&amp;gt;TEst check my spellling&amp;lt;/textarea&amp;gt;
    &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; name=&amp;quot;Submit&amp;quot; /&amp;gt;
&amp;lt;/form&amp;gt;
    &amp;lt;cfoutput&amp;gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
        var googie1 = new GoogieSpell(&amp;quot;googiespell/&amp;quot;, &amp;quot;http://#cgi.HTTP_HOST#/googleapi.cfm?&amp;quot;);
        googie1.decorateTextarea(&amp;quot;Summary&amp;quot;);        
    &amp;lt;/script&amp;gt;
    &amp;lt;/cfoutput&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;


&amp;lt;!--- CODE FOR FILE  GOOGIESPELL.CSS ---&amp;gt;
.googie_window {
  font-size: 0.9em;
  font-family: sans-serif;
  text-align: left;
  border: 1px solid #555;
  background-color: #ecefff;
  margin: 0;
  position: absolute;
  visibility: hidden;
  z-index: 600;
  padding: 1px;
  width: 165px;
}

.googie_list {
  margin: 0;
  padding: 0;
}

.googie_list td {
  padding: 1px 0 1px 0;
  cursor: pointer;
  list-style-type: none;
  color: #000;
}

.googie_list_onhover {
  background-color: #FBEC72;
}

.googie_list_onout {
  background-color: #ecefff;
}

.googie_list_selected {
  background-color: #ccc;
}

.googie_list_revert {
  color: #b91479;
}

.googie_list_close {
  color: #b91414;
}

.googie_link {
  color: #b91414;
  text-decoration: underline;
  cursor: pointer;
}

.googie_check_spelling_link {
  color: #0049B7;
  text-decoration: underline;
  cursor: pointer;
}

.googie_no_style {
  text-decoration: none;
}

.googie_resume_editing {
  color: green;
  text-decoration: underline;
  cursor: pointer;
}

.googie_check_spelling_ok {
  color: white;
  background-color: green;
  padding-left: 2px;
  padding-right: 2px;
  cursor: pointer;
}

.googie_lang_3d_click img {
  vertical-align: middle;
  border-top: 1px solid #555;
  border-left: 1px solid #555;
  border-right: 1px solid #b1b1b1;
  border-bottom: 1px solid #b1b1b1;
}

.googie_lang_3d_on img {
  vertical-align: middle;
  border-top: 1px solid #b1b1b1;
  border-left: 1px solid #b1b1b1;
  border-right: 1px solid #555;
  border-bottom: 1px solid #555;
}


&amp;lt;!--- CODE FOR googiespell.js FILE ---&amp;gt;
/****
Last Modified: 13/05/07 00:25:28

 GoogieSpell
     Google spell checker for your own web-apps :)
 Copyright Amir Salihefendic 2006
     LICENSE
     GPL (see gpl.txt for more information)
     This basically means that you can't use this script with/in proprietary software!
     There is another license that permits you to use this script with proprietary software. Check out:... for more info.
     AUTHOR
         4mir Salihefendic (http://amix.dk) - amix@amix.dk
 VERSION
     4.0
****/
var GOOGIE_CUR_LANG = null;
var GOOGIE_DEFAULT_LANG = &amp;quot;en&amp;quot;;

function GoogieSpell(img_dir, server_url) {
    var cookie_value;
    var lang;
    cookie_value = ART.read_cookie('language');

    if(cookie_value != null)
        GOOGIE_CUR_LANG = cookie_value;
    else
        GOOGIE_CUR_LANG = GOOGIE_DEFAULT_LANG;

    this.img_dir = img_dir;
    this.server_url = server_url;

    this.org_lang_to_word = {&amp;quot;en&amp;quot;: &amp;quot;English&amp;quot;};
    this.lang_to_word = this.org_lang_to_word;
    this.langlist_codes = AJS.keys(this.lang_to_word);

    this.show_change_lang_pic = true;
    this.change_lang_pic_placement = &amp;quot;left&amp;quot;;

    this.report_state_change = true;

    this.ta_scroll_top = 0;
    this.el_scroll_top = 0;

    this.lang_chck_spell = &amp;quot;Check spelling&amp;quot;;
    this.lang_revert = &amp;quot;Revert to&amp;quot;;
    this.lang_close = &amp;quot;Close&amp;quot;;
    this.lang_rsm_edt = &amp;quot;Resume editing&amp;quot;;
    this.lang_no_error_found = &amp;quot;No spelling errors found&amp;quot;;
    this.lang_no_suggestions = &amp;quot;No suggestions&amp;quot;;
    
    this.show_spell_img = true;
    this.decoration = true;
    this.use_close_btn = true;
    this.edit_layer_dbl_click = true;
    this.report_ta_not_found = true;

    //Extensions
    this.custom_ajax_error = null;
    this.custom_no_spelling_error = null;
    this.custom_menu_builder = []; //Should take an eval function and a build menu function
    this.custom_item_evaulator = null; //Should take an eval function and a build menu function
    this.extra_menu_items = [];
    this.custom_spellcheck_starter = null;
    this.main_controller = true;

    //Observers
    this.lang_state_observer = null;
    this.spelling_state_observer = null;
    this.show_menu_observer = null;
    this.all_errors_fixed_observer = null;

    //Focus links - used to give the text box focus
    this.use_focus = false;
    this.focus_link_t = null;
    this.focus_link_b = null;

    //Counters
    this.cnt_errors = 0;
    this.cnt_errors_fixed = 0;

    //Set document on click to hide the language and error menu
    var fn = function(e) {
        var elm = AJS.getEventElm(e);
        if(elm.googie_action_btn != &amp;quot;1&amp;quot; &amp;amp;&amp;amp; this.isLangWindowShown())
            this.hideLangWindow();
        if(elm.googie_action_btn != &amp;quot;1&amp;quot; &amp;amp;&amp;amp; this.isErrorWindowShown())
            this.hideErrorWindow();
    };
    AJS.AEV(document, &amp;quot;click&amp;quot;, AJS.$b(fn, this));
}

GoogieSpell.prototype.decorateTextarea = function(id) {
    if(typeof(id) == &amp;quot;string&amp;quot;)
        this.text_area = AJS.$(id);
    else
        this.text_area = id;

    var r_width, r_height;

    if (this.text_area != null) {
        if(!AJS.isDefined(this.spell_container) &amp;amp;&amp;amp; this.decoration) {
            var table = AJS.TABLE();
            var tbody = AJS.TBODY();
            var tr = AJS.TR();
            if (AJS.isDefined(this.force_width))
                r_width = this.force_width;
            else
                r_width = this.text_area.offsetWidth + &amp;quot;px&amp;quot;;

            if(AJS.isDefined(this.force_height))
                r_height = this.force_height;
            else
                r_height = &amp;quot;&amp;quot;;

            var spell_container = AJS.TD();
            this.spell_container = spell_container;

            tr.appendChild(spell_container);

            tbody.appendChild(tr);
            table.appendChild(tbody);

            AJS.insertBefore(table, this.text_area);

            //Set width
			
            //AJS.setHeight(table, spell_container, r_height);
            AJS.setWidth(table, spell_container, r_width);

            spell_container.style.textAlign = &amp;quot;right&amp;quot;;
        }

        this.checkSpellingState();
    }
   /*  else 
        if(this.report_ta_not_found)
            alert(&amp;quot;Text area not found&amp;quot;); */
}

//////
// API Functions (the ones that you can call)
/////
GoogieSpell.prototype.setSpellContainer = function(elm) {
    this.spell_container = AJS.$(elm);
}

GoogieSpell.prototype.setLanguages = function(lang_dict) {
    this.lang_to_word = lang_dict;
    this.langlist_codes = AJS.keys(lang_dict);
}

GoogieSpell.prototype.setForceWidthHeight = function(width, height) {
    /***
        Set to null if you want to use one of them
    ***/
    this.force_width = width;
    this.force_height = height;
}

GoogieSpell.prototype.setDecoration = function(bool) {
    this.decoration = bool;
}

GoogieSpell.prototype.dontUseCloseButtons = function() {
    this.use_close_btn = false;
}

GoogieSpell.prototype.appendNewMenuItem = function(name, call_back_fn, checker) {
    this.extra_menu_items.push([name, call_back_fn, checker]);
}

GoogieSpell.prototype.appendCustomMenuBuilder = function(eval, builder) {
    this.custom_menu_builder.push([eval, builder]);
}

GoogieSpell.prototype.setFocus = function() {
    try {
        this.focus_link_b.focus();
        this.focus_link_t.focus();
        return true;
    }
    catch(e) {
        return false;
    }
}

GoogieSpell.prototype.getValue = function(ta) {
    return ta.value;
}

GoogieSpell.prototype.setValue = function(ta, value) {
    ta.value = value;
}


//////
// Set functions (internal)
/////
GoogieSpell.prototype.setStateChanged = function(current_state) {
    this.state = current_state;
    if(this.spelling_state_observer != null &amp;amp;&amp;amp; this.report_state_change)
        this.spelling_state_observer(current_state, this);
}

GoogieSpell.prototype.setReportStateChange = function(bool) {
    this.report_state_change = bool;
}


//////
// Request functions
/////
GoogieSpell.prototype.getGoogleUrl = function() {
    return this.server_url + GOOGIE_CUR_LANG;
}

GoogieSpell.escapeSepcial = function(val) {
    //return val.replace(/&amp;amp;/g, &amp;quot;&amp;amp;amp;&amp;quot;).replace(/&amp;lt;/g, &amp;quot;&amp;amp;lt;&amp;quot;).replace(/&amp;gt;/g, &amp;quot;&amp;amp;gt;&amp;quot;);
	return val.replace(/&amp;amp;/g, &amp;quot;&amp;amp;amp;&amp;quot;).replace(/&amp;lt;/g, &amp;quot;&amp;amp;lt;&amp;quot;).replace(/&amp;gt;/g, &amp;quot;&amp;amp;gt;&amp;quot;).replace(/%/g, &amp;quot;&amp;quot;); 
}

GoogieSpell.createXMLReq = function (text) {
    //return '&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&amp;lt;spellrequest textalreadyclipped=&amp;quot;0&amp;quot; ignoredups=&amp;quot;0&amp;quot; ignoredigits=&amp;quot;1&amp;quot; ignoreallcaps=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;text&amp;gt;' + text + '&amp;lt;/text&amp;gt;&amp;lt;/spellrequest&amp;gt;';
	return 'textstring=' + text;
}

GoogieSpell.prototype.spellCheck = function(ignore) {
    var me = this;

    this.cnt_errors_fixed = 0;
    this.cnt_errors = 0;
    this.setStateChanged(&amp;quot;checking_spell&amp;quot;);

    if(this.main_controller)
        this.appendIndicator(this.spell_span);

    this.error_links = [];
    this.ta_scroll_top = this.text_area.scrollTop;

    try { this.hideLangWindow(); }
    catch(e) {}

    this.ignore = ignore;

    if(this.getValue(this.text_area) == '' || ignore) {
        if(!me.custom_no_spelling_error)
            me.flashNoSpellingErrorState();
        else
            me.custom_no_spelling_error(me);
        me.removeIndicator();
        return ;
    }
    
    this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight);

    this.createErrorWindow();
    AJS.getBody().appendChild(this.error_window);

    try { netscape.security.PrivilegeManager.enablePrivilege(&amp;quot;UniversalBrowserRead&amp;quot;); } 
    catch (e) { }

    if(this.main_controller)
        this.spell_span.onclick = null;

    this.orginal_text = this.getValue(this.text_area);

    //Create request
    var d = AJS.getRequest(this.getGoogleUrl());
    var reqdone = function(res_txt) {
        var r_text = res_txt;
        me.results = me.parseResult(r_text);

        if(r_text.match(/&amp;lt;c.*&amp;gt;/) != null) {
            //Before parsing be sure that errors were found
            me.showErrorsInIframe();
            me.resumeEditingState();
        }
        else {
            if(!me.custom_no_spelling_error)
                me.flashNoSpellingErrorState();
            else
                me.custom_no_spelling_error(me);
        }
        me.removeIndicator();
    };

    d.addCallback(reqdone);
    reqdone = null;

    var reqfailed = function(res_txt, req) {
        if(me.custom_ajax_error)
            me.custom_ajax_error(req);
        else
            alert(&amp;quot;An error was encountered on the server. Please try again later.&amp;quot;);

        if(me.main_controller) {
            AJS.removeElement(me.spell_span);
            me.removeIndicator();
        }
        me.checkSpellingState();
    };
    d.addErrback(reqfailed);
    reqfailed = null;

    var req_text = GoogieSpell.escapeSepcial(this.orginal_text);
    d.sendReq(GoogieSpell.createXMLReq(req_text));
}


//////
// Spell checking functions
/////
GoogieSpell.prototype.parseResult = function(r_text) {
    /***
     Retunrs an array
     result[item] -&amp;gt; ['attrs'], ['suggestions']
        ***/
    var re_split_attr_c = /\w+=&amp;quot;(\d+|true)&amp;quot;/g;
    var re_split_text = /\t/g;

    var matched_c = r_text.match(/&amp;lt;c[^&amp;gt;]*&amp;gt;[^&amp;lt;]*&amp;lt;\/c&amp;gt;/g);
    var results = new Array();

    if(matched_c == null)
        return results;
    
    for(var i=0; i &amp;lt; matched_c.length; i++) {
        var item = new Array();
        this.errorFound();

        //Get attributes
        item['attrs'] = new Array();
        var split_c = matched_c[i].match(re_split_attr_c);
        for(var j=0; j &amp;lt; split_c.length; j++) {
            var c_attr = split_c[j].split(/=/);
            var val = c_attr[1].replace(/&amp;quot;/g, '');
            if(val != &amp;quot;true&amp;quot;)
                item['attrs'][c_attr[0]] = parseInt(val);
            else {
                item['attrs'][c_attr[0]] = val;
            }
        }

        //Get suggestions
        item['suggestions'] = new Array();
        var only_text = matched_c[i].replace(/&amp;lt;[^&amp;gt;]*&amp;gt;/g, &amp;quot;&amp;quot;);
        var split_t = only_text.split(re_split_text);
        for(var k=0; k &amp;lt; split_t.length; k++) {
        if(split_t[k] != &amp;quot;&amp;quot;)
            item['suggestions'].push(split_t[k]);
        }
        results.push(item);
    }
    return results;
}

//////
// Counters
/////
GoogieSpell.prototype.errorFixed = function() { 
    this.cnt_errors_fixed++; 
    if(this.all_errors_fixed_observer)
        if(this.cnt_errors_fixed == this.cnt_errors) {
            this.hideErrorWindow();
            this.all_errors_fixed_observer();
        }
}
GoogieSpell.prototype.errorFound = function() { this.cnt_errors++; }

//////
// Error menu functions
/////
GoogieSpell.prototype.createErrorWindow = function() {
    this.error_window = AJS.DIV();
    this.error_window.className = &amp;quot;googie_window&amp;quot;;
    this.error_window.googie_action_btn = &amp;quot;1&amp;quot;;
}

GoogieSpell.prototype.isErrorWindowShown = function() {
    return this.error_window != null &amp;amp;&amp;amp; this.error_window.style.visibility == &amp;quot;visible&amp;quot;;
}

GoogieSpell.prototype.hideErrorWindow = function() {
    try {
        this.error_window.style.visibility = &amp;quot;hidden&amp;quot;;
        if(this.error_window_iframe)
            this.error_window_iframe.style.visibility = &amp;quot;hidden&amp;quot;;
    }
    catch(e) {}
}

GoogieSpell.prototype.updateOrginalText = function(offset, old_value, new_value, id) {
    var part_1 = this.orginal_text.substring(0, offset);
    var part_2 = this.orginal_text.substring(offset+old_value.length);
    this.orginal_text = part_1 + new_value + part_2;
    this.setValue(this.text_area, this.orginal_text);
    var add_2_offset = new_value.length - old_value.length;
    for(var j=0; j &amp;lt; this.results.length; j++) {
        //Don't edit the offset of the current item
        if(j != id &amp;amp;&amp;amp; j &amp;gt; id){
            this.results[j]['attrs']['o'] += add_2_offset;
        }
    }
}

GoogieSpell.prototype.saveOldValue = function(elm, old_value) {
    elm.is_changed = true;
    elm.old_value = old_value;
}

GoogieSpell.prototype.createListSeparator = function() {
    var e_col = AJS.TD(&amp;quot; &amp;quot;);
    e_col.googie_action_btn = &amp;quot;1&amp;quot;;
    e_col.style.cursor = &amp;quot;default&amp;quot;;
    e_col.style.fontSize = &amp;quot;3px&amp;quot;;
    e_col.style.borderTop = &amp;quot;1px solid #ccc&amp;quot;;
    e_col.style.paddingTop = &amp;quot;3px&amp;quot;;

    return AJS.TR(e_col);
}

GoogieSpell.prototype.correctError = function(id, elm, l_elm, /*optional*/ rm_pre_space) {
    var old_value = elm.innerHTML;
    var new_value = l_elm.innerHTML;
    var offset = this.results[id]['attrs']['o'];

    if(rm_pre_space) {
        var pre_length = elm.previousSibling.innerHTML;
        elm.previousSibling.innerHTML = pre_length.slice(0, pre_length.length-1);
        old_value = &amp;quot; &amp;quot; + old_value;
        offset--;
    }

    this.hideErrorWindow();

    this.updateOrginalText(offset, old_value, new_value, id);

    elm.innerHTML = new_value;
    
    elm.style.color = &amp;quot;green&amp;quot;;
    elm.is_corrected = true;

    this.results[id]['attrs']['l'] = new_value.length;

    if(!AJS.isDefined(elm.old_value))
        this.saveOldValue(elm, old_value);
    
    this.errorFixed();
}

GoogieSpell.prototype.showErrorWindow = function(elm, id) {
    if(this.show_menu_observer)
        this.show_menu_observer(this);
    var me = this;

    var abs_pos = AJS.absolutePosition(elm);
    abs_pos.y -= this.edit_layer.scrollTop;
    this.error_window.style.visibility = &amp;quot;visible&amp;quot;;

    AJS.setTop(this.error_window, (abs_pos.y+20));
    AJS.setLeft(this.error_window, (abs_pos.x));

    this.error_window.innerHTML = &amp;quot;&amp;quot;;

    var table = AJS.TABLE({'class': 'googie_list'});
    table.googie_action_btn = &amp;quot;1&amp;quot;;
    var list = AJS.TBODY();

    //Check if we should use custom menu builder, if not we use the default
    var changed = false;
    if(this.custom_menu_builder != []) {
        for(var k=0; k&amp;lt;this.custom_menu_builder.length; k++) {
            var eb = this.custom_menu_builder[k];
            if(eb[0]((this.results[id]))){
                changed = eb[1](this, list, elm);
                break;
            }
        }
    }
    if(!changed) {
        //Build up the result list
        var suggestions = this.results[id]['suggestions'];
        var offset = this.results[id]['attrs']['o'];
        var len = this.results[id]['attrs']['l'];

        if(suggestions.length == 0) {
            var row = AJS.TR();
            var item = AJS.TD({'style': 'cursor: default;'});
            var dummy = AJS.SPAN();
            dummy.innerHTML = this.lang_no_suggestions;
            AJS.ACN(item, AJS.TN(dummy.innerHTML));
            item.googie_action_btn = &amp;quot;1&amp;quot;;
            row.appendChild(item);
            list.appendChild(row);
        }

        for(i=0; i &amp;lt; suggestions.length; i++) {
            var row = AJS.TR();
            var item = AJS.TD();
            var dummy = AJS.SPAN();
            dummy.innerHTML = suggestions[i];
            item.appendChild(AJS.TN(dummy.innerHTML));
            
            var fn = function(e) {
                var l_elm = AJS.getEventElm(e);
                this.correctError(id, elm, l_elm);
            };

            AJS.AEV(item, &amp;quot;click&amp;quot;, AJS.$b(fn, this));

            item.onmouseover = GoogieSpell.item_onmouseover;
            item.onmouseout = GoogieSpell.item_onmouseout;
            row.appendChild(item);
            list.appendChild(row);
        }

        //The element is changed, append the revert
        if(elm.is_changed &amp;amp;&amp;amp; elm.innerHTML != elm.old_value) {
            var old_value = elm.old_value;
            var revert_row = AJS.TR();
            var revert = AJS.TD();

            revert.onmouseover = GoogieSpell.item_onmouseover;
            revert.onmouseout = GoogieSpell.item_onmouseout;
            var rev_span = AJS.SPAN({'class': 'googie_list_revert'});
            rev_span.innerHTML = this.lang_revert + &amp;quot; &amp;quot; + old_value;
            revert.appendChild(rev_span);

            var fn = function(e) { 
                this.updateOrginalText(offset, elm.innerHTML, old_value, id);
                elm.is_corrected = true;
                elm.style.color = &amp;quot;#b91414&amp;quot;;
                elm.innerHTML = old_value;
                this.hideErrorWindow();
            };
            AJS.AEV(revert, &amp;quot;click&amp;quot;, AJS.$b(fn, this));

            revert_row.appendChild(revert);
            list.appendChild(revert_row);
        }
        
        //Append the edit box
        var edit_row = AJS.TR();
        var edit = AJS.TD({'style': 'cursor: default'});

        var edit_input = AJS.INPUT({'style': 'width: 120px; margin:0; padding:0', 'value': elm.innerHTML});
        edit_input.googie_action_btn = &amp;quot;1&amp;quot;;

        var onsub = function () {
            if(edit_input.value != &amp;quot;&amp;quot;) {
                if(!AJS.isDefined(elm.old_value))
                    this.saveOldValue(elm, elm.innerHTML);

                this.updateOrginalText(offset, elm.innerHTML, edit_input.value, id);
                elm.style.color = &amp;quot;green&amp;quot;
                elm.is_corrected = true;
                elm.innerHTML = edit_input.value;
                
                this.hideErrorWindow();
            }
            return false;
        };
        onsub = AJS.$b(onsub, this);
        
		var ok_pic = AJS.IMG({'src': '/common/images/' + &amp;quot;ok.gif&amp;quot;, 'style': 'width: 32px; height: 16px; margin-left: 2px; margin-right: 2px; cursor: pointer;'});
        //var ok_pic = AJS.IMG({'src': this.img_dir + &amp;quot;ok.gif&amp;quot;, 'style': 'width: 32px; height: 16px; margin-left: 2px; margin-right: 2px; cursor: pointer;'});
        var edit_form = AJS.FORM({'style': 'margin: 0; padding: 0; cursor: default;'}, edit_input, ok_pic);

        edit_form.googie_action_btn = &amp;quot;1&amp;quot;;
        edit.googie_action_btn = &amp;quot;1&amp;quot;;

        AJS.AEV(edit_form, &amp;quot;submit&amp;quot;, onsub);
        AJS.AEV(ok_pic, &amp;quot;click&amp;quot;, onsub);
        
        edit.appendChild(edit_form);
        edit_row.appendChild(edit);
        list.appendChild(edit_row);

        //Append extra menu items
        if(this.extra_menu_items.length &amp;gt; 0)
            AJS.ACN(list, this.createListSeparator());

        var loop = function(i) {
                if(i &amp;lt; me.extra_menu_items.length) {
                    var e_elm = me.extra_menu_items[i];

                    if(!e_elm[2] || e_elm[2](elm, me)) {
                        var e_row = AJS.TR();
                        var e_col = AJS.TD(e_elm[0]);

                        e_col.onmouseover = GoogieSpell.item_onmouseover;
                        e_col.onmouseout = GoogieSpell.item_onmouseout;

                        var fn = function() {
                            return e_elm[1](elm, me);
                        };
                        AJS.AEV(e_col, &amp;quot;click&amp;quot;, fn);

                        AJS.ACN(e_row, e_col);
                        AJS.ACN(list, e_row);

                    }
                    loop(i+1);
                }
        }
        loop(0);
        loop = null;

        //Close button
        if(this.use_close_btn) {
            AJS.ACN(list, this.createCloseButton(this.hideErrorWindow));
        }
    }

    table.appendChild(list);
    this.error_window.appendChild(table);

    //Dummy for IE - dropdown bug fix
    if(AJS.isIe() &amp;amp;&amp;amp; !this.error_window_iframe) {
        var iframe = AJS.IFRAME({'style': 'position: absolute; z-index: 0;'});
        AJS.ACN(AJS.getBody(), iframe);
        this.error_window_iframe = iframe;
    }
    if(AJS.isIe()) {
        var iframe = this.error_window_iframe;
        AJS.setTop(iframe, this.error_window.offsetTop);
        AJS.setLeft(iframe, this.error_window.offsetLeft);

        AJS.setWidth(iframe, this.error_window.offsetWidth);
        AJS.setHeight(iframe, this.error_window.offsetHeight);

        iframe.style.visibility = &amp;quot;visible&amp;quot;;
    }

    //Set focus on the last element
    var link = this.createFocusLink('link');
    list.appendChild(AJS.TR(AJS.TD({'style': 'text-align: right; font-size: 1px; height: 1px; margin: 0; padding: 0;'}, link)));
    link.focus();
}


//////
// Edit layer (the layer where the suggestions are stored)
//////
GoogieSpell.prototype.createEditLayer = function(width, height) {
    this.edit_layer = AJS.DIV({'class': 'googie_edit_layer'});

    //Set the style so it looks like edit areas
    this.edit_layer.className = this.text_area.className;
    this.edit_layer.style.border = &amp;quot;1px solid #999&amp;quot;;
    this.edit_layer.style.backgroundColor = &amp;quot;#f7f7f7&amp;quot;;
    this.edit_layer.style.padding = &amp;quot;3px&amp;quot;;
    this.edit_layer.style.margin = &amp;quot;0px&amp;quot;;

    AJS.setWidth(this.edit_layer, (width-8));

    if(AJS.nodeName(this.text_area) != &amp;quot;input&amp;quot; || this.getValue(this.text_area) == &amp;quot;&amp;quot;) {
        this.edit_layer.style.overflow = &amp;quot;auto&amp;quot;;
        AJS.setHeight(this.edit_layer, (height-6));
    }
    else {
        this.edit_layer.style.overflow = &amp;quot;hidden&amp;quot;;
    }

    if(this.edit_layer_dbl_click) {
        var me = this;
        var fn = function(e) {
            if(AJS.getEventElm(e).className != &amp;quot;googie_link&amp;quot; &amp;amp;&amp;amp; !me.isErrorWindowShown()) {
                me.resumeEditing();
                var fn1 = function() {
                    me.text_area.focus();
                    fn1 = null;
                };
                AJS.callLater(fn1, 10);
            }
            return false;
        };
        this.edit_layer.ondblclick = fn;
        fn = null;
    }
}

GoogieSpell.prototype.resumeEditing = function() {
    this.setStateChanged(&amp;quot;spell_check&amp;quot;);
    this.switch_lan_pic.style.display = &amp;quot;inline&amp;quot;;

    if(this.edit_layer)
        this.el_scroll_top = this.edit_layer.scrollTop;

    this.hideErrorWindow();

    if(this.main_controller)
        this.spell_span.className = &amp;quot;googie_no_style&amp;quot;;

    if(!this.ignore) {
        //Remove the EDIT_LAYER
        try {
            this.edit_layer.parentNode.removeChild(this.edit_layer);
            if(this.use_focus) {
                AJS.removeElement(this.focus_link_t);
                AJS.removeElement(this.focus_link_b);
            }
        }
        catch(e) {
        }

        AJS.showElement(this.text_area);

        if(this.el_scroll_top != undefined)
            this.text_area.scrollTop = this.el_scroll_top;
    }

    this.checkSpellingState(false);
}

GoogieSpell.prototype.createErrorLink = function(text, id) {
    var elm = AJS.SPAN({'class': 'googie_link'});
    var me = this;
    var d = function (e) {
        me.showErrorWindow(elm, id);
        d = null;
        return false;
    };
    AJS.AEV(elm, &amp;quot;click&amp;quot;, d);

    elm.googie_action_btn = &amp;quot;1&amp;quot;;
    elm.g_id = id;
    elm.is_corrected = false;
    elm.oncontextmenu = d;
    elm.innerHTML = text;
    return elm;
}

GoogieSpell.createPart = function(txt_part) {
    if(txt_part == &amp;quot; &amp;quot;)
        return AJS.TN(&amp;quot; &amp;quot;);
    var result = AJS.SPAN();

    var is_first = true;
    var is_safari = (navigator.userAgent.toLowerCase().indexOf(&amp;quot;safari&amp;quot;) != -1);

    var part = AJS.SPAN();
    txt_part = GoogieSpell.escapeSepcial(txt_part);
    txt_part = txt_part.replace(/\n/g, &amp;quot;&amp;lt;br&amp;gt;&amp;quot;);
    txt_part = txt_part.replace(/    /g, &amp;quot; &amp;amp;nbsp;&amp;quot;);
    txt_part = txt_part.replace(/^ /g, &amp;quot;&amp;amp;nbsp;&amp;quot;);
    txt_part = txt_part.replace(/ $/g, &amp;quot;&amp;amp;nbsp;&amp;quot;);
    
    part.innerHTML = txt_part;

    return part;
}

GoogieSpell.prototype.showErrorsInIframe = function() {
    var output = AJS.DIV();
    output.style.textAlign = &amp;quot;left&amp;quot;;
    var pointer = 0;
    var results = this.results;

    if(results.length &amp;gt; 0) {
        for(var i=0; i &amp;lt; results.length; i++) {
            var offset = results[i]['attrs']['o'];
            var len = results[i]['attrs']['l'];
            
            var part_1_text = this.orginal_text.substring(pointer, offset);
            var part_1 = GoogieSpell.createPart(part_1_text);
            output.appendChild(part_1);
            pointer += offset - pointer;
            
            //If the last child was an error, then insert some space
            var err_link = this.createErrorLink(this.orginal_text.substr(offset, len), i);
            this.error_links.push(err_link);
            output.appendChild(err_link);
            pointer += len;
        }
        //Insert the rest of the orginal text
        var part_2_text = this.orginal_text.substr(pointer, this.orginal_text.length);

        var part_2 = GoogieSpell.createPart(part_2_text);
        output.appendChild(part_2);
    }
    else
        output.innerHTML = this.orginal_text;

    var me = this;
    if(this.custom_item_evaulator)
        AJS.map(this.error_links, function(elm){me.custom_item_evaulator(me, elm)});
    
    AJS.ACN(this.edit_layer, output);

    //Hide text area
    this.text_area_bottom = this.text_area.offsetTop + this.text_area.offsetHeight;

    AJS.hideElement(this.text_area);

    AJS.insertBefore(this.edit_layer, this.text_area);

    if(this.use_focus) {
        this.focus_link_t = this.createFocusLink('focus_t');
        this.focus_link_b = this.createFocusLink('focus_b');

        AJS.insertBefore(this.focus_link_t, this.edit_layer);
        AJS.insertAfter(this.focus_link_b, this.edit_layer);
    }

    this.edit_layer.scrollTop = this.ta_scroll_top;
}


//////
// Choose language menu
//////
GoogieSpell.prototype.createLangWindow = function() {
    this.language_window = AJS.DIV({'class': 'googie_window'});
    AJS.setWidth(this.language_window, 100);

    this.language_window.googie_action_btn = &amp;quot;1&amp;quot;;

    //Build up the result list
    var table = AJS.TABLE({'class': 'googie_list'});
    AJS.setWidth(table, &amp;quot;100%&amp;quot;);
    var list = AJS.TBODY();

    this.lang_elms = new Array();

    for(i=0; i &amp;lt; this.langlist_codes.length; i++) {
        var row = AJS.TR();
        var item = AJS.TD();
        item.googieId = this.langlist_codes[i];
        this.lang_elms.push(item);
        var lang_span = AJS.SPAN();
        lang_span.innerHTML = this.lang_to_word[this.langlist_codes[i]];
        item.appendChild(AJS.TN(lang_span.innerHTML));

        var fn = function(e) {
            var elm = AJS.getEventElm(e);
            this.deHighlightCurSel();

            this.setCurrentLanguage(elm.googieId);

            if(this.lang_state_observer != null) {
                this.lang_state_observer();
            }

            this.highlightCurSel();
            this.hideLangWindow();
        };
        AJS.AEV(item, &amp;quot;click&amp;quot;, AJS.$b(fn, this));

        item.onmouseover = function(e) { 
            var i_it = AJS.getEventElm(e);
            if(i_it.className != &amp;quot;googie_list_selected&amp;quot;)
                i_it.className = &amp;quot;googie_list_onhover&amp;quot;;
        };
        item.onmouseout = function(e) { 
            var i_it = AJS.getEventElm(e);
            if(i_it.className != &amp;quot;googie_list_selected&amp;quot;)
                i_it.className = &amp;quot;googie_list_onout&amp;quot;; 
        };

        row.appendChild(item);
        list.appendChild(row);
    }

    //Close button
    if(this.use_close_btn) {
        list.appendChild(this.createCloseButton(this.hideLangWindow));
    }

    this.highlightCurSel();

    table.appendChild(list);
    this.language_window.appendChild(table);
}

GoogieSpell.prototype.setCurrentLanguage = function(lan_code) {
    GOOGIE_CUR_LANG = lan_code;

    //Set cookie
    var now = new Date();
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    ART.create_cookie('language', lan_code, now);
}

GoogieSpell.prototype.isLangWindowShown = function() {
    return this.language_window != null &amp;amp;&amp;amp; this.language_window.style.visibility == &amp;quot;visible&amp;quot;;
}

GoogieSpell.prototype.hideLangWindow = function() {
    try {
        this.language_window.style.visibility = &amp;quot;hidden&amp;quot;;
        this.switch_lan_pic.className = &amp;quot;googie_lang_3d_on&amp;quot;;
    }
    catch(e) {}
}

GoogieSpell.prototype.deHighlightCurSel = function() {
    this.lang_cur_elm.className = &amp;quot;googie_list_onout&amp;quot;;
}

GoogieSpell.prototype.highlightCurSel = function() {
    if(GOOGIE_CUR_LANG == null)
        GOOGIE_CUR_LANG = GOOGIE_DEFAULT_LANG;
    for(var i=0; i &amp;lt; this.lang_elms.length; i++) {
        if(this.lang_elms[i].googieId == GOOGIE_CUR_LANG) {
            this.lang_elms[i].className = &amp;quot;googie_list_selected&amp;quot;;
            this.lang_cur_elm = this.lang_elms[i];
        }
        else {
            this.lang_elms[i].className = &amp;quot;googie_list_onout&amp;quot;;
        }
    }
}

GoogieSpell.prototype.showLangWindow = function(elm, ofst_top, ofst_left) {
    if(this.show_menu_observer)
        this.show_menu_observer(this);
    if(!AJS.isDefined(ofst_top))
        ofst_top = 20;
    if(!AJS.isDefined(ofst_left))
        ofst_left = 100;

    this.createLangWindow();
    AJS.getBody().appendChild(this.language_window);

    var abs_pos = AJS.absolutePosition(elm);
    AJS.showElement(this.language_window);
    AJS.setTop(this.language_window, (abs_pos.y+ofst_top));
    AJS.setLeft(this.language_window, (abs_pos.x+ofst_left-this.language_window.offsetWidth));

    this.highlightCurSel();
    this.language_window.style.visibility = &amp;quot;visible&amp;quot;;
}

GoogieSpell.prototype.createChangeLangPic = function() {
   var img = AJS.IMG({'src': '/common/images/' + 'change_lang.gif', 'alt': &amp;quot;Change language&amp;quot;});
   //var img = AJS.IMG({'src': this.img_dir + 'change_lang.gif', 'alt': &amp;quot;Change language&amp;quot;});
    img.googie_action_btn = &amp;quot;1&amp;quot;;
    var switch_lan = AJS.SPAN({'class': 'googie_lang_3d_on', 'style': 'padding-left: 6px;'}, img);

    var fn = function(e) {
        var elm = AJS.getEventElm(e);
        if(AJS.nodeName(elm) == 'img')
            elm = elm.parentNode;
        if(elm.className == &amp;quot;googie_lang_3d_click&amp;quot;) {
            elm.className = &amp;quot;googie_lang_3d_on&amp;quot;;
            this.hideLangWindow();
        }
        else {
            elm.className = &amp;quot;googie_lang_3d_click&amp;quot;;
            this.showLangWindow(switch_lan);
        }
    }

    AJS.AEV(switch_lan, &amp;quot;click&amp;quot;, AJS.$b(fn, this));
    return switch_lan;
}

GoogieSpell.prototype.createSpellDiv = function() {
    var chk_spell = AJS.SPAN({'class': 'googie_check_spelling_link'});

    chk_spell.innerHTML = this.lang_chck_spell;
    var spell_img = null;
    if(this.show_spell_img)
        spell_img = AJS.IMG({'src': '/common/images/' + &amp;quot;spellc.gif&amp;quot;});
		//spell_img = AJS.IMG({'src': this.img_dir + &amp;quot;spellc.gif&amp;quot;});
    return AJS.SPAN(spell_img, &amp;quot; &amp;quot;, chk_spell);
}


//////
// State functions
/////
GoogieSpell.prototype.flashNoSpellingErrorState = function(on_finish) {
    var no_spell_errors;

    if(on_finish) {
        var fn = function() {
            on_finish();
            this.checkSpellingState();
        };
        no_spell_errors = fn;
    }
    else
        no_spell_errors = this.checkSpellingState;

    this.setStateChanged(&amp;quot;no_error_found&amp;quot;);

    if(this.main_controller) {
        AJS.hideElement(this.switch_lan_pic);

        var dummy = AJS.IMG({'src': this.img_dir + &amp;quot;blank.gif&amp;quot;, 'style': 'height: 16px; width: 1px;'});
        var rsm = AJS.SPAN();
        rsm.innerHTML = this.lang_no_error_found;

        AJS.RCN(this.spell_span, AJS.SPAN(dummy, rsm));

        this.spell_span.className = &amp;quot;googie_check_spelling_ok&amp;quot;;
        this.spell_span.style.textDecoration = &amp;quot;none&amp;quot;;
        this.spell_span.style.cursor = &amp;quot;default&amp;quot;;

        AJS.callLater(AJS.$b(no_spell_errors, this), 1200, [false]);
    }
}

GoogieSpell.prototype.resumeEditingState = function() {
    this.setStateChanged(&amp;quot;resume_editing&amp;quot;);

    //Change link text to resume
    if(this.main_controller) {
        AJS.hideElement(this.switch_lan_pic);
        var dummy = AJS.IMG({'src': this.img_dir + &amp;quot;blank.gif&amp;quot;, 'style': 'height: 16px; width: 1px;'});
        var rsm = AJS.SPAN();
        rsm.innerHTML = this.lang_rsm_edt;
        AJS.RCN(this.spell_span, AJS.SPAN(dummy, rsm));
    
        var fn = function(e) {
            this.resumeEditing();
        }
        this.spell_span.onclick = AJS.$b(fn, this);

        this.spell_span.className = &amp;quot;googie_resume_editing&amp;quot;;
    }

    try { this.edit_layer.scrollTop = this.ta_scroll_top; }
    catch(e) { }
}

GoogieSpell.prototype.checkSpellingState = function(fire) {
    if(!AJS.isDefined(fire) || fire)
        this.setStateChanged(&amp;quot;spell_check&amp;quot;);

    if(this.show_change_lang_pic)
        this.switch_lan_pic = this.createChangeLangPic();
    else
        this.switch_lan_pic = AJS.SPAN();

    var span_chck = this.createSpellDiv();
    var fn = function() {
        this.spellCheck();
    };

    if(this.custom_spellcheck_starter)
        span_chck.onclick = this.custom_spellcheck_starter;
    else {
        span_chck.onclick = AJS.$b(fn, this);
    }

    this.spell_span = span_chck;
    if(this.main_controller) {
        if(this.change_lang_pic_placement == &amp;quot;left&amp;quot;)
            AJS.RCN(this.spell_container, span_chck, &amp;quot; &amp;quot;, this.switch_lan_pic);
        else
            AJS.RCN(this.spell_container, this.switch_lan_pic, &amp;quot; &amp;quot;, span_chck);
    }
}


//////
// Misc. functions
/////
GoogieSpell.item_onmouseover = function(e) {
    var elm = AJS.getEventElm(e);
    if(elm.className != &amp;quot;googie_list_revert&amp;quot; &amp;amp;&amp;amp; elm.className != &amp;quot;googie_list_close&amp;quot;)
        elm.className = &amp;quot;googie_list_onhover&amp;quot;;
    else
        elm.parentNode.className = &amp;quot;googie_list_onhover&amp;quot;;
}
GoogieSpell.item_onmouseout = function(e) {
    var elm = AJS.getEventElm(e);
    if(elm.className != &amp;quot;googie_list_revert&amp;quot; &amp;amp;&amp;amp; elm.className != &amp;quot;googie_list_close&amp;quot;)
        elm.className = &amp;quot;googie_list_onout&amp;quot;;
    else
        elm.parentNode.className = &amp;quot;googie_list_onout&amp;quot;;
}

GoogieSpell.prototype.createCloseButton = function(c_fn) {
    return this.createButton(this.lang_close, 'googie_list_close', AJS.$b(c_fn, this));
}

GoogieSpell.prototype.createButton = function(name, css_class, c_fn) {
    var btn_row = AJS.TR();
    var btn = AJS.TD();

    btn.onmouseover = GoogieSpell.item_onmouseover;
    btn.onmouseout = GoogieSpell.item_onmouseout;

    var spn_btn;
    if(css_class != &amp;quot;&amp;quot;) {
        spn_btn = AJS.SPAN({'class': css_class});
        spn_btn.innerHTML = name;
    }
    else {
        spn_btn = AJS.TN(name);
    }
    btn.appendChild(spn_btn);
    AJS.AEV(btn, &amp;quot;click&amp;quot;, c_fn);
    btn_row.appendChild(btn);

    return btn_row;
}

GoogieSpell.prototype.removeIndicator = function(elm) {
    try { AJS.removeElement(this.indicator); }
    catch(e) {}
}

GoogieSpell.prototype.appendIndicator = function(elm) {
    var img = AJS.IMG({'src': '/common/images/' + 'indicator.gif', 'style': 'margin-right: 5px;'});
	//var img = AJS.IMG({'src': this.img_dir + 'indicator.gif', 'style': 'margin-right: 5px;'});
    AJS.setWidth(img, 16);
    AJS.setHeight(img, 16);
    this.indicator = img;
    img.style.textDecoration = &amp;quot;none&amp;quot;;
    try {
        AJS.insertBefore(img, elm);
    }
    catch(e) {}
}

GoogieSpell.prototype.createFocusLink = function(name) {
    return AJS.A({'href': 'javascript:;', name: name});
}



&amp;lt;!--- CODE FOR FILE AJS.js ---&amp;gt;

/*
Last Modified: 10/09/07 09:52:00

AJS JavaScript library
    A very small library with a lot of functionality
AUTHOR
    4mir Salihefendic (http://amix.dk) - amix@amix.dk
LICENSE
    Copyright (c) 2006 amix. All rights reserved.
    Copyright (c) 2005 Bob Ippolito. All rights reserved.
    http://www.opensource.org/licenses/mit-license.php
VERSION
    4.5
SITE
    http://orangoo.com/AmiNation/AJS
**/
if(!window.AJS) {
var AJS = {
    BASE_URL: &amp;quot;&amp;quot;,
    ajaxErrorHandler: null,

////
// General accessor functions
////
    getQueryArgument: function(var_name) {
        var query = window.location.search.substring(1);
        var vars = query.split(&amp;quot;&amp;amp;&amp;quot;);
        for (var i=0;i&amp;lt;vars.length;i++) {
            var pair = vars[i].split(&amp;quot;=&amp;quot;);
            if (pair[0] == var_name) {
                return pair[1];
            }
        }
        return null;
    },

    _agent: navigator.userAgent.toLowerCase(),
    _agent_version: navigator.productSub,

    isIe: function() {
        return (AJS._agent.indexOf(&amp;quot;msie&amp;quot;) != -1 &amp;amp;&amp;amp; AJS._agent.indexOf(&amp;quot;opera&amp;quot;) == -1);
    },
    isSafari: function(all) {
        if(all)
            return AJS._agent.indexOf(&amp;quot;khtml&amp;quot;);

        return (AJS._agent.indexOf(&amp;quot;khtml&amp;quot;) != -1 &amp;amp;&amp;amp;
                AJS._agent.match(/3\.\d\.\d safari/) == null);
    },
    isOpera: function() {
        return AJS._agent.indexOf(&amp;quot;opera&amp;quot;) != -1;
    },
    isMozilla: function() {
        return (AJS._agent.indexOf(&amp;quot;gecko&amp;quot;) != -1 &amp;amp;&amp;amp; AJS._agent_version &amp;gt;= 20030210);
    },
    isMac: function() {
        return (AJS._agent.indexOf('macintosh') != -1);
    },
    isCamino: function() {
        return (AJS._agent.indexOf(&amp;quot;camino&amp;quot;) != -1);
    },


////
// Array functions
////
    //Shortcut: AJS.$A
    createArray: function(v) {
        if(AJS.isArray(v) &amp;amp;&amp;amp; !AJS.isString(v))
            return v;
        else if(!v)
            return [];
        else
            return [v];
    },

    forceArray: function(args) {
        var r = [];
        AJS.map(args, function(elm) {
            r.push(elm);
        });
        return r;
    },

    join: function(delim, list) {
        try {
            return list.join(delim);
        }
        catch(e) {
            var r = list[0] || '';
            AJS.map(list, function(elm) {
                r += delim + elm;
            }, 1);
            return r + '';
        }
    },

    isIn: function(elm, list) {
        var i = AJS.getIndex(elm, list);
        if(i != -1)
            return true;
        else
            return false;
    },

    getIndex: function(elm, list/*optional*/, eval_fn) {
        for(var i=0; i &amp;lt; list.length; i++)
            if(eval_fn &amp;amp;&amp;amp; eval_fn(list[i]) || elm == list[i])
                return i;
        return -1;
    },

    getFirst: function(list) {
        if(list.length &amp;gt; 0)
            return list[0];
        else
            return null;
    },

    getLast: function(list) {
        if(list.length &amp;gt; 0)
            return list[list.length-1];
        else
            return null;
    },

    update: function(l1, l2) {
        for(var i in l2)
            l1[i] = l2[i];
        return l1;
    },

    flattenList: function(list) {
        var r = [];
        var _flatten = function(r, l) {
            AJS.map(l, function(o) {
                if(o == null) {}
                else if (AJS.isArray(o))
                    _flatten(r, o);
                else
                    r.push(o);
            });
        }
        _flatten(r, list);
        return r;
    },

    //[[elm1, ..., elmN], valX] -&amp;gt; [elm1, ..., elmN, valX]
    flattenElmArguments: function(args) {
        return AJS.flattenList(AJS.forceArray(args));
    },


////
// Functional programming
////
    map: function(list, fn,/*optional*/ start_index, end_index) {
        var i = 0, l = list.length;
        if(start_index)
             i = start_index;
        if(end_index)
             l = end_index;
        for(i; i &amp;lt; l; i++) {
            var val = fn(list[i], i);
            if(val != undefined)
                return val;
        }
    },

    rmap: function(list, fn) {
        var i = list.length-1, l = 0;
        for(i; i &amp;gt;= l; i--) {
            var val = fn.apply(null, [list[i], i]);
            if(val != undefined)
                return val;
        }
    },

    filter: function(list, fn, /*optional*/ start_index, end_index) {
        var r = [];
        AJS.map(list, function(elm) {
            if(fn(elm))
                r.push(elm);
        }, start_index, end_index);
        return r;
    },

    partial: function(fn) {
        var args = AJS.flattenElmArguments(arguments);
        args.shift();
        return function() {
            args = args.concat(AJS.$FA(arguments));
            return fn.apply(window, args);
        }
    },


////
// DOM functions
////

//--- Accessors ----------------------------------------------
    //Shortcut: AJS.$
    getElement: function(id) {
        if(AJS.isString(id) || AJS.isNumber(id))
            return document.getElementById(id);
        else
            return id;
    },

    //Shortcut: AJS.$$
    getElements: function(/*id1, id2, id3*/) {
        var args = AJS.flattenElmArguments(arguments);
        var elements = new Array();
        for (var i = 0; i &amp;lt; args.length; i++) {
            var element = AJS.getElement(args[i]);
            elements.push(element);
        }
        return elements;
    },

    //Shortcut: AJS.$bytc
    getElementsByTagAndClassName: function(tag_name, class_name, /*optional*/ parent, first_match) {
        var class_elements = [];
        if(!AJS.isDefined(parent))
            parent = document;
        if(!AJS.isDefined(tag_name))
            tag_name = '*';

        var els = parent.getElementsByTagName(tag_name);
        var els_len = els.length;
        var pattern = new RegExp(&amp;quot;(^|\\s)&amp;quot; + class_name + &amp;quot;(\\s|$)&amp;quot;);

        for (i = 0, j = 0; i &amp;lt; els_len; i++) {
            if ( pattern.test(els[i].className) || class_name == null ) {
                class_elements[j] = els[i];
                j++;
            }
        }
        if(first_match)
            return class_elements[0];
        else
            return class_elements;
    },

    nodeName: function(elm) {
        return elm.nodeName.toLowerCase();
    },

    _nodeWalk: function(elm, tag_name, class_name, fn_next_elm) {
        var p = fn_next_elm(elm);

        var checkFn;
        if(tag_name &amp;amp;&amp;amp; class_name) {
            checkFn = function(p) {
                return AJS.nodeName(p) == tag_name &amp;amp;&amp;amp; AJS.hasClass(p, class_name);
            }
        }
        else if(tag_name) {
            checkFn = function(p) { return AJS.nodeName(p) == tag_name; }
        }
        else {
            checkFn = function(p) { return AJS.hasClass(p, class_name); }
        }

        if(checkFn(elm))
            return elm;

        while(p) {
            if(checkFn(p))
                return p;
            p = fn_next_elm(p);
        }
        return null;
    },

    //Shortcut: AJS.$gp
    getParentBytc: function(elm, tag_name, class_name) {
        return AJS._nodeWalk(elm, tag_name, class_name, function(m) { if(m) return m.parentNode; });
    },

    //Shortcut: AJS.$gc
    getChildBytc: function(elm, tag_name, class_name) {
        var elms = AJS.$bytc(tag_name, class_name, elm);
        if(elms.length &amp;gt; 0)
            return elms[0];
        else
            return null;
    },

    hasParent: function(elm, parent_to_consider, max_look_up) {
        if(elm == parent_to_consider)
            return true;
        if(max_look_up == 0)
            return false;
        return AJS.hasParent(elm.parentNode, parent_to_consider, max_look_up-1);
    },

    getPreviousSiblingBytc: function(elm, tag_name, class_name) {
        return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.previousSibling; });
    },

    getNextSiblingBytc: function(elm, tag_name, class_name) {
        return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.nextSibling; });
    },

    getBody: function() {
        return AJS.$bytc('body')[0]
    },


//--- Form related ----------------------------------------------
    //Shortcut: AJS.$f
    getFormElement: function(form, name) {
        form = AJS.$(form);
        var r = null;
        AJS.map(form.elements, function(elm) {
            if(elm.name &amp;amp;&amp;amp; elm.name == name)
                r = elm;
        });
        if(r)
            return r;

        AJS.map(AJS.$bytc('select', null, form), function(elm) {
            if(elm.name &amp;amp;&amp;amp; elm.name == name)
                r = elm;
        });
        return r;
    },

    getSelectValue: function(select) {
        var select = AJS.$(select);
        return select.options[select.selectedIndex].value;
    },


//--- DOM related ----------------------------------------------
    //Shortcut: AJS.DI
    documentInsert: function(elm) {
        if(typeof(elm) == 'string')
            elm = AJS.HTML2DOM(elm);
        document.write('&amp;lt;span id=&amp;quot;dummy_holder&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;');
        AJS.swapDOM(AJS.$('dummy_holder'), elm);
    },

    //Shortcut: AJS.ACN
    appendChildNodes: function(elm/*, elms...*/) {
        if(arguments.length &amp;gt;= 2) {
            AJS.map(arguments, function(n) {
                if(AJS.isString(n))
                    n = AJS.TN(n);
                if(AJS.isDefined(n))
                    elm.appendChild(n);
            }, 1);
        }
        return elm;
    },

    appendToTop: function(elm/*, elms...*/) {
        var args = AJS.flattenElmArguments(arguments).slice(1);
        if(args.length &amp;gt;= 1) {
            var first_child = elm.firstChild;
            if(first_child) {
                while(true) {
                    var t_elm = args.shift();
                    if(t_elm)
                        AJS.insertBefore(t_elm, first_child);
                    else
                        break;
                }
            }
            else {
                AJS.ACN.apply(null, arguments);
            }
        }
        return elm;
    },

    //Shortcut: AJS.RCN
    replaceChildNodes: function(elm/*, elms...*/) {
        var child;
        while ((child = elm.firstChild))
            elm.removeChild(child);
        if (arguments.length &amp;lt; 2)
            return elm;
        else
            return AJS.appendChildNodes.apply(null, arguments);
        return elm;
    },

    insertAfter: function(elm, reference_elm) {
        reference_elm.parentNode.insertBefore(elm, reference_elm.nextSibling);
        return elm;
    },

    insertBefore: function(elm, reference_elm) {
        reference_elm.parentNode.insertBefore(elm, reference_elm);
        return elm;
    },

    swapDOM: function(dest, src) {
        dest = AJS.getElement(dest);
        var parent = dest.parentNode;
        if (src) {
            src = AJS.getElement(src);
            parent.replaceChild(src, dest);
        } else {
            parent.removeChild(dest);
        }
        return src;
    },

    removeElement: function(/*elm1, elm2...*/) {
        var args = AJS.flattenElmArguments(arguments);
        try {
            AJS.map(args, function(elm) { 
                if(elm) AJS.swapDOM(elm, null); 
            });
        }
        catch(e) {
        }
    },

    createDOM: function(name, attrs) {
        var i=0, attr;
        var elm = document.createElement(name);

        var first_attr = attrs[0];
        if(AJS.isDict(attrs[i])) {
            for(k in first_attr) {
                attr = first_attr[k];
                if(k == 'style' || k == 's')
                    elm.style.cssText = attr;
                else if(k == 'c' || k == 'class' || k == 'className')
                    elm.className = attr;
                else {
                    elm.setAttribute(k, attr);
                }
            }
            i++;
        }

        if(first_attr == null)
            i = 1;

        for(var j=i; j &amp;lt; attrs.length; j++) {
            var attr = attrs[j];
            if(attr) {
                var type = typeof(attr);
                if(type == 'string' || type == 'number')
                    attr = AJS.TN(attr);
                elm.appendChild(attr);
            }
        }

        return elm;
    },

    _createDomShortcuts: function() {
        var elms = [
                &amp;quot;ul&amp;quot;, &amp;quot;li&amp;quot;, &amp;quot;td&amp;quot;, &amp;quot;tr&amp;quot;, &amp;quot;th&amp;quot;,
                &amp;quot;tbody&amp;quot;, &amp;quot;table&amp;quot;, &amp;quot;input&amp;quot;, &amp;quot;span&amp;quot;, &amp;quot;b&amp;quot;,
                &amp;quot;a&amp;quot;, &amp;quot;div&amp;quot;, &amp;quot;img&amp;quot;, &amp;quot;button&amp;quot;, &amp;quot;h1&amp;quot;,
                &amp;quot;h2&amp;quot;, &amp;quot;h3&amp;quot;, &amp;quot;h4&amp;quot;, &amp;quot;h5&amp;quot;, &amp;quot;h6&amp;quot;, &amp;quot;br&amp;quot;, &amp;quot;textarea&amp;quot;, &amp;quot;form&amp;quot;,
                &amp;quot;p&amp;quot;, &amp;quot;select&amp;quot;, &amp;quot;option&amp;quot;, &amp;quot;optgroup&amp;quot;, &amp;quot;iframe&amp;quot;, &amp;quot;script&amp;quot;,
                &amp;quot;center&amp;quot;, &amp;quot;dl&amp;quot;, &amp;quot;dt&amp;quot;, &amp;quot;dd&amp;quot;, &amp;quot;small&amp;quot;,
                &amp;quot;pre&amp;quot;, 'i', 'label', 'thead'
        ];
        var extends_ajs = function(elm) {
            AJS[elm.toUpperCase()] = function() {
                return AJS.createDOM.apply(null, [elm, arguments]); 
            };
        }
        AJS.map(elms, extends_ajs);
        AJS.TN = function(text) { return document.createTextNode(text) };
    },
    
    setHTML: function(/*elms..., html*/) {
        var args = AJS.flattenElmArguments(arguments);
        var html = args.pop();
        AJS.map(args, function(elm) { 
            if(elm)
                elm.innerHTML = html;
        });
        return args[0];
    },


//--- CSS related ----------------------------------------------
    //Shortcut: AJS.$sv
    setVisibility: function(/*elms..., val*/) {
        var args = AJS.flattenElmArguments(arguments);
        var val = args.pop() &amp;amp;&amp;amp; 'visible' || 'hidden';
        AJS.setStyle(args, 'visibility', val);
    },

    showElement: function(/*elms...*/) {
        AJS.setStyle(AJS.flattenElmArguments(arguments), 'display', 'block');
    },

    hideElement: function(elm) {
        AJS.setStyle(AJS.flattenElmArguments(arguments), 'display', 'none');
    },

    isElementHidden: function(elm) {
        return ((elm.style.display == &amp;quot;none&amp;quot;) || (elm.style.visibility == &amp;quot;hidden&amp;quot;));
    },

    isElementShown: function(elm) {
        return !AJS.isElementHidden(elm);
    },

    setStyle: function(/*elm1, elm2..., {prop: value}*/) {
        var args = AJS.flattenElmArguments(arguments);
        var value = args.pop();
        var num_styles = ['top', 'left', 'right', 'width', 'height'];
        if(AJS.isObject(value)) {
            AJS.map(args, function(elm) { 
                AJS.map(AJS.keys(value), function(prop) {
                    var css_dim = value[prop];
                    if(prop == 'opacity') {
                        AJS.setOpacity(elm, css_dim);
                    }
                    else {
                        if(AJS.isIn(prop, num_styles))
                            css_dim = AJS.isString(css_dim) &amp;amp;&amp;amp; css_dim || css_dim + 'px';

                        elm.style[prop] = css_dim;
                    }
                });
            });
        }
        else {
            var property = args.pop();
            AJS.map(args, function(elm) { 
                if(property == 'opacity') {
                    AJS.setOpacity(elm, value);
                }
                else {
                    if(AJS.isIn(property, num_styles))
                        value = AJS.isString(value) &amp;amp;&amp;amp; value || value + 'px';
                    elm.style[property] = value;
                }
            });
        }
    },

    __cssDim: function(args, property) {
        var args = AJS.$FA(args);
        args.splice(args.length-1, 0, property);
        AJS.setStyle.apply(null, args);
    },

    setWidth: function(/*elm1, elm2..., width*/) { 
        return AJS.__cssDim(arguments, 'width');
    },
    setHeight: function(/*elm1, elm2..., height*/) {
        return AJS.__cssDim(arguments, 'height');
    },
    setLeft: function(/*elm1, elm2..., left*/) {
        return AJS.__cssDim(arguments, 'left');
    },
    setRight: function(/*elm1, elm2..., left*/) {
        return AJS.__cssDim(arguments, 'right');
    },
    setTop: function(/*elm1, elm2..., top*/) {
        return AJS.__cssDim(arguments, 'top');
    },

    setClass: function(/*elm1, elm2..., className*/) {
        var args = AJS.flattenElmArguments(arguments);
        var c = args.pop();
        AJS.map(args, function(elm) { elm.className = c});
    },
    addClass: function(/*elm1, elm2..., className*/) {
        var args = AJS.flattenElmArguments(arguments);
        var cls = args.pop();
        var add_class = function(o) {
            if(!new RegExp(&amp;quot;(^|\\s)&amp;quot; + cls + &amp;quot;(\\s|$)&amp;quot;).test(o.className))
                o.className += (o.className ? &amp;quot; &amp;quot; : &amp;quot;&amp;quot;) + cls;
        };
        AJS.map(args, function(elm) { add_class(elm); });
    },
    hasClass: function(elm, cls) {
        if(!elm || !elm.className)
            return false;
        var e_cls = elm.className;
        return (e_cls.length &amp;gt; 0 &amp;amp;&amp;amp; (e_cls == cls ||
                new RegExp(&amp;quot;(^|\\s)&amp;quot; + cls + &amp;quot;(\\s|$)&amp;quot;).test(e_cls)));
    },
    removeClass: function(/*elm1, elm2..., className*/) {
        var args = AJS.flattenElmArguments(arguments);
        var cls = args.pop();
        var rm_class = function(o) {
            o.className = o.className.replace(new RegExp(&amp;quot;\\s?&amp;quot; + cls, 'g'), &amp;quot;&amp;quot;);
        };
        AJS.map(args, function(elm) { rm_class(elm); });
    },

    setOpacity: function(elm, p) {
        if (p == 1) {
            elm.style.opacity = 1;
            elm.style.filter = &amp;quot;&amp;quot;;
        }
        else {
            elm.style.opacity = p;
            elm.style.filter = &amp;quot;alpha(opacity=&amp;quot;+ p*100 +&amp;quot;)&amp;quot;;
        }
    },


//--- Misc ----------------------------------------------
    HTML2DOM: function(html,/*optional*/ first_child) {
        var d = AJS.DIV();
        d.innerHTML = html;
        if(first_child)
            return d.childNodes[0];
        else
            return d;
    },

    preloadImages: function(/*img_src1, ..., img_srcN*/) {
        AJS.AEV(window, 'load', AJS.$p(function(args) {
            AJS.map(args, function(src) {
                var pic = new Image();
                pic.src = src;
            });
        }, arguments));
    },


////
// Ajax functions
////
    getXMLHttpRequest: function() {
        var try_these = [
            function () { return new XMLHttpRequest(); },
            function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
            function () { return new ActiveXObject('Microsoft.XMLHTTP'); },
            function () { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); },
            function () { throw &amp;quot;Browser does not support XMLHttpRequest&amp;quot;; }
        ];
        for (var i = 0; i &amp;lt; try_these.length; i++) {
            var func = try_these[i];
            try {
                return func();
            } catch (e) {
            }
        }
    },

    getRequest: function(url, data, type) {
        if(!type)
            type = &amp;quot;POST&amp;quot;;
        var req = AJS.getXMLHttpRequest();

        if(url.match(/^https?:\/\//) == null) {
            if(AJS.BASE_URL != '') {
                if(AJS.BASE_URL.lastIndexOf('/') != AJS.BASE_URL.length-1)
                    AJS.BASE_URL += '/';
                url = AJS.BASE_URL + url;
            }
        }

        req.open(type, url, true);
        if(type == &amp;quot;POST&amp;quot;)
            req.setRequestHeader(&amp;quot;Content-type&amp;quot;, &amp;quot;application/x-www-form-urlencoded&amp;quot;);
        return AJS._sendXMLHttpRequest(req);
    },

    serializeJSON: function(o) {
        var objtype = typeof(o);
        if (objtype == &amp;quot;undefined&amp;quot;) {
            return &amp;quot;null&amp;quot;;
        } else if (objtype == &amp;quot;number&amp;quot; || objtype == &amp;quot;boolean&amp;quot;) {
            return o + &amp;quot;&amp;quot;;
        } else if (o === null) {
            return &amp;quot;null&amp;quot;;
        }
        if (objtype == &amp;quot;string&amp;quot;) {
            return AJS._reprString(o);
        }
        if(objtype == 'object' &amp;amp;&amp;amp; o.getFullYear) {
            return AJS._reprDate(o);
        }
        var me = arguments.callee;
        if (objtype != &amp;quot;function&amp;quot; &amp;amp;&amp;amp; typeof(o.length) == &amp;quot;number&amp;quot;) {
            var res = [];
            for (var i = 0; i &amp;lt; o.length; i++) {
                var val = me(o[i]);
                if (typeof(val) != &amp;quot;string&amp;quot;) {
                    val = &amp;quot;undefined&amp;quot;;
                }
                res.push(val);
            }
            return &amp;quot;[&amp;quot; + res.join(&amp;quot;,&amp;quot;) + &amp;quot;]&amp;quot;;
        }
        // it's a function with no adapter, bad
        if (objtype == &amp;quot;function&amp;quot;)
            return null;
        res = [];
        for (var k in o) {
            var useKey;
            if (typeof(k) == &amp;quot;number&amp;quot;) {
                useKey = '&amp;quot;' + k + '&amp;quot;';
            } else if (typeof(k) == &amp;quot;string&amp;quot;) {
                useKey = AJS._reprString(k);
            } else {
                // skip non-string or number keys
                continue;
            }
            val = me(o[k]);
            if (typeof(val) != &amp;quot;string&amp;quot;) {
                // skip non-serializable values
                continue;
            }
            res.push(useKey + &amp;quot;:&amp;quot; + val);
        }
        return &amp;quot;{&amp;quot; + res.join(&amp;quot;,&amp;quot;) + &amp;quot;}&amp;quot;;
    },

    loadJSON: function(url) {
        var d = AJS.getRequest(url);
        var eval_req = function(data, req) {
            var text = req.responseText;
            if(text == &amp;quot;Error&amp;quot;)
                d.errback(req);
            else
                return AJS.evalTxt(text);
        };
        d.addCallback(eval_req);
        return d;
    },

    evalTxt: function(txt) {
        try {
            return eval('('+ txt + ')');
        }
        catch(e) {
            return eval(txt);
        }
    },

    evalScriptTags: function(html) {
        var script_data = html.match(/&amp;lt;script.*?&amp;gt;((\n|\r|.)*?)&amp;lt;\/script&amp;gt;/g);
        if(script_data != null) {
            for(var i=0; i &amp;lt; script_data.length; i++) {
                var script_only = script_data[i].replace(/&amp;lt;script.*?&amp;gt;/g, &amp;quot;&amp;quot;);
                script_only = script_only.replace(/&amp;lt;\/script&amp;gt;/g, &amp;quot;&amp;quot;);
                eval(script_only);
            }
        }
    },

    encodeArguments: function(data) {
        var post_data = [];
        for(k in data)
            post_data.push(k + &amp;quot;=&amp;quot; + AJS.urlencode(data[k]));
        return post_data.join(&amp;quot;&amp;amp;&amp;quot;);
    },

    _sendXMLHttpRequest: function(req, data) {
        var d = new AJSDeferred(req);

        var onreadystatechange = function () {
            if (req.readyState == 4) {
                var status = '';
                try {
                    status = req.status;
                }
                catch(e) {};
                if(status == 200 || status == 304 || req.responseText == null) {
                    d.callback();
                }
                else {
                    if(d.errbacks.length == 0) {
                        if(AJS.ajaxErrorHandler)
                            AJS.ajaxErrorHandler(req.responseText, req);
                    }
                    else 
                        d.errback();
                }
            }
        }
        req.onreadystatechange = onreadystatechange;
        return d;
    },

    _reprString: function(o) {
        return ('&amp;quot;' + o.replace(/([&amp;quot;\\])/g, '\\$1') + '&amp;quot;'
        ).replace(/[\f]/g, &amp;quot;\\f&amp;quot;
        ).replace(/[\b]/g, &amp;quot;\\b&amp;quot;
        ).replace(/[\n]/g, &amp;quot;\\n&amp;quot;
        ).replace(/[\t]/g, &amp;quot;\\t&amp;quot;
        ).replace(/[\r]/g, &amp;quot;\\r&amp;quot;);
    },

    _reprDate: function(db) {
        var year = db.getFullYear();
        var dd = db.getDate();
        var mm = db.getMonth()+1;

        var hh = db.getHours();
        var mins = db.getMinutes();

        function leadingZero(nr) {
            if (nr &amp;lt; 10) nr = &amp;quot;0&amp;quot; + nr;
            return nr;
        }
        if(hh == 24) hh = '00';

        var time = leadingZero(hh) + ':' + leadingZero(mins);
        return '&amp;quot;' + year + '-' + mm + '-' + dd + 'T' + time + '&amp;quot;';
    },


////
// Position and size
////
    getMousePos: function(e) {
        var posx = 0;
        var posy = 0;
        if (!e) var e = window.event;
        if (e.pageX || e.pageY) {
            posx = e.pageX;
            posy = e.pageY;
        }
        else if (e.clientX || e.clientY) {
            posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
            posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
        }
        return {x: posx, y: posy};
    },

    getScrollTop: function() {
        //From: http://www.quirksmode.org/js/doctypes.html
        var t;
        if (document.documentElement &amp;amp;&amp;amp; document.documentElement.scrollTop)
                t = document.documentElement.scrollTop;
        else if (document.body)
                t = document.body.scrollTop;
        return t;
    },

    //Shortcut: AJS.$AP
    absolutePosition: function(elm) {
        if(elm.scrollLeft)
            return {x: elm.scrollLeft, y: elm.scrollTop};
        else if(elm.clientX)
            return {x: elm.clientX, y: elm.clientY};

        var posObj = {'x': elm.offsetLeft, 'y': elm.offsetTop};

        if (elm.offsetParent) {
            var next = elm.offsetParent;
            while(next) {
                posObj.x += next.offsetLeft;
                posObj.y += next.offsetTop;
                next = next.offsetParent;
            }
        }
        // safari bug
        if (AJS.isSafari() &amp;amp;&amp;amp; elm.style.position == 'absolute' ) {
            posObj.x -= document.body.offsetLeft;
            posObj.y -= document.body.offsetTop;
        }
        return posObj;
    },

    getWindowSize: function(doc) {
        doc = doc || document;
        var win_w, win_h;
        if (self.innerHeight) {
            win_w = self.innerWidth;
            win_h = self.innerHeight;
        } else if (doc.documentElement &amp;amp;&amp;amp; doc.documentElement.clientHeight) {
            win_w = doc.documentElement.clientWidth;
            win_h = doc.documentElement.clientHeight;
        } else if (doc.body) {
            win_w = doc.body.clientWidth;
            win_h = doc.body.clientHeight;
        }
        return {'w': win_w, 'h': win_h};
    },

    isOverlapping: function(elm1, elm2) {
        var pos_elm1 = AJS.absolutePosition(elm1);
        var pos_elm2 = AJS.absolutePosition(elm2);

        var top1 = pos_elm1.y;
        var left1 = pos_elm1.x;
        var right1 = left1 + elm1.offsetWidth;
        var bottom1 = top1 + elm1.offsetHeight;
        var top2 = pos_elm2.y;
        var left2 = pos_elm2.x;
        var right2 = left2 + elm2.offsetWidth;
        var bottom2 = top2 + elm2.offsetHeight;
        var getSign = function(v) {
            if(v &amp;gt; 0) return &amp;quot;+&amp;quot;;
            else if(v &amp;lt; 0) return &amp;quot;-&amp;quot;;
            else return 0;
        }

        if ((getSign(top1 - bottom2) != getSign(bottom1 - top2)) &amp;amp;&amp;amp;
                (getSign(left1 - right2) != getSign(right1 - left2)))
            return true;
        return false;
    },


////
// Events
////
    getEventElm: function(e) {
        if(e &amp;amp;&amp;amp; !e.type &amp;amp;&amp;amp; !e.keyCode)
            return e
        var targ;
        if (!e) var e = window.event;
        if (e.target) targ = e.target;
        else if (e.srcElement) targ = e.srcElement;
        if (targ.nodeType == 3) // defeat Safari bug
            targ = targ.parentNode;
        return targ;
    },

    setEventKey: function(e) {
        e.key = e.keyCode ? e.keyCode : e.charCode;

        if(window.event) {
            e.ctrl = window.event.ctrlKey;
            e.shift = window.event.shiftKey;
        }
        else {
            e.ctrl = e.ctrlKey;
            e.shift = e.shiftKey;
        }
        switch(e.key) {
            case 63232:
                e.key = 38;
                break;
            case 63233:
                e.key = 40;
                break;
            case 63235:
                e.key = 39;
                break;
            case 63234:
                e.key = 37;
                break;
        }
    },

    _f_guid: 0,

    //Shortcut: AJS.AEV
    addEventListener: function(elms, type, handler, listen_once) {
        elms = AJS.$A(elms);
        AJS.map(elms, function(elm) {
            if(listen_once)
                handler.listen_once = true;
                
            if (!handler.$f_guid) 
                handler.$f_guid = AJS._f_guid++;

            if (!elm.events) 
                elm.events = {};

            var handlers = elm.events[type];
            if (!handlers) {
                handlers = elm.events[type] = {};

                if(elm[&amp;quot;on&amp;quot; + type])
                    handlers[0] = elm[&amp;quot;on&amp;quot; + type];
            }

            handlers[handler.$f_guid] = handler;
            elm[&amp;quot;on&amp;quot; + type] = AJS.handleEvent;
            elm = null;
        });
    },

    handleEvent: function(event) {
         var me = this;

         event = event || window.event;

         AJS.setEventKey(event);

         var handlers = this.events[event.type];

         var handlers_to_delete = [];
         for (var i in handlers) {
             var handler = this.$$handleEvent = handlers[i];
             this.$$handleEvent(event);
             if(handler.listen_once)
                 handlers_to_delete.push(handler);
         }

        if(handlers_to_delete.length &amp;gt; 0)
            AJS.map(handlers_to_delete, function(handler) {
                delete me.events[event.type][handler.$f_guid];
            });
    },

    //Shortcut: AJS.REV
    removeEventListener: function(elms, type, handler) {
        elms = AJS.$A(elms);
        AJS.map(elms, function(elm) {
            if (elm.events &amp;amp;&amp;amp; elm.events[type]) {
                delete elm.events[type][handler.$f_guid];
            }
        });
    },

    //Shortcut: AJS.$b
    bind: function(fn, scope, /*optional*/ extra_args) {
        fn._cscope = scope;
        return AJS._getRealScope(fn, extra_args);
    },

    bindMethods: function(self) {
        for (var k in self) {
            var func = self[k];
            if (typeof(func) == 'function') {
                self[k] = AJS.$b(func, self);
            }
        }
    },

    preventDefault: function(e) {
        if(AJS.isIe()) 
            window.event.returnValue = false;
        else {
            e.preventDefault();
        }
    },

    _listenOnce: function(elm, type, fn) {
        var r_fn = function() {
            AJS.removeEventListener(elm, type, r_fn);
            fn(arguments);
        }
        return r_fn;
    },
	
	callLater: function(fn, interval) {
        var fn_no_send = function() {
            fn();
        };
        window.setTimeout(fn_no_send, interval);
    },
	
    _getRealScope: function(fn, /*optional*/ extra_args) {
        extra_args = AJS.$A(extra_args);
        var scope = fn._cscope || window;

        return function() {
            try {
                var args = AJS.$FA(arguments).concat(extra_args);
                return fn.apply(scope, args);
            }
            catch(e) {
            }
        };
    },


////
// Misc.
////
    keys: function(obj) {
        var rval = [];
        for (var prop in obj) {
            rval.push(prop);
        }
        return rval;
    },

    values: function(obj) {
        var rval = [];
        for (var prop in obj) {
            rval.push(obj[prop]);
        }
        return rval;
    },

    urlencode: function(str) {
        return encodeURIComponent(str.toString());
    },

    isDefined: function(o) {
        return (o != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; o != null)
    },

    isArray: function(obj) {
        return obj instanceof Array;
    },

    isString: function(obj) {
        return (typeof obj == 'string');
    },

    isNumber: function(obj) {
        return (typeof obj == 'number');
    },

    isObject: function(obj) {
        return (typeof obj == 'object');
    },

    isFunction: function(obj) {
        return (typeof obj == 'function');
    },

    isDict: function(o) {
        var str_repr = String(o);
        return str_repr.indexOf(&amp;quot; Object&amp;quot;) != -1;
    },

    exportToGlobalScope: function(scope) {
        scope = scope || window;
        for(e in AJS)
            scope[e] = AJS[e];
    },

    withScope: function(export_scope, fn) {
        fn.apply(export_scope, []);
    },

    log: function(o) {
        if(window._firebug)
            window._firebug.log(o);
        else if(window.console)
            console.log(o);
    }
}

AJS.Class = function(members) {
    var fn = function() {
        if(arguments[0] != 'no_init') {
            return this.init.apply(this, arguments);
        }
    }
    fn.prototype = members;
    AJS.update(fn, AJS.Class.prototype);
    return fn;
}
AJS.Class.prototype = {
    extend: function(members) {
        var parent = new this('no_init');
        for(k in members) {
            var prev = parent[k];
            var cur = members[k];
            if (prev &amp;amp;&amp;amp; prev != cur &amp;amp;&amp;amp; typeof cur == 'function') {
                cur = this._parentize(cur, prev);
            }
            parent[k] = cur;
        }
        return new AJS.Class(parent);
    },

    implement: function(members) {
        AJS.update(this.prototype, members);
    },

    _parentize: function(cur, prev) {
        return function(){
            this.parent = prev;
            return cur.apply(this, arguments);
        }
    }
};//End class

//Shortcuts
AJS.$ = AJS.getElement;
AJS.$$ = AJS.getElements;
AJS.$f = AJS.getFormElement;
AJS.$b = AJS.bind;
AJS.$p = AJS.partial;
AJS.$FA = AJS.forceArray;
AJS.$A = AJS.createArray;
AJS.DI = AJS.documentInsert;
AJS.ACN = AJS.appendChildNodes;
AJS.RCN = AJS.replaceChildNodes;
AJS.AEV = AJS.addEventListener;
AJS.REV = AJS.removeEventListener;
AJS.$bytc = AJS.getElementsByTagAndClassName;
AJS.$AP = AJS.absolutePosition;

//Old stuff
AJS.loadJSONDoc = AJS.loadJSON;
AJS.queryArguments = AJS.encodeArguments;
AJS.resetOpacity = function(elm ) { AJS.setOpacity(elm, 1) };

AJS.$gp = AJS.getParentBytc;
AJS.$gc = AJS.getChildBytc;

AJS.$sv = AJS.setVisibility;

AJSDeferred = function(req) {
    this.callbacks = [];
    this.errbacks = [];
    this.req = req;
}
AJSDeferred.prototype = {
    excCallbackSeq: function(req, list) {
        var data = req.responseText;
        while (list.length &amp;gt; 0) {
            var fn = list.pop();
            var new_data = fn(data, req);
            if(new_data)
                data = new_data;
        }
    },

    callback: function () {
        this.excCallbackSeq(this.req, this.callbacks);
    },

    errback: function() {
        if(this.errbacks.length == 0)
            alert(&amp;quot;Error encountered:\n&amp;quot; + this.req.responseText);

        this.excCallbackSeq(this.req, this.errbacks);
    },

    addErrback: function(fn) {
        this.errbacks.unshift(fn);
    },

    addCallback: function(fn) {
        this.callbacks.unshift(fn);
    },

    abort: function() {
        this.req.abort();
    },

    addCallbacks: function(fn1, fn2) {
        this.addCallback(fn1);
        this.addErrback(fn2);
    },

    sendReq: function(data) {
        if(AJS.isObject(data)) {
            this.req.send(AJS.encodeArguments(data));
        }
        else if(AJS.isDefined(data))
            this.req.send(data);
        else {
            this.req.send(&amp;quot;&amp;quot;);
        }
    }
};//End deferred

AJS._createDomShortcuts()

}



&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/Rs0CJkJIjSY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/Rs0CJkJIjSY/cfea62a2-cd40-45a0-a3b0-d48f74a0a2b0.aspx</link>
      <pubDate>Tue, 15 Nov 2011 20:26:54 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/cfea62a2-cd40-45a0-a3b0-d48f74a0a2b0.aspx</feedburner:origLink></item>
    <item>
      <title>test snippet</title>
      <description>Description: pretend description&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/5fd92382-702d-4f81-84e3-bf7d6ae22e79.aspx'&gt;http://www.codekeep.net/snippets/5fd92382-702d-4f81-84e3-bf7d6ae22e79.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;test case&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/hklEuZ0-W9c" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/hklEuZ0-W9c/5fd92382-702d-4f81-84e3-bf7d6ae22e79.aspx</link>
      <pubDate>Tue, 15 Nov 2011 06:49:57 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/5fd92382-702d-4f81-84e3-bf7d6ae22e79.aspx</feedburner:origLink></item>
    <item>
      <title>test snippet</title>
      <description>Description: pretend description&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a0eb10c6-3b20-4b71-bddd-505cfc60245b.aspx'&gt;http://www.codekeep.net/snippets/a0eb10c6-3b20-4b71-bddd-505cfc60245b.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;test case&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/LyJ_shfz5Fk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/LyJ_shfz5Fk/a0eb10c6-3b20-4b71-bddd-505cfc60245b.aspx</link>
      <pubDate>Tue, 15 Nov 2011 06:49:51 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/a0eb10c6-3b20-4b71-bddd-505cfc60245b.aspx</feedburner:origLink></item>
    <item>
      <title>CFSTOREDPROC</title>
      <description>Description: ColdFusion how to call a StoredProcedure using CFSTOREDPROC and CFPROCPARAM.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/53775cc0-5636-4220-9f2b-629ea1f6f631.aspx'&gt;http://www.codekeep.net/snippets/53775cc0-5636-4220-9f2b-629ea1f6f631.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;cfstoredproc procedure=&amp;quot;MySQLProcedure&amp;quot; datasource=&amp;quot;#application.datasource#&amp;quot;&amp;gt;
	&amp;lt;cfprocparam type=&amp;quot;In&amp;quot; cfsqltype=&amp;quot;cf_sql_integer&amp;quot; dbvarname=&amp;quot;@ID&amp;quot; value=&amp;quot;#request.ID#&amp;quot; /&amp;gt;
	&amp;lt;cfprocparam type=&amp;quot;In&amp;quot; cfsqltype=&amp;quot;cf_sql_varchar&amp;quot; dbvarname=&amp;quot;@MyVar&amp;quot; value=&amp;quot;#form.MyVar#&amp;quot; /&amp;gt;
	&amp;lt;cfprocparam type=&amp;quot;In&amp;quot; cfsqltype=&amp;quot;cf_sql_varchar&amp;quot; dbvarname=&amp;quot;@MyNullVar&amp;quot; null=&amp;quot;yes&amp;quot; /&amp;gt;
	&amp;lt;cfprocresult name=&amp;quot;qMyQuery&amp;quot; /&amp;gt;
	&amp;lt;cfprocresult name=&amp;quot;qMyQuery2&amp;quot; resultset=&amp;quot;2&amp;quot; /&amp;gt;
&amp;lt;/cfstoredproc&amp;gt;
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/eEWP_kEhiEY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/eEWP_kEhiEY/53775cc0-5636-4220-9f2b-629ea1f6f631.aspx</link>
      <pubDate>Mon, 07 Nov 2011 19:20:58 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/53775cc0-5636-4220-9f2b-629ea1f6f631.aspx</feedburner:origLink></item>
    <item>
      <title>Make a copy of a file recursively</title>
      <description>Description: Recursively searches for a specific file in a directory tree and makes a .bak copy of it on the same directory.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/00d172a1-ab87-40a7-a94c-68439d455c32.aspx'&gt;http://www.codekeep.net/snippets/00d172a1-ab87-40a7-a94c-68439d455c32.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;find . -type f -name '.classpath' -exec cp {} {}.bak \;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/tCRoiSLG5p8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/tCRoiSLG5p8/00d172a1-ab87-40a7-a94c-68439d455c32.aspx</link>
      <pubDate>Wed, 02 Nov 2011 11:15:27 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/00d172a1-ab87-40a7-a94c-68439d455c32.aspx</feedburner:origLink></item>
    <item>
      <title>Extract .MSI Files</title>
      <description>Description: How to extract .MSI files&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/2f561074-ddbe-4ede-a047-707b42fb0e85.aspx'&gt;http://www.codekeep.net/snippets/2f561074-ddbe-4ede-a047-707b42fb0e85.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;msiexec /a [MsiFile] /qb TARGETDIR=[TargetDirectory]&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/STXpJErKYBQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/STXpJErKYBQ/2f561074-ddbe-4ede-a047-707b42fb0e85.aspx</link>
      <pubDate>Mon, 31 Oct 2011 06:16:16 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/2f561074-ddbe-4ede-a047-707b42fb0e85.aspx</feedburner:origLink></item>
    <item>
      <title>Opera 11 log</title>
      <description>Description: hmm&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/13dc309b-1bb9-4553-bdbd-31c8ca9b8d1f.aspx'&gt;http://www.codekeep.net/snippets/13dc309b-1bb9-4553-bdbd-31c8ca9b8d1f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;src: ddlProductCategory |eventtype: focusin |key: undefined |which: undefined
src: ddlProductCategory |eventtype: keypress |key: 40 |which: 0
src: ddlProductCategory |eventtype: change |key: undefined |which: undefined
CHANGE
src: ddlProductCategory |eventtype: keyup |key: 40 |which: 40
trigger change event from: keyup
src: ddlProductCategory |eventtype: change |key: undefined |which: undefined
CHANGE&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/8Gi7eumqDXY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/8Gi7eumqDXY/13dc309b-1bb9-4553-bdbd-31c8ca9b8d1f.aspx</link>
      <pubDate>Sat, 15 Oct 2011 09:57:46 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/13dc309b-1bb9-4553-bdbd-31c8ca9b8d1f.aspx</feedburner:origLink></item>
    <item>
      <title>view generated html</title>
      <description>Description: View html as generated by javascript.  See what the browser is displaying, not what comes from the server or what you see in view source.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/db83c0f4-ab7e-4336-81e8-3239edccd7f8.aspx'&gt;http://www.codekeep.net/snippets/db83c0f4-ab7e-4336-81e8-3239edccd7f8.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;javascript:'&amp;lt;xmp&amp;gt;' + window.document.body.outerHTML+ '&amp;lt;/xmp&amp;gt;'&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/Lhp43BEioLk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/Lhp43BEioLk/db83c0f4-ab7e-4336-81e8-3239edccd7f8.aspx</link>
      <pubDate>Fri, 14 Oct 2011 23:47:58 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/db83c0f4-ab7e-4336-81e8-3239edccd7f8.aspx</feedburner:origLink></item>
    <item>
      <title>custom error pages</title>
      <description>Description: custom error pages&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/43a398f4-9ac8-4ce1-912b-89ab533b915a.aspx'&gt;http://www.codekeep.net/snippets/43a398f4-9ac8-4ce1-912b-89ab533b915a.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;# custom error pages
ErrorDocument 401 /err/401.php
ErrorDocument 403 /err/403.php
ErrorDocument 404 /err/404.php
ErrorDocument 500 /err/500.php&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/Fs_y4MIYoTk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/Fs_y4MIYoTk/43a398f4-9ac8-4ce1-912b-89ab533b915a.aspx</link>
      <pubDate>Sun, 09 Oct 2011 06:57:43 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/43a398f4-9ac8-4ce1-912b-89ab533b915a.aspx</feedburner:origLink></item>
    <item>
      <title>Deny access to your wp-config.php file</title>
      <description>Description: Deny access to your wp-config.php file.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/3a235cd5-1475-4203-89ac-64385f6480aa.aspx'&gt;http://www.codekeep.net/snippets/3a235cd5-1475-4203-89ac-64385f6480aa.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;# protect wpconfig.php
&amp;lt;files wp-config.php&amp;gt;
order allow,deny
deny from all
&amp;lt;/files&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/Ijvjgu26xEw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/Ijvjgu26xEw/3a235cd5-1475-4203-89ac-64385f6480aa.aspx</link>
      <pubDate>Sun, 09 Oct 2011 06:56:37 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/3a235cd5-1475-4203-89ac-64385f6480aa.aspx</feedburner:origLink></item>
    <item>
      <title>Redirect www to non www or vice versa</title>
      <description>Description: Redirect www to non www or vice versa&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/4f8e28ef-7ae7-41dd-8a3a-7b32c88a9105.aspx'&gt;http://www.codekeep.net/snippets/4f8e28ef-7ae7-41dd-8a3a-7b32c88a9105.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourblogname.com [NC]
RewriteRule ^(.*)$ http://yourblogname.com/$1 [L,R=301]

or

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourblogname.com [NC]
RewriteRule ^(.*)$ http://www.yourblogname.com/$1 [L,R=301]&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/NZzmBGq6a3c" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/NZzmBGq6a3c/4f8e28ef-7ae7-41dd-8a3a-7b32c88a9105.aspx</link>
      <pubDate>Sun, 09 Oct 2011 06:54:51 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/4f8e28ef-7ae7-41dd-8a3a-7b32c88a9105.aspx</feedburner:origLink></item>
    <item>
      <title>iconv multiple files re-encoding script</title>
      <description>Description: Re-encoding or transcoding files with iconv&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/8816577b-88de-41b1-bb4c-52de343cc3a2.aspx'&gt;http://www.codekeep.net/snippets/8816577b-88de-41b1-bb4c-52de343cc3a2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;#!/bin/bash
#ejemplo en 1 linea. 
# for f in *.Q34 ; do mv      &amp;quot;$f&amp;quot; &amp;quot;${f%.Q34}.bak&amp;quot; ; done  # abc.Q34 -&amp;gt; abc.bak
# for f in *.xls ; do mv      &amp;quot;$f&amp;quot; &amp;quot;$f.bak&amp;quot;        ; done  # abc.Q34 -&amp;gt; abc.Q34.bak

FROMM=CP1252
TOO=IBM850
for f in *.Q34
do
	#cp --verbose &amp;quot;$f&amp;quot; &amp;quot;${f%.Q34}.bak&amp;quot;
	#iconv -f $FROMM -t $TOO &amp;quot;${f%.Q34}.bak&amp;quot; &amp;gt; &amp;quot;$f&amp;quot;
	
	echo &amp;quot;executing: iconv -f $FROMM -t $TOO $f &amp;gt; $f.$TOO&amp;quot;
	iconv -f $FROMM -t $TOO $f &amp;gt; $f.$TOO
done

&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/9eAZt8lb3Ug" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/9eAZt8lb3Ug/8816577b-88de-41b1-bb4c-52de343cc3a2.aspx</link>
      <pubDate>Tue, 26 Jul 2011 08:57:53 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/8816577b-88de-41b1-bb4c-52de343cc3a2.aspx</feedburner:origLink></item>
    <item>
      <title>Regex to Validate an IP Address</title>
      <description>Description: Covers 1.0.0.0 to 255.255.255.255&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/cec8f11d-ae38-4e98-93d6-0242ea1fbe0a.aspx'&gt;http://www.codekeep.net/snippets/cec8f11d-ae38-4e98-93d6-0242ea1fbe0a.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/jn0Bwz7nggA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/jn0Bwz7nggA/cec8f11d-ae38-4e98-93d6-0242ea1fbe0a.aspx</link>
      <pubDate>Mon, 18 Apr 2011 10:54:03 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/cec8f11d-ae38-4e98-93d6-0242ea1fbe0a.aspx</feedburner:origLink></item>
    <item>
      <title>xjc script to generate bindings for all files in directory</title>
      <description>Description: Shell script to generate java binding classes for all XSD files in directory with JAXB's XJC&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/bafa3cb4-3faa-40d0-a967-52a9cd7ec3b2.aspx'&gt;http://www.codekeep.net/snippets/bafa3cb4-3faa-40d0-a967-52a9cd7ec3b2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;#!/bin/sh
# Run piped to tee to output both to file and console.
if [ $# -ne 2 -o ! -d $1 ]

	then
		 echo &amp;quot;Usage: $0 OUTPUT_DIRECTORY BASE_PACKAGE&amp;quot;
		 echo &amp;quot;     Current directory contains XSD files. OUTPUT_DIRECTORY exists and is writable.&amp;quot;
		 exit 1
	else
		XJC_HOME=&amp;quot;c:/java/jboss-5.1.0.GA/lib&amp;quot;	
		for f in *.xsd
		do		
			PKG=$(echo &amp;quot;${f%.xsd}&amp;quot; | tr '[:upper:]' '[:lower:]')
			echo
			echo &amp;quot;*** Executing: java -jar $XJC_HOME/jaxb-xjc.jar -d $1 -p $2.$PKG $f&amp;quot;
			java -jar $XJC_HOME/jaxb-xjc.jar -d $1 -p $2.$PKG $f
		done	
fi&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/tnVgd2Nrj00" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/tnVgd2Nrj00/bafa3cb4-3faa-40d0-a967-52a9cd7ec3b2.aspx</link>
      <pubDate>Fri, 15 Apr 2011 07:24:16 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/bafa3cb4-3faa-40d0-a967-52a9cd7ec3b2.aspx</feedburner:origLink></item>
    <item>
      <title>Delete matching lines from files shell script (sed)</title>
      <description>Description: Shell script to delete matching lines from certain files in a directory with find and sed.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c132681a-8aff-4170-a4b7-80c22f254595.aspx'&gt;http://www.codekeep.net/snippets/c132681a-8aff-4170-a4b7-80c22f254595.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;find . -type f -name \*.scc -exec rm -fv {} \;
find . -type f -name \*.java -exec grep -l &amp;quot;@jboss.invoker&amp;quot; {} +

sed -i.bak /@jboss.invoker/d *.java
find /home/user -iname index.php -exec sed -i s/&amp;lt;string to find&amp;gt;/&amp;lt;string to replace with&amp;gt;/ {} \;

find . -type f -name \*.java -exec sed -i.bak /@jboss.invoker/d {} \;

#SIMULACION
for file_name in `find . -type f -name \*.java.bak`; do echo &amp;quot;The file:&amp;quot; $file_name; new_file_name=$(echo $file_name | sed 's/.java.bak/.java/g'); echo &amp;quot;New name:&amp;quot; $new_file_name ; done

#EJECUCION REAL
for file_name in `find . -type f -name \*.java.bak`; do echo &amp;quot;OLD:&amp;quot; $file_name; new_file_name=$(echo $file_name | sed 's/.java.bak/.java/g'); echo &amp;quot;NEW:&amp;quot; $new_file_name ; mv -v $file_name $new_file_name; done&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepOther/~4/MAPZUGYPX6o" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepOther/~3/MAPZUGYPX6o/c132681a-8aff-4170-a4b7-80c22f254595.aspx</link>
      <pubDate>Fri, 15 Apr 2011 07:19:26 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/c132681a-8aff-4170-a4b7-80c22f254595.aspx</feedburner:origLink></item>
  </channel>
</rss>

