/*---\\\ EMULATE CF FUNCTIONS ///---*/
	function structKeyExists(obj,key){
		for(x in obj){
			if(x == key)
			return true;
		}
	return false;	
	}
	
	function isDefined(argsVar){
		return (eval('typeof('+argsVar+') != "undefined"'))
	}
	
	function moveOptions(m1,m2,input) {
    	m1len = m1.length ;
		m2len = m2.length ;
	
		if(input == "right"){
    		for ( i=0; i<m1len ; i++){
        		if (m1.options[i].selected == true ) {
            		m2.options[m2len]= new Option(m1.options[i].text);
					m2.options[m2len].value = m1.options[i].value;
					m2.options[m2len].selected = true;
        		}
    		}
    		for ( i = (m1len -1); i>=0; i--){
        		if (m1.options[i].selected == true ) {
            		m1.options[i] = null;
        		}
    		}
		}
		else if(input == "left"){
        	for ( i=0; i<m2len ; i++){
            	if (m2.options[i].selected == true ) {
                	m1.options[m1len]= new Option(m2.options[i].text);
                	m1.options[m1len].value= m2.options[i].value;
            	}
        	}
        	for ( i=(m2len-1); i>=0; i--) {
            	if (m2.options[i].selected == true ) {
                	m2.options[i] = null;
            	}
        	}
		}
	}
	
	function acValidate(ename,eid,ary){
		var aryel	= ename.value.split("<");
		count	= 0;
		for(i=0;i<ary.length; i++)
			if(ary[i] == ename.value)
				count++;
		if(!count)
			ename.value	= "";
		else if(aryel.length > 1)
			eid.value	= aryel[1].replace('>','');
		ename.value	= aryel[0];
	}
	
	function selectRow(myId, isInRow, class1,class2, class3) {
  		// myId is our own integer id, not the DOM id
  		// isInRow is 1 for onmouseover, 0 for onmouseout
  		var row = document.getElementById("tr"+myId);
		if(isInRow) 
			row.className = class3;
		else
			if(myId % 2)
  				row.className = class1;
			else
  				row.className = class2;
  	}
	
	function showAccordion(input,list,name){
		var arytabs	= list.split(",");
		for(i=0; i<arytabs.length; i++)
			document.getElementById(name+arytabs[i]).style.display = "none";
		document.getElementById(name+input).style.display = "block";				
	}		
		
/*---\\\ EMULATE CF FUNCTIONS ///---*/
	function IsNumeric(input){
		var numlist	= "1234567890.";
		var aryinput	= input.split("");
		count	= 0;
		for(i=0; i<aryinput.length; i++)
			if(numlist.indexOf(aryinput[i]) == -1){
				count++;
				break;
			}
		if(count == 0)
			return true;
		else
			return false;
	}
	
/*---\\\ EMULATE CF FUNCTIONS ///---*/
	function IsInteger(input){
		var numlist	= "1234567890";
		var aryinput	= input.split("");
		count	= 0;
		for(i=0; i<aryinput.length; i++)
			if(numlist.indexOf(aryinput[i]) == -1){
				count++;
				break;
			}
		if(count == 0)
			return true;
		else
			return false;
	}
	
	function toggle(div){
		if(document.getElementById(div).style.display == "none")
			document.getElementById(div).style.display = "inline";
		else
			document.getElementById(div).style.display = "none";
	}	
	
	function widgetToggle(div){
		if(document.getElementById(div).style.display == "none"){
			document.getElementById(div).style.display = "inline";
			document.getElementById(div).src = "images/arrow_up.gif";
		}
		else{
			document.getElementById(div).style.display = "none";
			document.getElementById(div).src = "images/arrow_down.gif";
		}
	}	

	function numberformat(input){
		var thisstr	= "" + Math.round(input*100)/100;
		dot	= thisstr.lastIndexOf('.');
		if(dot == -1)
			return input + '.00'
		else if(thisstr.length - dot == 2)
			return thisstr + '0'
		else
			return thisstr				
	}
		
	function showLayer(div){
		var screenWidth = document.body.clientWidth;
		document.getElementById(div).style.width	= "780px";
		document.getElementById(div).style.height	= "90%";
		document.getElementById(div).style.left		= 100*((screenWidth - 780)/2)/screenWidth + "%";
		document.getElementById(div).style.top		= "50px";	
	}
	
	function runSlideShow() {
		if (document.all) {
			document.images.SlideShow.style.filter="blendTrans(duration=2)";
			document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
			document.images.SlideShow.filters.blendTrans.Apply();
		}
		document.images.SlideShow.src = preLoad[j].src;
		if (document.all) {
			document.images.SlideShow.filters.blendTrans.Play();
		}
		j = j + 1;
		if (j > (p - 1)) j = 0;
			t = setTimeout('runSlideShow()', slideShowSpeed);
	}