function createCookie2(name,value,days) {

	if (days) {

		var date = new Date();

		date.setTime(date.getTime()+(days*24*60*60*1000));

		var expires = "; expires="+date.toGMTString();

	}

	else var expires = "";

	document.cookie = name+"="+value+expires+"; path=/";

}



function readCookie2(name) {

	var nameEQ = name + "=";

	var ca = document.cookie.split(';');

	for(var i=0;i < ca.length;i++) {

		var c = ca[i];

		while (c.charAt(0)==' ') c = c.substring(1,c.length);

		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);

	}

	return null;

}



function eraseCookie2(name) {

	createCookie2(name,"",-1);

}



function checkCookie2()

{

	if (readCookie2('country')) {

		var country=readCookie2('country');



		if (country==null || country=="") {createCookie2('country','',10);}

		

		return "Y"

	} else {

		return "N"

	}

}



function lvcookiesetbus() {

	var href = window.location.pathname;

	// don't continue without support for appendChild

	if (document.body.appendChild) {

		if(href == "/personal.html"){		

			createCookie2('lastviewed','personal',10);

		}

		if(href == "/business/index.html"){		

			createCookie2('lastviewed','business',10);

			createCookie2('buspreference','business',10);

		}

		if(href == "/commercial/index.html"){		

			createCookie2('lastviewed','commercial',10);

			createCookie2('buspreference','commercial',10);

		}

	}

}



function lvcookiesetpers() {

	var href = window.location.pathname;

	// don't continue without support for appendChild

	if (document.body.appendChild) {

		if(href == "/personal.html"){		

			createCookie2('lastviewed','personal',10);

		}

		if(href == "/business/index.html"){		

			createCookie2('lastviewed','business',10);

		}

		if(href == "/commercial/index.html"){		

			createCookie2('lastviewed','commercial',10);

		}

	}

}

