﻿var link = new Array();
link['home'] = '/htdocs/index_<lang>.html';
link['terms'] = '/htdocs/terms/index_<lang>.html';
link['contactus'] = '/htdocs/contactus/index_<lang>.html';
link['sitemap'] = '/htdocs/sitemap/index_<lang>.html';
link['legal'] = '/htdocs/legal/index_<lang>.html';
link['legal_popup'] = 'javascript:openWindow2("/htdocs/legal/index_<lang>.html",800,600);';
link['privacy'] = '/htdocs/privacy/index_<lang>.html';
link['privacy_popup'] = 'javascript:openWindow2("/htdocs/privacy/index_<lang>.html",800,600);';
// link['intranet'] = 'javascript:openWindow("https://www.kerrylogistics.com/htdocs/intranet_<lang>.html",600,500);';
// link['intranet'] = 'javascript:openWindow("/htdocs/intranet_<lang>.html",600,500);';
link['intranet'] = 'javascript:openWindow2("https://intranet.kerrylogistics.com",800,600);';
link['customer_login'] = '#'; 
link['e-services'] = 'javascript:openWindow3("https://www.kerrylogistics.com/eServices/login_<lang>.jsp",616,660);';
link['track_and_trace'] = 'javascript:openWindow3("https://online.kerrylogistics.com/SimpleTnT/",616,500);';
link['adobe_reader'] = 'javascript:openWindow2("http://www.adobe.com/products/acrobat/readstep2.html", 800, 600);';
link['tradingterms'] = '/htdocs/tradingterms/index_<lang>.html';
link['policies'] = '/htdocs/policies/index_<lang>.html';

var text_image = new Array();
text_image['home_en'] = 'Home';
text_image['terms_en'] = 'Terms & Conditions';
text_image['contactus_en'] = 'Contact Us';
text_image['sitemap_en'] = 'Sitemap';
text_image['copyright_en'] = ' &copy; Kerry Logistics Network Limited. All Rights Reserved.';
text_image['legal_en'] = 'Legal';
text_image['legal_popup_en'] = 'Legal';
text_image['privacy_en'] = 'Privacy';
text_image['privacy_popup_en'] = 'Privacy';
text_image['intranet_en'] = 'Intranet';
text_image['customer_login_en'] = 'customer_login.gif';
text_image['e-services_en'] = 'e-services.gif';
text_image['track_and_trace_en'] = 'trace_and_trace.gif';
text_image['adobe_reader_en'] = 'get_adobe_reader.jpg';
text_image['tradingterms_en'] = 'Trading Terms';
text_image['policies_en'] = 'Policies';


text_image['home_tc'] = '主頁';
text_image['terms_tc'] = 'Terms & Conditions';
text_image['contactus_tc'] = '聯絡我們';
text_image['sitemap_tc'] = '網站指南';
text_image['copyright_tc'] = ' &copy; 嘉里物流聯網有限公司。版權所有。';
text_image['legal_tc'] = '法律聲明';
text_image['legal_popup_tc'] = '法律聲明';
text_image['privacy_tc'] = '私隱政策';
text_image['privacy_popup_tc'] = '私隱政策';
text_image['intranet_tc'] = '內聯網';
text_image['customer_login_tc'] = 'customer_login.gif';
text_image['e-services_tc'] = 'e-services.gif';
text_image['track_and_trace_tc'] = 'trace_and_trace.gif';
text_image['adobe_reader_tc'] = 'get_adobe_reader.jpg';
text_image['tradingterms_tc'] = '經營條款';
text_image['policies_tc'] = '政策';

text_image['home_sc'] = '主页';
text_image['terms_sc'] = '私隐政策';
text_image['contactus_sc'] = '联络我们';
text_image['sitemap_sc'] = '网站指南';
text_image['copyright_sc'] = ' &copy; 嘉里物流联网有限公司。版权所有。';
text_image['legal_sc'] = '法律声明';
text_image['legal_popup_sc'] = '法律声明';
text_image['privacy_sc'] = '私隐政策';
text_image['privacy_popup_sc'] = '私隐政策';
text_image['intranet_sc'] = '内联网';
text_image['customer_login_sc'] = 'customer_login.gif';
text_image['e-services_sc'] = 'e-services.gif';
text_image['track_and_trace_sc'] = 'trace_and_trace.gif';
text_image['adobe_reader_sc'] = 'get_adobe_reader.jpg';
text_image['tradingterms_sc'] = '经营条款';
text_image['policies_sc'] = '政策';

function generateLink(name, lang, cssClass) {
	var linkurl = regExpReplace(link[name], '<lang>', lang);
	document.write('<a href=\'' + linkurl + '\' class=\'' + cssClass + '\'>' + text_image[name+"_"+lang] + '</a>');
}

function getText(name, lang) {
	document.write(text_image[name+"_"+lang]);
}

function generateRhsLink(name, lang) {
	var linkurl = regExpReplace(link[name], '<lang>', lang);
	document.write('<a href=\'' + linkurl + '\'><img src="/htdocs/images/common/' + lang + '/' + text_image[name+"_"+lang] + '" border="0"></a>');
}

function emailpage() {
  document.location.href = 'mailto:?Body=' + document.location.href;
}

function printpage() {
  self.print();  
}

function openWindow(url,width,height) {
  window_detail = window.open(url,'popupWindow','resizable=yes,width=' + width + ',height=' + height + ',left=0,top=0');
  window_detail.focus();
}

function openWindow2(url,width,height) {
  window_detail = window.open(url,'popupWindow2','resizable=yes,width=' + width + ',height=' + height + ',status=1,toolbar=1,location=1,menubar=1,directories=1,scrollbars=1');
  window_detail.focus();
}

function openWindow3(url,width,height) {
  window_detail = window.open(url,'popupWindow','resizable=yes,scrollbars=1,width=' + width + ',height=' + height + ',left=0,top=0');
  window_detail.focus();
}

function openwindow_TT(url,width,height) {
  window_detail = window.open(url,'popupWindow','resizable=yes,width=' + width + ',height=' + height + ',left=0,top=0,scrollbars=1');
  window_detail.focus();
}

function regExpReplace(orgStr, pattern, replaceStr) {
  var pattern = new RegExp(pattern);
  replacedValue = orgStr.replace(pattern, replaceStr);
  return replacedValue;
}
