﻿//JavaScript Document
var globalPath = 'http://www.neukon.com/';
var globalPathTC = 'http://www.neukon.com/';
var globalImgPath = globalPath+'file_manager/images/';

//Define Navigation
function NavObj(name,url,urlType,menuHeight){
	this.name = name;
	this.url = url
	this.menuHeight = menuHeight
}
document.write('<scr'+'ipt language="javascript" type="text/javascript" src="'+globalPath+'file_manager/javascript/courses.php"></scr'+'ipt>');
var AboutUsNav = new Array();
AboutUsNav[0] = new NavObj('who we are',globalPath+'home_who_we_are.html','',26)
AboutUsNav[1] = new NavObj('how it works',globalPath+'home_how_it_works.html','',26)
AboutUsNav[2] = new NavObj('faq',globalPath+'home_faq.html','',26)
var ShopNav = new Array();
ShopNav[0] = new NavObj('wine & coolers',globalPath+'home_wines.html','',26)
ShopNav[1] = new NavObj('electronics',globalPath+'home_electronics.html','',26)
ShopNav[2] = new NavObj('US beauty',globalPath+'home_beauty2.html','',26)
ShopNav[3] = new NavObj('Australia hand spray',globalPath+'esteem.html','',26)
var WineNav = new Array();
WineNav[0] = new NavObj('Australia',globalPath+'hope/index.html','',26)
WineNav[1] = new NavObj('Chile - LN',globalPath+'lnw.html','',26)
WineNav[2] = new NavObj('Chile - TP',globalPath+'tp.html','',26)
WineNav[3] = new NavObj('Alexander Fontein',globalPath+'alexanderfontein.html','',26) //modified by minipg

//Global Setting
window.attachEvent("onload", PreloadImage)
window.status = 'Welcome to Neukon Club';
document.title = 'Neukon Club 生活品味';
document.write('<link href="'+globalPath+'file_manager/stylesheet/menu.css" rel="stylesheet" type="text/css">');

//Layout Setting
function PreloadImage(){
	MM_preloadImages(
					 globalImgPath+'common/member_go_on.gif',
					 globalImgPath+'common/register_on.gif',
					 globalImgPath+'common/forgot_on.gif',
					 globalImgPath+'menu/who_on.gif',
					 globalImgPath+'menu/how_on.gif',
					 globalImgPath+'menu/articles_on.gif',
					 globalImgPath+'menu/members_on.gif',
					 globalImgPath+'menu/contact_on.gif',
					 globalImgPath+'menu/courses_schedule_over.gif',
					 globalImgPath+'menu/company_intro_over.gif'
	)
}

function js_login(){
	document.frmLogin.action = globalPath+"member_login.php";
	document.frmLogin.method = "POST";
	document.frmLogin.txtaction.value = "login";
	document.frmLogin.submit();
}
function js_forget(){
	document.frmLogin.action = globalPath+"member_forget_password.php";
	document.frmLogin.method = "POST";
	document.frmLogin.txtaction.value = "";
	document.frmLogin.submit();
}
function js_logoff(){
	location = globalPath+'member_sign_off.php';
}
function js_register(){
	location = globalPath+'member_sign_up.php';
}
function js_profile(){
	location = globalPath+'member_profile.php';
}
function js_forum(){
	location = 'http://forum.neukon.com';
}

