﻿<!--
/////////////////////////// 
// GET THE COOKIE
/////////////////////////// 
function getCookie(Preference)
{ if (document.cookie.length > 0)
{ begin = document.cookie.indexOf(Preference+"=");
if (begin != -1)
{ begin += Preference.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); }
}
refreshThisPageToEnglish();
//alert('cookie functioning correctly')
//return null;
}
/////////////////////////// 
// SET THE COOKIE
/////////////////////////// 
function setCookie(Preference, value, expiredays)
{ var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = Preference + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
/////////////////////////// 
// DELETE THE COOKIE
/////////////////////////// 
function delCookie (Preference)
{ if (getCookie(Preference)) {
document.cookie = Preference + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
/////////////////////////// 
// REFRESH TO LANGUAGE CHOICE
/////////////////////////// 
function refreshThisPageToEnglish()
{
setCookie('Preference','english',365);
//alert('refresh to english function');
        window.location.reload( false );
        window.location.href = sURL;
        window.location.replace( sURL );        
}
function refreshThisPageToSpanish()
{
setCookie('Preference','spanish',365);
//alert('refresh to english function');
        window.location.reload( false );
        window.location.href = sURL;
        window.location.replace( sURL );        
}
/////////////////////////// 
// CHECK FOR THE COOKIE
/////////////////////////// 
function cookieCheck()
{
//alert('Cookie Check')
}
-->

