 

//used in AdSpecs Page to load all the links in the dropdownLookup
 $(document).ready(function()
{
/* 
$("div").each(function (i) 
{
if($(this).attr("class")=="linktitle")
{

}
else if($(this).attr("class")=="text" || $(this).attr("class")=="dimensions" ) 
{
  $(this).css("border-bottom","1px dotted black");
}  
});*/

//load JSON data using an HTTP GET request.
    $.getJSON("http://data.ninemsn.com.au/Services/Service.axd?ServiceName=Highlight&ServiceAction=Get&ServiceFormat=JSONAUTO&SiteID=4375&SectionID=10355&SubSectionID=153193&GroupID=76552,76553,76554,76555,76556,76557,76559,76560,76561,76562&callback=?", function(data)
	{    
	if(data)
		{		
		var arr = 0;
                                var thisHighlight = 0;
                                var countOfHighlight = data.HighlightList.Highlight.length;
                                var countOfLink = 0;
                                for(i = 0;i < countOfHighlight; i++)
                                {
                                  // store data from each highlight to an array
                                  thisHighlight = data.HighlightList.Highlight[i];
                                  $('<option value = "">' + thisHighlight.Title + '</option>').appendTo('select');
                                  
                                  //store link data from each highlight to an array
                                  arr = data.HighlightList.Highlight[i].LinkList.Link;
                                  countOfLink = data.HighlightList.Highlight[i].LinkList.Link.length;
                                  for(j = 0; j < countOfLink; j++)
                                  {
                                  //append the data as a option tag to the select tag
                                  $('<option value = "' + arr[j].Url + '"> - ' + arr[j].Title + '    ' + arr[j].Text + '</option>').appendTo('#adProductLookup');
                                  } 
                                }
                               }



           });
   
});

//the function is called by onchange event from select tag
function redirect(url) {
    if (url != "")
        window.location = url;
    }    












