var cookieEnabled=(navigator.cookieEnabled)? true : false
if(typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
document.cookie="testcookieola"
cookieEnabled=(document.cookie.indexOf("testcookieola")!=-1)? true : false
}if(cookieEnabled){fullurl=location.href;platset="?platform=";
fndmre_vars="-1";is_protocol_ok=fullurl.lastIndexOf(platset);
if(is_protocol_ok==-1){get_platform="";
}else{get_platform=fullurl.substring(fullurl.indexOf('?')+10,fullurl.length).toLowerCase();
fndmre_vars=get_platform.indexOf('&');
if(fndmre_vars!=-1){get_platform=get_platform.substr('0',fndmre_vars);
}}if(get_platform==""){nullPlatform=location.pathname+platset+"null";
fndmre_vars = fullurl.indexOf('&');
if(fndmre_vars!=-1){nullPlatform = nullPlatform + fullurl.substr(fndmre_vars,fullurl.length);
}location.replace(nullPlatform);get_platform="null";
}function getCookie(c_name){if(document.cookie.length>0){ 
c_start=document.cookie.indexOf(c_name + "=")
if(c_start!=-1){c_start=c_start+c_name.length+1 
c_end=document.cookie.indexOf(";",c_start)
if(c_end==-1)c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
}}return ""
}function setCookie(c_name,value,expiredays){
var exdate=new Date()
document.cookie=c_name+"=1;expires="+
exdate.toGMTString()+";"+";";
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+"=" +escape(value)+
((expiredays==null) ? "" : "; expires="+exdate.toGMTString()+
"; path=/; domain=.autotrader.co.uk;");
}if(get_platform != null && get_platform != 'null'){
if(getCookie('at_ola_platform') != get_platform){
var cookie_s=""+document.cookie;var cookie_a=cookie_s.split("; ");
for(var i=0;i<cookie_a.length;++i){var s_cookie=cookie_a[i].split("=");
var c_name=unescape(s_cookie[0]);
if(c_name=="at_ola_platform"){var exdate=new Date();
exdate.setYear(exdate.getYear()-1);
exdate=exdate.toGMTString();
var cookie_s=escape(c_name)+"=; expires=" + exdate;
document.cookie=cookie_s;
}}setCookie('at_ola_platform',get_platform,30);
}}at_ola_platform=getCookie('at_ola_platform');
if(at_ola_platform && get_platform != at_ola_platform) {
if(fndmre_vars !=-1){
at_ola_platform=at_ola_platform+fullurl.substr(fullurl.indexOf('&'),fullurl.length);
}newPlatform=location.pathname+platset+at_ola_platform;
location.replace(newPlatform);
}}