JavaScript Index Of

<html>

<body>

<input id=”hdnList” type=”hidden” value=”http://website1.com,http://website2.com,http://website3.com.au&#8221; />

</body>

<script type=”text/javascript”>

var urlArray = new Array();
var str = document.getElementById(“hdnList”);

urlArray = str.value.split(‘,’);

var strResult = “http://website2.com/search/subsite&#8221;;

var i = 0;

for(i = 0; i < urlArray.length; i++)
{

if(urlArray[i].indexOf(strResult) != -1 || strResult.indexOf(urlArray[i]) != -1)
{
alert(urlArray[i]);
}

}

</script>

</html>