// JavaScript Document

var ckUtil = new CJL_CookieUtil("CurrentCat", 30,"/");

var rowShow=(document.all?'block':'table-row');

var lastcat='';

var lastbgcolor='';

function toggleRows(prefix) {

    var el,i,state;

    for (i=0; el=document.getElementById(prefix+i); i++) {

        state=('none'==el.style.display?1:0);

        el.style.display=(state?rowShow:'none');		

    }

	closelast(lastcat);

	lastcat=prefix;

	lastbgcolor='#D6E238';

	saveFieldToCookie('currentCatLevel',prefix);

}



function closelast(prefix) {

    var el,i,state;

    for (i=0; el=document.getElementById(prefix+i); i++) {

        state=('none'==el.style.display?1:0);

        el.style.display=(state?rowShow:'none');		

    }

}





function bgChange(bg,cid)

{

this.obj = document.getElementById(cid).style;

lastbgcolor=this.obj.backgroundColor;

this.obj.backgroundColor=bg;

}



function outBgChange(cid)

{

var mySelected = ckUtil.getSubValue('selected');

if(mySelected){

	if(mySelected == cid){

		this.obj = document.getElementById(cid).style;

		this.obj.backgroundColor='#D6E238';

	}else{

		this.obj = document.getElementById(cid).style;

		this.obj.backgroundColor='white';

	}

}else{

		this.obj = document.getElementById(cid).style;

		this.obj.backgroundColor='white';

	}



var mycc = ckUtil.getSubValue('currentCatLevel');

if(mycc){	

	if(mycc == cid){

		this.obj = document.getElementById(cid).style;

		this.obj.backgroundColor='#EFDEED';

	}

}

}



/*

function outBgChange(cid)

{

	var ccc = new CJL_CookieUtil("CurrentCat");

	var mySelected = ccc.getSubValue('selected');

	if(mySelected){

		if(mySelected == cid){

			this.obj = document.getElementById(cid).style;

			this.obj.backgroundColor='#D6E238';

		}

	}else{

	var mycc = ccc.getSubValue('currentCatLevel');

	if(mycc){	

		if(mycc == cid){

			this.obj = document.getElementById(cid).style;

			this.obj.backgroundColor='red';

		}

	}else{

		this.obj = document.getElementById(cid).style;

		this.obj.backgroundColor='transparent';

	}

}

*/

//setCookie2

   function setFieldFromCookie(ckId)

   {

	  var cookieVal = ckUtil.getSubValue(ckId);

	  if( cookieVal )

	  {

		 toggleRows(cookieVal);

	  }

	  start();

   }

   

   

   function saveFieldToCookie(fieldId,fieldVal)

   {

	 var aaa = new CJL_CookieUtil("CurrentCat");

	 var lastvalue = aaa.getSubValue(fieldId);

	 if(lastvalue){

	 	this.obj = document.getElementById(lastvalue).style;

		this.obj.backgroundColor='transparent';

	 }

	  ckUtil.setSubValue(fieldId, fieldVal);	  	  

   }

   

   

	function start(){

	 var bbb = new CJL_CookieUtil("CurrentCat");

	 var lastCat = bbb.getSubValue("currentCatLevel");

  if((lastCat)&&(document.getElementById(lastCat))){

	 if(lastCat){

	    toggleRows(lastCat);

	 	this.obj = document.getElementById(lastCat).style;

		this.obj.backgroundColor='#EFDEED';

	 }

	 var lastSel = bbb.getSubValue("selected");

	 if(lastSel){

	 	this.obj = document.getElementById(lastSel).style;

		this.obj.backgroundColor='#D6E238';

	 }

  }

	}


document.write('');
document.write('');

