﻿function inText(obj) {
  obj.style.backgroundColor='#FFCCFF';
} 
function outText(obj) {
  obj.style.backgroundColor='#FFFFFF';
} 

function inBar(obj) {
  obj.style.cursor='hand';
  //obj.style.backgroundColor='#FFFFCC';
  obj.style.backgroundColor='#3366FF';
}

function outBar(obj) {
  obj.style.backgroundColor='';
}

function outBar2(obj,color) {
  obj.style.backgroundColor=color;
}

function changeHTCPage (x,n) {
  var e= document.getElementById(x);
  e.onclick(n);
}

var ss=2;
function autoGo(URL) {
	if(ss==-1) return;
 window.sstep.innerHTML="......"+ss;
ss--;
if(ss<0) ss=0;
if(ss==0) {
   try {
    	window.doNext();
	}catch(e) {
    	location.href=URL;
	}
	ss=-1;
}
}

//Highlight form element- c Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="#FFCCFF"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|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
}
}

//ajaxUtil setting 
//obj=object,list=2view array,selAll=option select a item or All,sel=selected
function setList(obj,list,setALL,sel) {
   
  if(setALL!="") {
   			obj.length=1;
    	  obj.options[0].value="";
    	  obj.options[0].text=setALL;	
   } 	  
   if(list!=0)
    for(var i=0;i<list[0].length-1;i++) {
    	  obj.length+=1;
    	  obj.options[obj.length-1].value=list[1][i];
    	  obj.options[obj.length-1].text=list[0][i];
    	  if(list[1][i]==sel.value){
    	  	 obj.selectedIndex=obj.length-1;
    	  	 sel.value="";
				}    	  	 
    	}
}

function setOnlyAllList(obj,setALL) {
				DWRUtil.removeAllOptions(obj);
    	  obj.length=1;
    	  obj.options[0].value="";
    	  obj.options[0].text=setALL;	
}

function setListSelected(obj,sel) {
	for(var i=0;i<obj.length;i++)
	if(obj.options[i].value==sel) {
		obj.selectedIndex=i;
		break;
	}	
}
