function getIndex(elm,_2c,_2d){for(var i=0;i<_2c.length;i++){if(_2d&&_2d(_2c[i])||elm==_2c[i]){return i;}}
return-1;}
function doChangeLanguage(language){var eval=new RegExp("lang=[A-Za-z]+","gi");var search=window.location.search;var match=eval.test(search);if(match){search=search.replace(/lang\=[A-Za-z]+/gi,"lang="+language);}else{if(search.length>0&&search.charAt(0)=='?'){search+="&lang="+language;}else{search+="?lang="+language;}}
window.location.search=search;}
String.prototype.trim=function(){a=this.replace(/^\s+/,"");return a.replace(/\s+$/,"");};function openWindow(url){open(url,"window",'width=780,height=650,toolbar=no,directories=no,scrollbars=yes,menubar=no,status=no');}
function alphaOrder(a,b){if(a.text<b.text)return-1
else if(a.text==b.text)return 0
else return 1}
function orderSelect(selectFieldName){var select=document.getElementById(selectFieldName);var selected=select.options[select.selectedIndex];var selectedPosition=-1;var other;var otherPosition=-1;var chooseOne;var chooseOnePositiion=-1;var temp;var originalList=select.options;var newList=new Array(originalList.length);for(i=0;i<originalList.length;i++){newList[i]=originalList[i];temp=newList[i];if(temp.text=="Other"||temp.text=="Otro"||temp.text=="Otros"||temp.text=="Others")other=temp;if(temp.text=="[Elige uno...]"||temp.text=="[Choose one...]")chooseOne=temp;}
newList.sort(alphaOrder);select.options.length=0;select.options.length=newList.length;chooseOnePosition=getIndex(chooseOne,newList);if(chooseOnePosition>-1){newList.splice(chooseOnePosition,1);newList.unshift(chooseOne);}
otherPosition=getIndex(other,newList);if(otherPosition>-1){newList.splice(otherPosition,1);newList.push(other);}
for(i=0;i<newList.length;i++)
{temp=newList[i].text;select.options[i]=newList[i];if(temp==selected.text)selectedPosition=i;}
select.options[selectedPosition].selected=selected;}
function checkNumbers(elem){var text=elem.value;var newText;var i=0;var temp="";for(i=0;i<text.length;i++)
{temp=text.charAt(i);if((temp>=0&&temp<=9)&&temp!=" ")
newText=(newText!=undefined)?newText+""+temp:temp;}
newText?elem.value=newText:elem.value="";}
var intlCodes=new Array("","93","355","213","376","244","1268","54","374","297","247","61","43","994","973","880","375","32","501","229","975","591","387","267","55","673","359","226","257","855","237","1","238","236","235","56","86","57","269","243","242","506","225","385","53","357","420","45","253","1767","1","593","20","503","240","291","372","251","679","358","33","241","220","995","49","233","30","1473","502","224","245","592","509","504","36","354","91","62","98","964","353","972","39","1876","81","962","7","254","686","850","82","965","996","856","371","961","266","231","218","423","370","352","389","261","265","60","960","223","356","692","222","230","52","691","373","377","976","382","212","258","95","264","674","977","31","64","505","227","234","47","968","92","680","507","675","595","51","63","48","351","974","40","7","250","1869","1758","1784","685","378","239","966","221","381","248","232","65","421","386","677","252","27","34","94","249","597","268","46","41","963","992","255","66","670","228","676","1868","216","90","993","688","256","380","971","44","001","598","998","678","39","58","84","967","260","263","","1");function changeIntlCode(elm,field)
{var selectedCountry=elm.value;if(field){document.getElementById(field).value=intlCodes[selectedCountry];}
else{var area=null;if(document.getElementById("countryCode1")){area=document.getElementById("countryCode1");area.value=intlCodes[selectedCountry];}
if(document.getElementById("countryCode2")){area=document.getElementById("countryCode2");area.value=intlCodes[selectedCountry];}}}
function setIntlCode(countryId)
{var area=null;if(document.getElementById("countryCode1")){area=document.getElementById("countryCode1");area.value=intlCodes[countryId];}
if(document.getElementById("countryCode2")){area=document.getElementById("countryCode2");area.value=intlCodes[countryId];}}
function showTooltip(elem){var nodes=elem.getElementsByTagName("*");var i=0;for(i=0;i<nodes.length;i=i+1){if(nodes[i].className=="tooltip")nodes[i].style.display="block";}}
function hideTooltip(elem){var nodes=elem.getElementsByTagName("*");var i=0;for(i=0;i<nodes.length;i=i+1){if(nodes[i].className=="tooltip")nodes[i].style.display="none";}}
if(screen.availWidth<1000)document.getElementsByTagName('body')[0].style.width="960px";function changeSite(elem){var value=elem.options[elem.selectedIndex].value;if(value=="is")window.location="/index-int.do";if(value=="ve")window.location="/ve/index.do";}
function hideMe(elem, button){elem.style.display="none";document.getElementById(""+button+"").style.display="inline";}