/*****************************
* ¿À´Ã¹è¿î´Ü¾îº¹½À (CONTROL BOX 3,4)
****************************************************************/

var NextQ = 0;

function begin(QN){
NextQ = NextQ + QN
if (todaydefeng[NextQ] == null) {
	NextQ = 0;
	document.shorttodayword.qbox.value='¼ö°íÇÏ¼Ì½À´Ï´Ù. Á¾·áµÇ¾ú½À´Ï´Ù';
	}else{
	document.shorttodayword.ans.value='';
	document.shorttodayword.qbox.value=todaydefeng[NextQ];
}
}


var NTry = 0;
var NCorrect = 0;
function Entertodayword(){
	input= shorttodayword.guess.value
	//	input= prompt("todayword:","")
	var Capinput = input.toUpperCase()
	var CapTarget = todayword[NextQ].toUpperCase()
	NTry++
	document.shorttodayword.guess.value= input
//KMLee,	if (todayword[NextQ]==Capinput){
	if (CapTarget==Capinput){
		document.shorttodayword.ans.value= '¸Â¾Ò½À´Ï´Ù.'
		NCorrect++
		document.shorttodayword.correct.value = NCorrect;
	} 
	else {
		document.shorttodayword.ans.value='Æ²·È½À´Ï´Ù. ´Ù½Ã ÇØº¾½Ã´Ù.';
	}
document.shorttodayword.tries.value = NTry;
}
function Emptyans(){
	document.shorttodayword.ans.value='';
	document.shorttodayword.guess.value='';
}

//--- ÀÎ½ÄÈÆ·Ã ºÎºÐ ½ÃÀÛ-----------------------
var Target=""
var OK=0;
var Tryt=0;
var NextwQ = 0;
var QN = 0;

function PopIt(label, msg)
{
if (todayword[NextwQ] == null) {
}else{
  // Set up Page Colors & Table
  var s1 =
    "<TITLE>ÀÎ½ÄÈÆ·Ã</TITLE>" +
    "<BODY BGCOLOR='white'><TABLE BORDER=0><TR>" +
        "<TD WIDTH=100% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
        "<FONT size=4>"
  	// Emphasize Label
  	var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>"
  	// Create a Close Button and Finish Table
 	 var s3 =
    	"</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
    	"<TD VALIGN=TOP ALIGN=RIGHT>"+
   	"</FORM></TD></TR></TABLE></BODY>"
  // Create the Window
  popup = window.open("","popDialog","height=150,width=300,scrollbars=no")
  popup.document.write(s1+s2+msg+s3);
  timeout=setTimeout('popup.close()',1000)
  popup.document.close()
}
}
function doW(QN) {
NextwQ = NextwQ + QN
//Try ++
if (todayword[NextwQ] == null) {
	alert("¼ö°íÇÏ¼Ì½À´Ï´Ù.")
	NextwQ = 0;
	}else
	wipe();
	PopIt('', todayword[NextwQ]);
	Target= todayword[NextwQ];
}
function wipe(){
	document.productword.fb.value=""
}

function Check(){
	Tryt ++
	var Input= productword.guess.value;
	var CapInput = Input.toUpperCase()
	var CapTarget = Target.toUpperCase()
	var Feedback_Wrong= '¾Æ´Õ´Ï´Ù. \"' + Target + '\" ÀÔ´Ï´Ù ' + Input;
	document.productword.tr.value = Tryt;	
//KMLee,	if (Target==CapInput){
	if (CapTarget==CapInput){
		document.productword.fb.value='¸Â¾Ò½À´Ï´Ù.';
		OK++
		document.productword.ok.value = OK;
	} 
	else {
		document.productword.fb.value=Feedback_Wrong
	}
}


/*************************************
* Print-friendly page for wordentrytable 
***********************************************/
function Clickheretoprint()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_vlue = document.getElementById("print_content").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>¿öµå¸ÞÀÏ ¿À´ÃÀÇ ´Ü¾î</title>'); 
   docprint.document.write('<style type="text/css">body{font-size: 12px; font-family: ±¼¸²; text-align: left;}');
   docprint.document.write('.wnt{margin-left:10px; font-weight:bold; font-size:14px} a{text-decoration:none}.showstate{display:none} .switchcontent{display:none}</style>'); 
   docprint.document.write('<script type="text/javascript"></script>'); 
   docprint.document.write('</head><body onLoad="self.print()">');          
   docprint.document.write(content_vlue);          
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}


/***********************************************
* Cool DHTML tooltip script II- ¨Ï Dynamic Drive DHTML code library (www.dynamicdrive.com)
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="http://www.wordnote.org/x/modules/wm_module/images/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip


/*********************
*menulink class
******************/

var ns4class=''


/************
*DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
*Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm
**********************************************/

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
document.getElementById("dwindow").style.left="30px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
document.getElementById("cframe").src=url
}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra
}



/***********************************************
* Highlight Table Cells Script- ¨Ï Dynamic Drive DHTML code library (www.dynamicdrive.com)
***********************************************/

//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TD"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TABLE")
return
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}


/***********************************************
* DHTML Ticker script- ¨Ï Dynamic Drive (www.dynamicdrive.com)
***********************************************/

function domticker(content, divId, divClass, delay, fadeornot){
this.content=content
this.tickerid=divId //ID of master ticker div. Message is contained inside first child of ticker div
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
this.pointer=1
this.opacitystring=(typeof fadeornot!="undefined")? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
if (this.opacitystring!="") this.delay+=500 //add 1/2 sec to account for fade effect, if enabled
this.opacitysetting=0.2 //Opacity value when reset. Internal use.
document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'">'+content[0]+'</div></div>')
var instanceOfTicker=this
setTimeout(function(){instanceOfTicker.initialize()}, delay)
}

