<?php
function getAvailableLang(){
	$out = "";
	//natsort($GLOBALS['langTranslated']);
	while(list($key,$langId) = each($GLOBALS['availableLang'])){
		$langLib = ($GLOBALS['langTranslated'][$langId])? $GLOBALS['langTranslated'][$langId] : $langId;
		$out .= '<option value="'.$langId.'"'.(($GLOBALS['localLang']==$langId)? ' selected="selected"' : '' ).'>'.$langLib.'</option>'."\n";
	}
	return $out;
}

function createSelect($tabData, $varName, $varValue){
	$out = '';
	if(isset($tabData) && !empty($tabData)){
		$out .= '<SELECT class="select" name="'.$varName.'">'."\n".'<option value="" />'."\n";
		foreach($tabData as $id=>$value) $out .= '<option value="'.$id.'"'.(($id==$varValue)? ' selected="selected"' : '' ).'>'.$value.'</option>'."\n";
		$out .='</SELECT>'."\n";
	}
	return $out;
}

if(!file_exists("./lang/".$localLang."/define.php")) {
	unset($_COOKIE["Popoji_CMS_Lang"]);
	$localLang = "indonesia";
}
include ("./lang/".$localLang."/define.php");
?>