if(JRequest::getVar('direction')=='rtl'){ setcookie("djdirection", "rtl"); $direction='rtl'; } else if(JRequest::getVar('direction')=='ltr'){ setcookie("djdirection", "ltr"); $direction='ltr'; } else { if(isset($_COOKIE['djdirection'])){ $direction=$_COOKIE['djdirection']; }else{ $direction=JRequest::getVar('djdirection',$this->direction); } } ?>