/* Cookie Maker to Detect if user is registered */
/* 22 October 2009 */
//	Set_Cookie( 'is_registered', 'true', '', '/', '', '' );	
//	Delete_Cookie('is_registered', '/', '');		
	

	function Set_Cookie( name, value, expires, path, domain, secure )
	{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
    var expires = 365;
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
	}

	function Get_Cookie( check_name ) {
		// first we'll split this cookie up into name/value pairs
		// note: document.cookie only returns name=value, not the other components
		var a_all_cookies = document.cookie.split( ';' );
		var a_temp_cookie = '';
		var cookie_name = '';
		var cookie_value = '';
		var b_cookie_found = false; // set boolean t/f default f
	
		for ( i = 0; i < a_all_cookies.length; i++ )
		{
			// now we'll split apart each name=value pair
			a_temp_cookie = a_all_cookies[i].split( '=' );
	
	
			// and trim left/right whitespace while we're at it
			cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
			// if the extracted name matches passed check_name
			if ( cookie_name == check_name )
			{
				b_cookie_found = true;
				// we need to handle case where cookie has no value but exists (no = sign, that is):
				if ( a_temp_cookie.length > 1 )
				{
					cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
				}
				// note that in cases where cookie is initialized but no value, null is returned
				return cookie_value;
				break;
			}
			a_temp_cookie = null;
			cookie_name = '';
		}
		if ( !b_cookie_found )
		{
			return null;
		}
	}
	
	function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
	
/* ------------------------------------ */
// changes content below is user is logon and displays the link

	function enableLink(condition) {
		if (condition == 'true') {
		} else {
			var content = "<h3>Modules</h3><ul><li><a href='register.html'>Reviewing financial statements</a></li><li><a href='register.html'>Analysing income statements</a></li><li><a href='register.html'>Analysing balance sheets</a></li><li><a href='register.html'>Controlling cash flow</a></li><li><a href='register.html'>Approaching growth strategically</a></li><li><a href='register.html'>Becoming more customer-focused</a></li><li><a href='register.html'>Strategies for penetrating new markets</a></li><li><a href='register.html'>Leveraging technology</a></li><li><a href='register.html'>Leading others</a></li><li><a href='register.html'>Influencing and negotiating</a></li><li><a href='register.html'>Self awareness and personal impact</a></li><li><a href='register.html'>Marketing to women and targeting<br /> female customers</a></li></ul>";
			var contentTable = "<h3>Modules</h3><ul><li><a href='register.html'><strong>Reviewing financial statements</strong>Finance is affected in two ways, from an income statement perspective and from a balance sheet perspective.  This module will explore the various components of financial statements. [read more]       </a></li><li><a href='register.html'>        <strong>Analysing income statements</strong>Profitability is one of the most important goals of any enterprise.  In this module, we will analyse the income statement, explore various growth strategies and review things to consider before adopting those strategies. [read more]</a></li><li><a href='register.html'>                <strong>Analysing balance sheets</strong>From a financial perspective, the world revolves around balance sheets and cash flow forecasts.  In this module, we will analyse the balance sheet and learn some helpful financial ratios to measure the current asset activity of the business. [read more]</a></li><li><a href='register.html'>                <strong>Controlling cash flow</strong>When a business is growing, cash flow is one of the most important financial areas in which to plan and to manage.  In this module, we will learn the concepts of cash flow and things to consider when timing a business&#146;s growth. [read more]</a></li><li><a href='register.html'>                <strong>Approaching growth strategically</strong>You have already built a business.  It has survived, perhaps even thrived, but you&#146;re now wondering what to do next.  Should you expand your operations? [read more]</a></li><li><a href='register.html'>                <strong>Becoming more customer-focused</strong>Today, and increasingly in the new economy of the future, customers are asserting their purchasing power in many industries.  Growing your business will involve getting to know your customers as much as possible. [read more]</a></li><li><a href='register.html'>                <strong>Strategies for penetrating new markets</strong>Rather than incur the risks and costs of inventing or amending existing products and services, companies can expand their sales outward to penetrate new markets or new segments. [read more]</a></li><li><a href='register.html'>                <strong>Leveraging technology</strong>While technology has already become a crucial part of the operations of most small businesses, its significance can only increase in coming years.  What part does technology need to play in your plan for growth? [read more]</a></li><li><a href='register.html'>                <strong>Leading others</strong>Assembling a supportive team is an important start to creating a firm foundation for growth, but if you want people to help you achieve your vision, you will have to lead them there.  But what does it take to be an effective leader? [read more]</a></li><li><a href='register.html'>                <strong>Influencing and negotiating</strong>The ability to influence is a critical factor for success.  This module focuses on the combination of interpersonal skills, communication and assertiveness that female entrepreneurs often need to build. [read more]</a></li><li><a href='register.html'>                <strong>Self awareness and personal impact</strong>Making a positive impact in what is still a predominately &#147;male&#148; business environment is something female entrepreneurs need to manage carefully. This module looks at the importance of developing self awareness and self belief. [read more]        </a></li>  <li><a href='register.html'>                <strong>Marketing to women and targeting female customers</strong>Women worldwide control the majority of consumer spending, and this may grow as much as 40% in the next five years to $28 trillion.  This module explores how to appeal to female customers and capture market share. [read more].      </a></li>          </ul>";
			$("#modules").html(content);
			$("#content_module_table").html(contentTable);		
		}
	}