domticker.prototype.initialize=function(){
var instanceOfTicker=this
this.contentdiv=document.getElementById(this.tickerid).firstChild //div of inner content that holds the messages
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
this.rotatemsg()
}

domticker.prototype.rotatemsg=function(){
var instanceOfTicker=this
if (this.mouseoverBol==1) //if mouse is currently over ticker, do nothing (pause it)
setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
else{
this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
this.contentdiv.innerHTML=this.content[this.pointer]
this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) //FADE EFFECT- PLAY IT
this.pointer=(this.pointer<this.content.length-1)? this.pointer+1 : 0
setTimeout(function(){instanceOfTicker.rotatemsg()}, this.delay) //update container
}
}

/*********
* fadetransition()- cross browser fade method for IE5.5+ and Mozilla/Firefox
***********************************************/

domticker.prototype.fadetransition=function(fadetype, timerid){
var contentdiv=this.contentdiv
if (fadetype=="reset")
this.opacitysetting=0.2
if (contentdiv.filters && contentdiv.filters[0]){
if (typeof contentdiv.filters[0].opacity=="number") //IE6+
contentdiv.filters[0].opacity=this.opacitysetting*100
else //IE 5.5
contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
}
else if (typeof contentdiv.style.MozOpacity!="undefined" && this.opacitystring!=""){
contentdiv.style.MozOpacity=this.opacitysetting
}
else
this.opacitysetting=1
if (fadetype=="up")
this.opacitysetting+=0.2
if (fadetype=="up" && this.opacitysetting>=1)
clearInterval(this[timerid])
}

/*****************************
*Highlight form element- ¨Ï Dynamic Drive (www.dynamicdrive.com)
**************************************/

var highlightcolor="yellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

//wordnote dic

function wordnotedic(iword)
{
var width = screen.width;
var leftpos = width/2-300;
AnotherWin = window.open('http://wordnote.com/wordlab/cgi-bin/wmwV3?'+iword, 'wordnotedic', 'scrollbars=yes,status=no,titlebar=no,toolbar=no,resizable=1,location=no,menu=no,width=600,height=100,left='+leftpos+',top=0');
AnotherWin.focus();
}


//GreyBox configuration
      //Use animation?
      var GB_ANIMATION = true;
      var GB_IMG_DIR = "http://redtip.net/x/themes/xf_CB_ajax/greybox/";

      //Clicking on the transparent overlay closes the GreyBox window?
      var GB_overlay_click_close = false;

      //Demo change headline - look more in demoiframe
      //$ function is like getElementById
      function changeHeadline(text){
        AJS.getElement('headline').innerHTML = text;
      }

//highlight start

   var startHeight = new Array();
   var effectDone = new Array();
   var original = new Array();
   function toggleEffect(resizetarget, toggleimg, idnum) {
      if ( !effectDone[idnum] ) {
         original[idnum] = $(resizetarget).innerHTML;
         $(resizetarget).innerHTML = "";
         startEffect(resizetarget);
         effectDone[idnum] = true;
         $(toggleimg).src = 'http://redtip.net/x/themes/xf_CB_ajax/up.gif';
         $(toggleimg).alt = 'º¸ÀÌ±â';
      }
      else {
         $(resizetarget).innerHTML = original[idnum];
         resetEffect(resizetarget);
         effectDone[idnum] = false;
         $(toggleimg).src = 'http://redtip.net/x/themes/xf_CB_ajax/down.gif';
         $(toggleimg).alt = '°¨Ãß±â';
      }
   }

   function wordEff(resizetarget, toggleimg, idnum) {
      if ( !effectDone[idnum] ) {
         original[idnum] = $(resizetarget).innerHTML;
         $(resizetarget).innerHTML = "";
         startEffect(resizetarget);
         effectDone[idnum] = true;
         $(toggleimg).src = 'http://redtip.net/x/themes/xf_CB_ajax/white.gif';
         $(toggleimg).alt = 'º¸ÀÌ±â';
      }
      else {
         $(resizetarget).innerHTML = original[idnum];
         resetEffect(resizetarget);
         effectDone[idnum] = false;
         $(toggleimg).src = 'http://redtip.net/x/themes/xf_CB_ajax/red.gif';
         $(toggleimg).alt = '°¨Ãß±â';
      }
   }

   function startEffect(resizetarget) {
      startHeight = $(resizetarget).offsetHeight;
      new Rico.Effect.Size( $(resizetarget), null, 0, 500, 10, {complete:function() {setStatus();}} );
   }

   function setStatus() {
   }

   function resetEffect(resizetarget) {
      $(resizetarget).style.height = startHeight;
   }


//***********************************************
//* Show Hint script- ¨Ï Dynamic Drive (www.dynamicdrive.com)
//***********************************************/

var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox

//***********************************************
//* Switch Content script- ¨Ï Dynamic Drive (www.dynamicdrive.com)
//***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

var contractsymbol='- ' //HTML for contract symbol. For image, use: <img src="whatever.gif">
var expandsymbol='+ ' //HTML for expand symbol.


if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function sweeptoggle(ec){
var thestate=(ec=="expand")? "block" : "none"
var inc=0
while (ccollect[inc]){
ccollect[inc].style.display=thestate
inc++
}
revivestatus()
}


function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(curobj, cid){
var spantags=curobj.getElementsByTagName("SPAN")
var showstateobj=getElementbyClass(spantags, "showstate")
if (ccollect.length>0){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
if (showstateobj.length>0){ //if "showstate" span exists in header
if (collapseprevious=="no")
showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
else
revivestatus()
}
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="block")
statecollect[inc].innerHTML=contractsymbol
else
statecollect[inc].innerHTML=expandsymbol
inc++
}
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && ccollect.length>0){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

//END
