//================================================
/*
 * Show/hide all Services
 * Type:	
 * Name:	
 * Date:	2008/12/17
 * @author:	tri do <tridn@von-inc.com>
 */
var flag = false ;
var time2Hide;
function TNShowAllServices(){
	jQuery('.topright .allservices').hover(function(){
		jQuery(this).css('backgroundPosition','right bottom');
		jQuery('#unilinkbox').slideDown(400);
	},
	function(){
		clearTimeout(time2Hide);
		time2Hide = setTimeout(function(){
			jQuery('.allservices').css('backgroundPosition','right top');
			jQuery('#unilinkbox').slideUp(400);		
		},1000);
		
	});
	jQuery('#unilinkbox').hover(function(){
		clearTimeout(time2Hide);
	},
	function(){
		time2Hide = setTimeout(function(){
			jQuery('.allservices').css('backgroundPosition','right top');
			jQuery('#unilinkbox').slideUp('normal');		
		},1000);
		
	});
}
/*
 * Ham thuc hien thay doi icon bo go
 * Type:	onload function
 * Name:	
 * Date:	2008/05/20
 * @author:	Hien Nguyen <hiennh@von-inc.com>
 */
var typing_icon_status = 0;
function typing_change_icon(){
	typing_icon_status++;
	jQuery('.typing_icon').each(function(index)
		{
			jQuery(this).css('background-position', function(){			
			if (typing_icon_status % 2 == 0)
			{
				on_off = 1;
				return 'top';
			}
			else
			{
				on_off = 0;
				return 'bottom';
			}
		})
	});
}//end function
/*
 * Change Tab Search form
 * Type:	
 * Name:	
 * Date:	2008/12/16
 * @author:	Tri Do <tridn@von-inc.com>
 */
function TNchangeTabUnity(tabClass){
	jQuery('.'+tabClass+' .item').bind('click',function(){
		SEARCH_TYPE = jQuery(this).attr('id');
		jQuery('.'+tabClass+' .active').removeClass('active');
		jQuery('.'+tabClass+' .prev').removeClass('prev');
		jQuery(this).addClass('active');
		jQuery(this).prev().addClass('prev')
		return false;
	});
}//end function

function searchTN(value){
	if(!value)
	{
		return false;
	}
	else
	{
		document.frmSearch.action=SEARCH_LINK+'/'+SEARCH_TYPE+'/'+TN(value);	
		return true;
	}
}

function searchTN2(value){
	if(!value)
	{
		return false;
	}
	else
	{
		document.frmSearch2.action=SEARCH_LINK+'/web/'+TN(value);	
		return true;
	}
}

function uni_lienhe()
{
	var popW = 530,popH=750;
	if (window.XMLHttpRequest) { popH = 650;} else { popH = 680;}
	window.open("http://"+DOMAIN+"/lienhe/","LienHe","width="+ popW +",height="+ popH +",scrollbars=0,resizable=no,menubar=no");
}	

//=======================Load==============================
jQuery(document).ready(function(){
		TNchangeTabUnity('unitab_top');
		TNShowAllServices();
});