function LayoutHeader(login){
	//check user login or not
//	alert(document.cookie)
	if (document.cookie.indexOf("mid") < 0) {
		login = 0;
	} else {
		var startStr = document.cookie.indexOf("mid")+4;
		var endStr = document.cookie.indexOf(";", startStr);
		if (endStr == -1) {
			endStr = document.cookie.length;
		}
		login = unescape(document.cookie.substring(startStr, endStr));
	}

	var htmlStr = '';
	htmlStr += '<a name="top">';
	htmlStr += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	htmlStr += '<tr>';
	htmlStr += '<td height="80" valign="bottom" background="'+globalImgPath+'common/header.gif">';
	htmlStr += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	htmlStr += '<tr>';
	htmlStr += '<td rowspan="2">';
	htmlStr += '<a href="'+globalPath+'index.php"><img src="'+globalImgPath+'common/shim.gif" width="245" height="80" border="0"></a>';
	htmlStr += '</td>';
	htmlStr += '<td width="100%" align="right" valign="top">';
	/*if (login) {
		htmlStr += '<table border="0" cellspacing="0" cellpadding="0">';
		htmlStr += '<tr>';
		htmlStr += '<td colspan="2" height="3"></td>';
		htmlStr += '</tr>';
		htmlStr += '<tr>';
		htmlStr += '<td valign="top"><a href="javascript:js_logoff();"><img src="'+globalImgPath+'/login/member_sign_off.gif" border="0"></a></td>';
		htmlStr += '<td valign="top"><a href="javascript:js_profile();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'login_update_profile\',\'\',\''+globalImgPath+'login/update_profile_on.gif\',1)"><img src="'+globalImgPath+'login/update_profile.gif" name="login_update_profile" border="0"><br>';
		htmlStr += '</a><a href="javascript:js_forum();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'login_go_to_forum\',\'\',\''+globalImgPath+'login/go_to_forum_on.gif\',1)"><img src="'+globalImgPath+'login/go_to_forum.gif" name="login_go_to_forum" border="0"></a></td>';
		htmlStr += '</tr>';
		htmlStr += '</table>';
	} else {
		htmlStr += '<table border="0" cellspacing="0" cellpadding="0">';
		htmlStr += '<form name="frmLogin">';
		htmlStr += '<input type="hidden" name="txtaction" value="login">';
		htmlStr += '<tr>';
		htmlStr += '<td colspan="6" height="3"></td>';
		htmlStr += '</tr>';
		htmlStr += '<tr>';
		htmlStr += '<td valign="top"><img src="'+globalImgPath+'login/member_sign_in.gif"></td>';
		htmlStr += '<td valign="top"><img src="'+globalImgPath+'login/login_name.gif"><br>';
		htmlStr += '<input type="text" name="txtUsername" id="txtUsername" style="width:80px;height:18px;font-size:11px;"><br>';
		htmlStr += '<img src="'+globalImgPath+'login/login_name_bottom.gif"></td>';
		htmlStr += '<td valign="top"><img src="'+globalImgPath+'login/space.gif"></td>';
		htmlStr += '<td valign="top"><img src="'+globalImgPath+'login/password.gif"><br>';
		htmlStr += '<input type="password" name="txtpassword" id="txtpassword" style="width:80px;height:18px;font-size:11px;"><br>';
		htmlStr += '<img src="'+globalImgPath+'login/password_bottom.gif"></td>';
		htmlStr += '<td valign="top"><a href="javascript:js_login();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'login_go\',\'\',\''+globalImgPath+'login/go_on.gif\',1)"><img src="'+globalImgPath+'login/go.gif" name="login_go" border="0"></a></td>';
		htmlStr += '<td valign="top"><a href="javascript:js_register();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'login_register_new\',\'\',\''+globalImgPath+'login/register_new_on.gif\',1)"><img src="'+globalImgPath+'login/register_new.gif" name="login_register_new" border="0"><br>';
		htmlStr += '</a><a href="javascript:js_forget();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'login_forget_password\',\'\',\''+globalImgPath+'login/forget_password_on.gif\',1)"><img src="'+globalImgPath+'login/forget_password.gif" name="login_forget_password" border="0"></a></td>';
		htmlStr += '</tr>';
		htmlStr += '</form>';
		htmlStr += '</table>';
	}*/
	htmlStr += '&nbsp;';
	htmlStr += '</td>';
	htmlStr += '</tr>';
	htmlStr += '<tr>';
	htmlStr += '<td width="100%" valign="bottom">';
	//add by minipg
	htmlStr += '<img src="'+globalImgPath+'common/shim.gif" width="100" height="30">';
	htmlStr += '<img src="'+globalImgPath+'common/shim.gif" name="menu" width="200" height="30" id="menu">';
	htmlStr += '</td>';
	htmlStr += '</tr>';
	htmlStr += '</table>';
	htmlStr += '</td>';
	htmlStr += '</tr>';
	htmlStr += '</table>';
	return htmlStr;
}
function LayoutFooter(){
	var htmlStr='';
//	htmlStr += '<table width="100%" border="0" cellspacing="0" cellpadding="5">';
//	htmlStr += '<tr>';
//	htmlStr += '<td valign="bottom"><img src="'+globalImgPath+'common/pay_dollar.gif" border="0">';
//	htmlStr += '<img src="'+globalImgPath+'common/shim.gif" width="4" height="10" border="0"><img src="'+globalImgPath+'common/verified_by_visa.gif" border="0">';
//	htmlStr += '<img src="'+globalImgPath+'common/shim.gif" width="4" height="10" border="0"><a href="'+globalPath+'file_manager/document/brochure_about_security.pdf" target="_blank"><img src="'+globalImgPath+'common/download_security_info.gif" border="0"></a></td>';
//	htmlStr += '<td valign="bottom" align="right" width="100%"><a href="#top"><img src="'+globalImgPath+'button/top.gif" border="0"></a></td>';
//	htmlStr += '</tr>';
//	htmlStr += '</table>';
	htmlStr += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	htmlStr += '<tr>';
	htmlStr += '<td width="10" bgcolor="#595952">&nbsp;</td>';
	htmlStr += '<td width="10" bgcolor="#171713">&nbsp;</td>';
	htmlStr += '<td width="260" bgcolor="#171713" class="Footer">&copy 2009 Neukon Holdings (HK) Limited</td>';
	htmlStr += '<td width="400" bgcolor="#171713" class="Footer"><a href="'+globalPath+'home_privacy_policy.html">Privacy Policy</a> | <a href="'+globalPath+'home_disclaimer.html">Disclaimer</a></td>';
// htmlStr += '<td><a href="http://www.netconcept.com.hk" target="_blank"><img src="'+globalImgPath+'common/netconcept.gif" width="120" height="20" border="0"></a></td>';
	htmlStr += '</tr>';
	htmlStr += '</table>';
	htmlStr += '<br>';
	return htmlStr;
}
function LangSwitch(lang) {
	var langTypes = new Array('en','tc','sc')
	var locationStr = location.href.toLowerCase();
	if (locationStr.indexOf('#')!=-1) {
		locationStr = locationStr.substr(0,locationStr.indexOf('#'))
	}
	var newLocationStr = '';
	for (var i=0; i<langTypes.length; i++) {
		locationStr=locationStr.replace('/'+langTypes[i]+'/', '/'+lang+'/');
	}
	location = locationStr;
}

//Linkage

//Dreamweaver Code
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
