
 
	var oldsel=[];	
	var lenchcolor1=[];
	var lenchcolor2=[];
	var lenchcolor3=[];
	
 	lenchcolor1['UTtab_']='tabh_itemoff';
	lenchcolor2['UTtab_']='tabh_itemon';
	lenchcolor3['UTtab_']='tabh_itemoff';
	oldsel['UTtab_']=0;
	
	function reqLenFunc(otype,oele,oid,ocode){
		
		var jsTRid;
		jsTRid=ocode+oldsel[ocode];
		if(otype=='over' && oele.id!=jsTRid){
			oele.className=lenchcolor1[ocode];
		}
		
		if(otype=='out' && oele.id!=jsTRid){
			oele.className=lenchcolor2[ocode];
		}
		
		if(otype=='click' && oele.id!=jsTRid){			
				
			if(document.getElementById(jsTRid))
				document.getElementById(jsTRid).className=lenchcolor2[ocode];				
			
			
			oldsel[ocode]=oid;			
			oele.className=lenchcolor3[ocode];			
		}		
	}
	

	/*    Functions for tab control    */
	
	function TabToggle(root,index)
{
    var child;
    var node = document.getElementById(root);
    var children = node.childNodes;
    var counter = 0;

    for(var i = 0; i < children.length; i++)
    {
        child = children[i];
        
        if (child.style == null)
        {
            continue;
        }
        if (counter != index-1)
        {
            child.style.display = "none";
            counter++;
        }
        else
        {
            child.style.display = "block";
            counter++
        }
    }
   
}

	function ajaxpage(url,containerid)
	{
		var page_request = false
		if (window.XMLHttpRequest) // if Mozilla, Safari etc
			page_request = new XMLHttpRequest() 
		else if (window.ActiveXObject) { // if IE 
			try { page_request = new ActiveXObject("Msxml2.XMLHTTP") } 
			catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP") }
				catch (e){}
			}
		}	
		else return false; 
		page_request.onreadystatechange = function() 
		{
			document.getElementById(containerid).innerHTML = "<div align=center style=margin-top:30px;><img width=18 align=absmiddle src='images/loading.gif' hspace=10> Loading ...</div>";
			loadpage(page_request, containerid);
		}
	
		page_request.open('GET', url+"&"+new Date().getTime(),true);
		page_request.send(null);
	}
	
	function loadpage(page_request, containerid) 
	{
		if (page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == -1)) 
		{
			document.getElementById(containerid).innerHTML = page_request.responseText;
		}
	}
	
	var menulistclick=[];
	var menuChildlistclick=[];
	var menuChildlistclick2=[];
	
	function transmenuClick(oele,ocode){

		if(!menulistclick[ocode])
			menulistclick[ocode]='';
		if(oele){
			if(document.getElementById(menulistclick[ocode].id)){
				if(menulistclick[ocode].className.split('havechild')!=-1)	
					menulistclick[ocode].className="havechild-mainlevel-trans";
				else
					menulistclick[ocode].className="mainlevel-trans";	
			}
			
			if(oele.className.split('havechild')!=-1)	
				oele.className="havechild-mainlevel-active-trans";
			else
				oele.className="mainlevel-active-trans";
			
			
			menulistclick[ocode]=oele;
		}
	}
	
	function transmenuClick2(oele,ocode){
		transmenuClick(oele,ocode)			
	}
	/*      end of Tabcontrol functions 		*/
	
	
	function homeimghide(id, maxi) 
	{ 		
		setTimeout(function(){new Effect.Fade('item'+id.toString(),{}); homeimgshow(id, maxi);  },5000); 
	}
	
	function homeimgshow(id, maxi) { 
		id = (maxi<id+2) ? 0 : id + 1;
		setTimeout(function(){new Effect.Appear('item'+id.toString(),{});  homeimghide(id, maxi); },900);
	}
	
	function scrollable_images(id, maxi){
		
		item_div = document.getElementById('item'+id.toString());
		if (item_div.style.display != 'none'){
			homeimghide(id, maxi);
		}
		else
		{			
			homeimgshow(id, maxi);
		}				
		
	}
	
	var current_image=1;
	
	function image_scroll(type){
		
		var current_image_s = document.getElementById('current_image').innerHTML;
		var max_image_s = document.getElementById('max_image').innerHTML;
	
		var current_image = parseInt(current_image_s);
		var max_image = parseInt(max_image_s);
	
		if (type == 'previuos')
		{
			document.getElementById('image_item'+current_image).style.display = 'none';
			current_image = ( current_image-1<1 ? 1 : current_image-1);
			document.getElementById('image_item'+current_image).style.display = 'block';
			document.getElementById('current_image').innerHTML = current_image;
		}
		else
		{
			document.getElementById('image_item'+current_image).style.display = 'none';
			current_image = ( max_image<current_image+1 ? max_image : current_image+1);
			document.getElementById('image_item'+current_image).style.display = 'block';
			document.getElementById('current_image').innerHTML = current_image;
		}
		
	}