// JavaScript Document

jQuery(document).ready(function(){
						  
	jQuery('.change_lang').click(function(){
		cookieVal = jQuery(this).attr('id');
		setCookie(cookieVal, "lang");
	});
				
	
//end of document function.	
});

function setCookie(val, name){

	var edate = new Date();
	edate.setDate(edate.getDate() + 24);
	
	var cookieVal = name + "=" + val + "; expires = " + edate + "; path = /;";

	document.cookie = cookieVal;
};

function loadCookie(cName){

//Function loads the values from a cookie and then returns the values.
	var results = document.cookie.match('(^|;) ?' + cName + '=([^;]*)(;|$)');
	
	if(results)
	{
		return ( unescape ( results[2] ) );
	}
	else
	{
		return null;
	};
};

function change_lang(){
	cookieVal = jQuery(this).attr('id');
	setCookie(cookieVal, "lang");
};
