
var moviesSelector = '<select onchange="window.location=(this.options[this.selectedIndex].value)">'
		+ '<option value="">Select a Movie</option>'
+ '    <optgroup title="-- Coming Soon --" label="-- Coming Soon --">'
+ '        <option value="http://beastly.com.au">Beastly</option>'
+ '        <option value="http://www.thebookofeli.com.au">Book of Eli</option>'
+ '        <option value="http://www.EatPrayLove.com.au">Eat Pray Love</option>'
+ '        <option value="http://www.LegionMovie.com.au">Legion</option>'
+ '        <option value="http://www.WhoIsSalt.com.au/">Salt</option>'
+ '        <option value="http://www.thebackupplan.com.au">The Back Up Plan</option>'
+ '        <option value="http://bountyhuntermovie.com.au/">The Bounty Hunter</option>'
+ '        <option value="http://thegreenhornet.com.au">The Green Hornet</option>'
+ '        <option value="http://karatekidmovie.com.au/">The Karate Kid</option>'
+ '    </optgroup>'
+ '    <optgroup title="-- Now Playing --" label="-- Now Playing --">'
+ '        <option value="/movies/2012/">2012</option>'
+ '        <option value="http://aprophet.com.au">A Prophet</option>'
+ '        <option value="http://www.celinedionmovie.com.au/">Celine: Through the Eyes of the World</option>'
+ '        <option value="/movies/cloudywithachanceofmeatballs/">Cloudy With A Chance Of Meatballs</option>'
+ '        <option value="http://DidYouHearAboutTheMorgans.com.au">Did You Hear About The Morgans?</option>'
+ '        <option value="http://www.NineMovie.com.au">Nine</option>'
+ '        <option value="http://www.TheMenWhoStareAtGoats.com.au">The Men Who Stare At Goats</option>'
+ '        <option value="/movies/zombieland/">Zombieland</option>'
+ '    </optgroup>'
+ '  </select>';


function checkAllSelectors() {
    checkSelector('movieselector', moviesSelector);
}

function checkSelector(targetNodeId, targetContents) {
    var node = document.getElementById(targetNodeId);
    if (node) {
        node.innerHTML = targetContents;
    }
}

addLoadEvent(checkAllSelectors);
addLoadEvent(getAdFeedbackLink);

function getAdFeedbackLink()
{
    var element = document.getElementById("ad_feedback");
    if(element != null)
    {
    	element.onclick = function() {
    		adFeedBackId(element);
    		return false;
    	}
    }
}

function adFeedBackId(element) {
	var feedbackbanneridElement = document.getElementById("feedbackbannerid");
    if (feedbackbanneridElement != null) {
		var feedbackId = feedbackbanneridElement.innerHtml;
	    var href = element.getAttribute("href");
	    href = href + "?ad=" + feedbackId;
	    element.setAttribute("href",href);	    
    }
    href = element.getAttribute("href");
	window.open(href,'_blank');
    return false;
}