var teststring = window.location.href var startsearchpos = window.location.protocol.length + 2 + window.location.host.length var englishFound = teststring.indexOf ( "english", startsearchpos ) var arabicFound = teststring.indexOf ( "arabic", startsearchpos ) alert(englishFound) alert(arabicFound) if (englishFound < arabicFound) { var i = 0, j = 0, elementNodeReferenceList = null, elementNodeReference = null for (j = 0; j < 2; j++) { if (j == 0) { Cufon.replace(elementList[j][i], {fontFamily: 'Quicksand Book'}) } else { Cufon.replace(elementList[j][i], {textShadow: '#000 0 1px'}) } } } }