// JavaScript Document
	function getProductParentCategory(topid,parentid){
		var str = '';
		var top_temp=0;
		if(parentid>0){
			for(var i=0;i<product_category.length;i++){
				if(parseInt(parentid)==parseInt(product_category[i][0])){
					str += ' &raquo; <a href="product.aspx?parentid='+parentid+'">'+product_category[i][2]+'</a>';
					top_temp = parseInt(product_category[i][1]);
					break;
				}
			}
			for(var i=0;i<product_category.length;i++){
				if(parseInt(top_temp)==parseInt(product_category[i][0])){
					str = ' &raquo; <a href="product.aspx?topid='+top_temp+'">'+product_category[i][2]+'</a>' + str;
					break;
				}
			}
		}
		else if(topid>0){
			for(var i=0;i<product_category.length;i++){
				if(parseInt(topid)==parseInt(product_category[i][0])){
					str += ' &raquo; <a href="product.aspx?topid='+product_category[i][0]+'">'+product_category[i][2]+'</a>';
					break;
				}
			}
		}
		document.write(str);	
	}
	function getProductParentCategoryEn(topid,parentid){
		var str = '';
		var top_temp=0;
		if(parentid>0){
			for(var i=0;i<product_category.length;i++){
				if(parseInt(parentid)==parseInt(product_category[i][0])){
					str += ' &raquo; <a href="product_en.aspx?parentid='+parentid+'">'+product_category[i][3]+'</a>';
					top_temp = parseInt(product_category[i][1]);
					break;
				}
			}
			for(var i=0;i<product_category.length;i++){
				if(parseInt(top_temp)==parseInt(product_category[i][0])){
					str = ' &raquo; <a href="product_en.aspx?topid='+top_temp+'">'+product_category[i][3]+'</a>' + str;
					break;
				}
			}
		}
		else if(topid>0){
			for(var i=0;i<product_category.length;i++){
				if(parseInt(topid)==parseInt(product_category[i][0])){
					str += ' &raquo; <a href="product_en.aspx?topid='+product_category[i][0]+'">'+product_category[i][3]+'</a>';
					break;
				}
			}
		}
		document.write(str);	
	}
	function checkTopSearch(f){
		var file_submit = 'product.aspx';
		switch(f.type.value){
			case '2' :
				file_submit = 'news.aspx';
				break;
			case '3' :
				file_submit = 'faq.aspx';
				break;
			default : 
				file_submit = 'product.aspx';
		}
		f.action = file_submit;
		var keys = Trim(f.key.value);
		if(keys!=''){
			f.key.value = keys;
			var keys_lower = keys.toLowerCase();
			f.keyl.value = keys_lower;
			var keys_upper = keys.toUpperCase();
			f.keyu.value = keys_upper;
		}
		return true;
	}
	function checkTopSearchEn(f){
		var file_submit = 'product_en.aspx';
		switch(f.type.value){
			case '2' :
				file_submit = 'news_en.aspx';
				break;
			case '3' :
				file_submit = 'faq_en.aspx';
				break;
			default : 
				file_submit = 'product_en.aspx';
		}
		f.action = file_submit;
		var keys = Trim(f.key.value);
		if(keys!=''){
			f.key.value = keys;
			var keys_lower = keys.toLowerCase();
			f.keyl.value = keys_lower;
			var keys_upper = keys.toUpperCase();
			f.keyu.value = keys_upper;
		}
		return true;
	}
	function getNewsParentCategory(catid,lang){
		var str='';
		if(catid>0){
			for(var i=0;i<news_category.length;i++){
				if(parseInt(news_category[i][2])==parseInt(lang))	{
					if(parseInt(catid)==parseInt(news_category[i][0])){
						str += ' &raquo; <a href="news.aspx?catid='+news_category[i][0]+'">'+news_category[i][1]+'</a>';
						break;
					}
				}
			}
		}
		document.write(str);	
	}
	function WriteTopCategoryEn(topid,lang)
	{
	
		switch(topid)
		{
			case "1":
			  document.write("ABOUT");
			  break;    
			case "2":
			  document.write("NEWS & EVENT");
			  break;
			case "3":
			  document.write("NUTRITION SUBJECT");
			  break;
			case "4":
			  document.write("CAPACITY FACTORY");
			  break;
			case "5":
			  document.write("QUALITY POLICY");
			  break;
			case "6":
			  document.write("DISTRIBUTION SYSTEM");
			  break;
			default:
			  document.write("");
		} 

			
	}
	function WriteTopCategory(topid,lang)
	{
	
		switch(topid)
		{
			case "1":
			  document.write("Giới Thiệu");
			  break;    
			case "2":
			  document.write("Tin Tức & Sự Kiện");
			  break;
			case "3":
			  document.write("Chuyên Đề Dinh Dưỡng");
			  break;
			case "4":
			  document.write("Năng Lực Sản Xuất");
			  break;
			case "5":
			  document.write("Chính Sách Sản Xuất");
			  break;
			case "6":
			  document.write("Hệ Thống Phân Phối");
			  break;
			default:
			  document.write("");
		} 

			
	}
