    var gw = document.getElementById("gw_prospective");
    var gwbtn = document.images["gwbtn_prospective"];
    var gwbtnfile="/cityu/images/gw_prospective.gif";

 	function initCookie(){
	        cookie_date = new Date();
	        cookie_date.setDate(cookie_date.getDate() + 90);
		switch (location.href){
		case "http://www.cityu.edu.hk/index.html#prospective":
		case "http://www.cityu.edu.hk/index.htm#prospective":
	         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=/cityu/;domain=www.cityu.edu.hk";
	         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=/;domain=www.cityu.edu.hk";
	         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=;domain=www.cityu.edu.hk";
			break;
		case "http://www.cityu.edu.hk/index.html#visitor":
		case "http://www.cityu.edu.hk/index.htm#visitor":
			setgw(document.getElementById('gw_visitor'), '/cityu/images/gw_visitor.gif', '/cityu/images/gw_visitor-hl.gif', document.images['gwbtn_visitor'], 'visitor');
			break;
		case "http://www.cityu.edu.hk/index.html#outreach":
		case "http://www.cityu.edu.hk/index.htm#outreach":
			setgw(document.getElementById('gw_outreach'), '/cityu/images/gw_outreach.gif', '/cityu/images/gw_outreach-hl.gif', document.images['gwbtn_outreach'], 'outreach');
			break;
		case "http://www.cityu.edu.hk/index.html#mycityu":
		case "http://www.cityu.edu.hk/index.htm#mycityu":
			setgw(document.getElementById('gw_mycityu'), '/cityu/images/gw_mycityu.gif', '/cityu/images/gw_mycityu-hl.gif', document.images['gwbtn_mycityu'], 'mycityu');
			break;
		default:
			if (document.cookie.length <= 0){
		         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=/cityu/;domain=www.cityu.edu.hk";
		         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=/;domain=www.cityu.edu.hk";
		         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=;domain=www.cityu.edu.hk";
			}
			else{
				cookie_start = document.cookie.indexOf("gw=");
				cookie_end = document.cookie.indexOf(";", cookie_start);
				mycookie = document.cookie.substring(cookie_start+3, cookie_end);
		
				switch(mycookie){
				case "visitor":
					break;
				case "outreach":
					break;
				case "mycityu":
					break;
				default:
			        document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=/cityu/;domain=www.cityu.edu.hk";
			         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=/;domain=www.cityu.edu.hk";
			         document.cookie = "gw=prospective;expires=" + cookie_date.toGMTString() + ";path=;domain=www.cityu.edu.hk";
					break;
				}
			}
			break;
		}
	}

