Community.Widgets = new function(){

if( window.location.hostname.indexOf("mtv-d.mtvi.com") != -1 ) {
this.baseUrl = 'http://www.mtv-d.mtvi.com';
} else if (window.location.hostname.indexOf("mtv-q.mtvi.com") != -1 ) {
this.baseUrl = 'http://www.mtv-q.mtvi.com';
} else {
this.baseUrl = 'http://www.mtv.com';
}

this.Flux4 = false;

this.hostname = 'http://www.mtv.com';

this.headerObj = {"div":{"div":[{"div":[{"a":[{"href":"http://www.mtv.com","class":"first","content":"Home"},{"href":"/geek/event_coverage/toy_fair/main.jhtml","content":"Toy Fair 2012"},{"href":"http://style.mtv.com/category/new-york-fashion-week/","class":"last","content":"New York Fashion Week"}],"ul":{"li":{"a":{"href":"#","class":"topLink","content":"MTV Sites"},"ul":{"li":[{"a":{"href":"http://www.mtv.com","content":"MTV"},"class":"subLevel"},{"a":{"href":"http://www.mtv2.com","content":"MTV2"},"class":"subLevel"},{"a":{"href":"http://www.tr3s.com","content":"Tr3s"},"class":"subLevel"},{"a":{"href":"http://www.mtvu.com","content":"mtvU"},"class":"subLevel"},{"a":{"href":"http://www.mtvhive.com/","content":"MTV Hive"},"class":"subLevel"},{"a":{"href":"http://www.mtv.com/geek/","content":"MTV Geek!"},"class":"subLevel"},{"a":{"href":"http://www.mtviggy.com","content":"MTV Iggy"},"class":"subLevel"},{"a":{"href":"http://act.mtv.com","content":"MTV Act"},"class":"subLevel"},{"a":{"href":"http://www.mtv.com/directory/","content":"All MTV Sites"},"class":"subLevel"}]},"class":"topLevel"},"id":"mtvSitesNav"},"class":"memberbarlinks"},{"data-widget":"userBar","class":"flux4Widget","id":"wUserBar"},{"data-widget":"userProfile","class":"flux4Widget","id":"wUserProfile"}],"id":"memberbar"},{"a":{"href":"/","content":"mtv"},"id":"mtvLogo"},{"class":"navLogoToolTip","content":"MTV Home"},{"form":{"input":{"value":"SEARCH","type":"text","name":"searchterm","id":"searchmtv-text"},"action":"/search/","onsubmit":"return false;","name":"search","button":[{"class":"mtv","content":"GO","id":"searchmtv-btn"},{"class":"web","content":"WEB","id":"searchweb-btn"}],"method":"get"},"id":"searchmtv"}],"ul":[{"li":[{"a":{"href":"/music/video/","content":"music videos"},"class":"first"},{"a":{"href":"/videos/home.jhtml","content":"full episodes"},"class":""},{"a":{"href":"/ontv/schedule/","content":"tv schedule"},"class":""},{"a":{"href":"/music/artists/browse.jhtml?chars=a","content":"artists a-z"},"class":""},{"a":{"href":"/movies/trailer_park/","content":"movie trailers"},"class":""},{"a":{"href":"http://style.mtv.com/","content":"style"},"class":""},{"a":{"href":"/games/arcade/","content":"online games"},"class":""},{"a":{"href":"/mobile/","content":"mobile"},"class":""},{"a":{"href":"http://shop.mtv.com/?utm_source=mtvcom&utm_medium=topnav","content":"shop"},"class":""}],"id":"topnavLinks"},{"li":[{"a":{"href":"http://www.mtv.com/music/","class":"n-link music","content":"Music","id":"music"},"ul":{"class":"gridContainer","li":{"div":{"ul":[{"class":"gridMain","li":[{"a":{"href":"/music/","content":"Music Main"}},{"a":{"href":"/music/artists/browse.jhtml?chars=a","content":"All Artists"}},{"a":{"href":"http://buzzworthy.mtv.com/","content":"Buzzworthy Music Blog"}},{"a":{"href":"/news/#music/","content":"Music News"},"id":"newsMain2Tab"},{"a":{"href":"/music/radio/index.jhtml","content":"Radio"}},{"a":{"href":"/lyrics/","content":"Lyrics"}},{"a":{"href":"/music/videos/","content":"Music Video Charts"}},{"a":{"href":"/music/artists/browse.jhtml","content":"Artists A-Z"}},{"a":[{"href":"/music/artists/browse.jhtml?chars=a","content":"A"},{"href":"/music/artists/browse.jhtml?chars=b","content":"B"},{"href":"/music/artists/browse.jhtml?chars=c","content":"C"},{"href":"/music/artists/browse.jhtml?chars=d","content":"D"},{"href":"/music/artists/browse.jhtml?chars=e","content":"E"},{"href":"/music/artists/browse.jhtml?chars=f","content":"F"},{"href":"/music/artists/browse.jhtml?chars=g","content":"G"},{"href":"/music/artists/browse.jhtml?chars=h","content":"H"},{"href":"/music/artists/browse.jhtml?chars=i","content":"I"},{"href":"/music/artists/browse.jhtml?chars=j","content":"J"},{"href":"/music/artists/browse.jhtml?chars=k","content":"K"},{"href":"/music/artists/browse.jhtml?chars=l","content":"L"},{"href":"/music/artists/browse.jhtml?chars=m","content":"M"},{"href":"/music/artists/browse.jhtml?chars=n","content":"N"},{"href":"/music/artists/browse.jhtml?chars=o","content":"O"},{"href":"/music/artists/browse.jhtml?chars=p","content":"P"},{"href":"/music/artists/browse.jhtml?chars=q","content":"Q"},{"href":"/music/artists/browse.jhtml?chars=r","content":"R"},{"href":"/music/artists/browse.jhtml?chars=s","content":"S"},{"href":"/music/artists/browse.jhtml?chars=t","content":"T"},{"href":"/music/artists/browse.jhtml?chars=u","content":"U"},{"href":"/music/artists/browse.jhtml?chars=v","content":"V"},{"href":"/music/artists/browse.jhtml?chars=w","content":"W"},{"href":"/music/artists/browse.jhtml?chars=x","content":"X"},{"href":"/music/artists/browse.jhtml?chars=y","content":"Y"},{"href":"/music/artists/browse.jhtml?chars=z","content":"Z"},{"href":"/music/artists/browse.jhtml?chars=.","content":"#"}],"class":"gridMainBrowseAll"}]},{"class":"centerCol","li":[{"class":"first","span":"Music Videos"},{"a":{"href":"/music/video/","content":"MTV Picks"}},{"a":{"href":"/most-popular/music-videos/?metric=numberOfViews&range=today&order=desc","content":"Most Popular"}},{"a":{"href":"/music/video/premieres.jhtml","content":"Video Premieres"}},{"a":{"href":"/videos/?id=1568964","content":"MTV2 Video Premieres"}},{"a":{"href":"/music/playlists/","content":"Playlists"}},{"a":{"href":"/music/live_performances/","content":"Live Performances"}},{"a":{"href":"http://www.mtvhive.com/hd/","target":"_blank","content":"Live Concerts in HD"}},{"a":{"href":"/music/yearbook/","content":"Top Music Videos By Year"}}]},{"class":"centerCol","li":[{"class":"first","span":"Artists"},{"a":{"href":"/music/artists/browse.jhtml?chars=a","content":"Browse A-Z"}},{"a":{"href":"/music/artists/","content":"Our Picks"}},{"a":{"href":"/music/artists/most_popular.jhtml","content":"Most Popular"}},{"a":{"href":"/music/artists/push.jhtml","content":"PUSH: Artist Of The Week"}},{"a":{"href":"/music/posted/tech-n9ne/","content":"Tech N9ne: Posted"}},{"a":{"href":"http://www.mtvmusicmeter.com/","target":"_blank","content":"MTV Music Meter: New Artists Ranking"}},{"a":{"href":"/music/photos/","content":"Exclusive Artist Photos"}}]},{"class":"centerCol","li":[{"class":"first","span":"Specials"},{"a":{"href":"/specials/best_of/","content":"Best Of 2011"}},{"a":{"href":"/shows/ema/series.jhtml","content":"2011 EMA"}},{"a":{"href":"http://www.mtvhive.com/watch/live_in_nyc/","target":"_blank","content":"Live In NYC"}},{"a":{"href":"/music/unplugged/","content":"MTV Unplugged"}},{"a":{"href":"/ontv/woodieawards/","content":"mtvU Woodie Awards"}},{"a":{"href":"http://www.omusicawards.com/","target":"_blank","content":"O Music Awards"}},{"a":{"href":"/ontv/vma/","content":"Video Music Awards"}}]},{"ul":[{"class":"rightBlock split","li":[{"class":"first","span":"pop"},{"a":{"href":"/most-popular/music-videos/?category=pop&metric=numberOfViews&range=today&order=desc","content":"Pop Music Videos"}},{"a":{"href":"http://buzzworthy.mtv.com/","content":"Buzzworthy Blog"}},{"a":{"href":"http://blog.rhapsody.com/?textnavblog","target":"_blank","content":"Rhapsody Blog"}}]},{"class":"rightBlock ","li":[{"class":"first","span":"Rock"},{"a":{"href":"/music/rock/","content":"Rock Main"}},{"a":{"href":"/shows/headbangers_ball/series.jhtml","content":"Headbangers Ball"}}]}],"class":"centerCol"},{"ul":[{"class":"rightBlock split","li":[{"class":"first","span":"Hip-Hop"},{"a":{"href":"/music/hiphop/","content":"Hip-Hop Main"}},{"a":{"href":"/shows/sucker_free/series.jhtml","content":"Sucker Free"}},{"a":{"href":"http://rapfix.mtv.com/","content":"RapFix Blog"}},{"a":{"href":"/news/topic/mixtape_daily/","content":"Mixtape Daily"}},{"a":{"href":"/shows/yo_mtv_raps_classic_cuts/series.jhtml","content":"Yo! MTV Raps Classic Cuts"}}]},{"class":"rightBlock ","li":[{"class":"first","span":"indie"},{"a":{"href":"http://www.mtvhive.com/","target":"_blank","content":"MTV Hive"}},{"a":{"href":"http://www.mtvhive.com/watch/120_minutes/","target":"_blank","content":"120 Minutes"}},{"a":{"href":"http://www.mtvhive.com/watch/weird_vibes/","target":"_blank","content":"Weird Vibes"}}]}],"class":"centerCol last"}],"class":"grid","id":"music-grid"}}},"class":"toplvl","id":"n-music"},{"class":"seperator","content":"|"},{"a":{"href":"http://www.mtv.com/ontv/","class":"n-link shows","content":"Shows","id":"shows"},"ul":{"class":"gridContainer","li":{"div":{"ul":[{"class":"gridMain","li":[{"a":{"href":"/ontv/","content":"Shows Main"}},{"a":{"href":"/ontv/all/","content":"All Shows"}},{"a":{"href":"/ontv/schedule/","content":"TV Schedule"}},{"a":{"href":"http://remotecontrol.mtv.com","content":"MTV Shows Gossip Blog"}},{"a":{"href":"http://www.mtv.com/most-popular/tv-show-videos/?category=full-episodes&metric=numberOfViews&range=today&order=desc","content":"Most Popular Video"}},{"a":{"href":"/ontv/photos/","content":"Show Photos"}},{"a":{"href":"/ontv/castingcall/","content":"Be on MTV"}},{"a":{"href":"http://shop.mtv.com/content/Shows.htm?utm_source=mtv:site:topnav:shows","target":"_blank","content":"Shop MTV Shows"}}]},{"ul":[{"li":[{"a":{"href":"/shows/10_on_top/series.jhtml","content":"10 on Top"}},{"a":{"href":"/shows/16_and_pregnant/season_3/series.jhtml","content":"16 and Pregnant"}},{"a":{"href":"/shows/dance_crew/series.jhtml","content":"America's Best Dance Crew"}},{"a":{"href":"/shows/awkward/series.jhtml","content":"Awkward."}},{"a":{"href":"/shows/beavis_and_butthead/series.jhtml","content":"Beavis and Butt-Head"}},{"a":{"href":"/shows/caged/series.jhtml","content":"Caged"}},{"a":{"href":"/shows/rwrr_challenge/battle_of_the_exes/series.jhtml","content":"The Challenge: Battle Of The Exes"}},{"a":{"href":"/shows/disaster_date/series.jhtml","content":"Disaster Date"}}]},{"li":[{"a":{"href":"/shows/friendzone/series.jhtml","content":"Friendzone"}},{"a":{"href":"/shows/good_vibes/series.jhtml","content":"Good Vibes"}},{"a":{"href":"/shows/i_just_want_my_pants_back/series.jhtml","content":"I Just Want My Pants Back"}},{"a":{"href":"/shows/i_used_to_be_fat/series.jhtml","content":"I Used To Be Fat"}},{"a":{"href":"/shows/jersey_shore/series.jhtml","content":"Jersey Shore"}},{"a":{"href":"/shows/made/series.jhtml","content":"MADE"}},{"a":{"href":"/music/unplugged/","content":"MTV Unplugged"}},{"a":{"href":"/shows/punkd/series.jhtml","content":"Punk'd"}},{"a":{"href":"/shows/real_world/san_diego/series.jhtml","content":"Real World: San Diego"}}]},{"li":[{"a":{"href":"/shows/ridiculousness/series.jhtml","content":"Ridiculousness"}},{"a":{"href":"/shows/fantasy_factory/season_4/series.jhtml","content":"Rob Dyrdek's Fantasy Factory"}},{"a":{"href":"/shows/teen_mom/season_3/series.jhtml","content":"Teen Mom"}},{"a":{"href":"/shows/teen_mom_2/season_2/series.jhtml","content":"Teen Mom 2"}},{"a":{"href":"/shows/teen_wolf/series.jhtml","content":"Teen Wolf"}},{"a":{"href":"/shows/truelife/series.jhtml","content":"True Life"}},{"a":{"href":"/shows/when_i_was_17/series.jhtml","content":"When I Was 17"}},{"a":{"href":"/shows/world_of_jenks/season_2/series.jhtml","content":"World of Jenks"}},{"a":{"href":"/ontv/all/","class":"allshows","content":"All Shows"},"class":"allshowsLabel"}]}],"class":"centerCol wide","li":{"class":"first","span":"Popular Shows"}},{"class":"centerCol","li":[{"class":"first","span":"specials"},{"a":{"href":"/shows/my_super_psycho_sweet_16/series.jhtml","content":"My Super Psycho Sweet 16: Part 3"}},{"a":{"href":"/ontv/woodieawards/2012/","content":"mtvU Woodie Awards"}},{"a":{"href":"/shows/spring_break/2012/series.jhtml","content":"Spring Break"}},{"a":{"href":"/shows/it_gets_better/series.jhtml","content":"It Gets Better"}},{"a":{"href":"/ontv/movieawards/","content":"Movie Awards"}},{"a":{"href":"/ontv/vma/","content":"Video Music Awards"}},{"a":{"href":"http://www.omusicawards.com/","target":"_blank","content":"O Music Awards"}}]},{"class":"centerCol last","li":[{"class":"first","span":"classics"},{"a":{"href":"/shows/aeon_flux/series.jhtml","content":"Aeon Flux"}},{"a":{"href":"/ontv/dyn/celebrity_deathmatch/series.jhtml","content":"Celebrity Deathmatch"}},{"a":{"href":"/shows/daria/series.jhtml","content":"Daria"}},{"a":{"href":"/shows/the_hills/series.jhtml","content":"The Hills"}},{"a":{"href":"/shows/laguna_beach/season_1/series.jhtml","content":"Laguna Beach"}},{"a":{"href":"/ontv/dyn/the_maxx/series.jhtml","content":"The Maxx"}},{"a":{"href":"/ontv/dyn/pimp_my_ride/series.jhtml","content":"Pimp My Ride"}},{"a":{"href":"/ontv/dyn/trl/series.jhtml","content":"TRL"}},{"a":{"href":"/music/yo_mtv_raps/","content":"Yo! MTV Raps"}}]}],"class":"grid","id":"shows-grid"}}},"class":"toplvl","id":"n-shows"},{"class":"seperator","content":"|"},{"a":{"href":"http://www.mtv.com/news/","class":"n-link news","content":"News","id":"news"},"ul":{"class":"gridContainer","li":{"div":{"ul":[{"class":"gridMain","li":[{"a":{"href":"/news/","content":"News Main"}},{"a":{"href":"http://www.facebook.com/mtvnews","target":"_blank","content":"MTV News On Facebook"}},{"a":{"href":"/news/videos/","content":"Video News & Interviews"}},{"a":{"href":"http://exodus.mtv.com/site/signup","content":"MTV News Daily Newsletter"}}]},{"class":"centerCol","li":[{"class":"first","span":"news categories"},{"a":{"href":"/news/#breaking","content":"Breaking News"},"id":"newsMain1Tab"},{"a":{"href":"/news/#music","content":"Music News"},"id":"newsMain2Tab"},{"a":{"href":"/news/#movienews","content":"Movie News"},"id":"newsMain3Tab"},{"a":{"href":"/news/#celebrity","content":"Celebrity News"},"id":"newsMain4Tab"},{"a":{"href":"/news/photo/index.jhtml","content":"News Photos"}}]},{"class":"centerCol","li":[{"class":"first","span":"newsroom blog"},{"a":{"href":"http://newsroom.mtv.com/","content":"Latest Posts"}},{"a":{"href":"http://newsroom.mtv.com/category/top_categories/behind-the-scenes/","content":"Behind The Scenes"}},{"a":{"href":"http://newsroom.mtv.com/category/top_categories/television/","content":"Television"}}]},{"class":"centerCol last","li":[{"class":"first","span":"rapfix hip-hop blog"},{"a":{"href":"http://rapfix.mtv.com/","content":"Latest Posts"}},{"a":{"href":"http://rapfix.mtv.com/category/music-news/","content":"Hip-Hop News"}},{"a":{"href":"http://rapfix.mtv.com/category/rapfix-live/","content":"RapFix Live"}},{"a":{"href":"http://rapfix.mtv.com/category/interviews/","content":"Interviews"}}]}],"class":"grid","id":"news-grid"}}},"class":"toplvl","id":"n-news"},{"class":"seperator","content":"|"},{"a":{"href":"http://www.mtv.com/movies/","class":"n-link last movies","content":"Movies","id":"movies"},"ul":{"class":"gridContainer","li":{"div":{"ul":[{"class":"gridMain","li":[{"a":{"href":"/movies/","content":"Movies Main"}},{"a":{"href":"/movies/photo/","content":"Red Carpet & On Set Photos"}},{"a":{"href":"http://exodus.mtv.com/site/signup","content":"Movies Insider Newsletter"}}]},{"class":"centerCol","li":[{"class":"first","span":"news & video"},{"a":{"href":"/movies/features_interviews/morevideo.jhtml","content":"Interviews"}},{"a":{"href":"/movies/trailer_park/","content":"Trailers"}},{"a":{"href":"/news/#movie","content":"Movie News"},"id":"newsMain3Tab"},{"a":{"href":"/shows/after_hours_josh_horowitz/series.jhtml","content":"After Hours With Josh Horowitz"}}]},{"class":"centerCol","li":[{"class":"first","span":"movies blog"},{"a":{"href":"http://moviesblog.mtv.com/","content":"Latest Posts"}},{"a":{"href":"http://moviesblog.mtv.com/category/humor/","content":"Humor"}},{"a":{"href":"http://moviesblog.mtv.com/category/commentary/","content":"Commentary"}},{"a":{"href":"http://moviesblog.mtv.com/tag/harry-potter/","content":"'Harry Potter' News"}}]},{"class":"centerCol","li":[{"class":"first","span":"teen hollywood blog"},{"a":{"href":"http://hollywoodcrush.mtv.com/","content":"Latest Posts"}},{"a":{"href":"http://hollywoodcrush.mtv.com/category/twilight-categories/","content":"'Twilight' News"}},{"a":{"href":"http://hollywoodcrush.mtv.com/category/eye-candy/","content":"Eye Candy"}},{"a":{"href":"http://hollywoodcrush.mtv.com/category/loveactually/","content":"Celebrity Couples"}},{"a":{"href":"http://hollywoodcrush.mtv.com/tag/hunger-games/","content":"'Hunger Games' News"}}]},{"class":"centerCol last","li":[{"class":"first","span":"comic movies blog"},{"a":{"href":"http://splashpage.mtv.com/","content":"Latest Posts"}},{"a":{"href":"http://splashpage.mtv.com/tag/the-dark-knight-rises","content":"'Dark Knight Rises' News"}},{"a":{"href":"http://splashpage.mtv.com/tag/the-walking-dead","content":"'Walking Dead' News"}},{"a":{"href":"http://splashpage.mtv.com/tag/the-avengers/","content":"'Avengers' News"}}]}],"class":"grid","id":"movies-grid"}}},"class":"toplvl","id":"n-movies"}],"id":"navlist"}],"class":"globalNav","id":"nav"}};

this.fnHeaderObj = {"div":{"div":{"div":[{"data-widget":"userBar","class":"flux4Widget","id":"wUserBar"},{"data-widget":"userProfile","class":"flux4Widget","id":"wUserProfile"}],"id":"memberbar"},"ul":{"class":"franchise-nav","li":[{"a":{"href":"http://www.mtv.com/ontv/fn-mtv/","class":"n-link ","content":"Home"},"class":"toplvl","id":"n-"},{"a":{"href":"http://www.mtv.com/ontv/fn-mtv/music-videos.jhtml","class":"n-link ","content":"Music Videos"},"class":"toplvl","id":"n-"},{"a":{"href":"http://www.mtv.com/ontv/fn-mtv/uploads.jhtml","class":"n-link ","content":"Fan Uploads"},"class":"toplvl","id":"n-"},{"a":{"href":"http://www.mtv.com/ontv/fn-mtv/playlists.jhtml","class":"n-link ","content":"Classic Videos"},"class":"toplvl","id":"n-"},{"a":{"href":"http://www.mtv.com/ontv/fn-mtv/photos.jhtml","class":"n-link ","content":"Photos"},"class":"toplvl","id":"n-"},{"a":{"href":"http://community.mtv.com/Content/Discussions/DiscussionBoard.aspx?catId=19368","target":"_blank","class":"n-link ","content":"Message Boards"},"class":"toplvl","id":"n-"},{"a":{"href":"http://www.mtv.com/ontv/fn-mtv/about.jhtml","class":"n-link last about","content":"About","id":"about"},"class":"toplvl","id":"n-about"}],"id":"navlist"},"class":"franchise franchise-navigation","id":"nav"}};

this.create = function(name, contextNodeID){
switch(name){
case 'css': this.addCSS(); break;
case 'hat': this.setHat(); break;
case 'nav': Community.Widgets.createNav(contextNodeID); break;
case 'artistlist': Community.Widgets.createArtistlist(contextNodeID); break;
case 'footer': Community.Widgets.createFooter(contextNodeID); break;
case 'search': Community.Widgets.createSearch(contextNodeID); break;
default: break;
}
}

this.createSearch = function(contextNodeID){
var div = document.createElement('div');
div.innerHTML = '<' + 'iframe src="' + Community.Widgets.hostname + '/widgets/search/iframe.jhtml" width="321" height="33" frameborder="0" scrolling="no" style="float:right;">search mtv</iframe>';
var contextNode = document.getElementById(contextNodeID);
if (contextNode) contextNode.appendChild(div);
}

this.createNav = function(contextNodeId, headerObj){
var obj = (headerObj!=null) ? headerObj : Community.Widgets.headerObj;

if( obj ){

if(obj.div['class'] == 'franchise franchise-navigation') {
var container = document.getElementById(contextNodeId);
container.appendChild(Community.Widgets.createUL(obj.div.ul)); // Append NavList
} else if ( obj.div['class'] == 'globalNav' ) {
var container = document.getElementById(contextNodeId);

// Add class / id data to nav container
container.setAttribute('id', obj.div.id);
container.className = obj.div['class'];

memberbarDiv = document.getElementById('memberbar');
memberbarPlaceholder = document.getElementById('memberbar_insert_placeholder');
try {
memberbarLinks = Community.Widgets.createDiv(obj.div.div[0].div[0]);
memberbarDiv.insertBefore(memberbarLinks, memberbarPlaceholder); // Append memberbar Links to memberbar

if(this.Flux4 == true) {
fluxUserBar = Community.Widgets.createDiv(obj.div.div[0].div[1]);
fluxProfile = Community.Widgets.createDiv(obj.div.div[0].div[2]);
fluxUserBar.setAttribute('data-widget','userBar');
fluxProfile.setAttribute('data-widget','userProfile');
memberbarDiv.insertBefore(fluxUserBar, memberbarPlaceholder); // Append userbar to memberbar
memberbarDiv.insertBefore(fluxProfile, memberbarPlaceholder); // Append profile to memberbar
$j(function() {
// Handler for .ready() called.
$j(".flux4Widget").flux4();
});
}

aList = memberbarDiv.getElementsByTagName("a");

memberbarLinks.insertBefore(Community.Widgets.createUL(obj.div.div[0].ul), aList[1]);

}
catch(e){}

container.appendChild(Community.Widgets.createDiv(obj.div.div[1]), false); // Append MTV Logo
container.appendChild(Community.Widgets.createUL(obj.div.ul[0])); // Append TopNavLinks
container.appendChild(Community.Widgets.createUL(obj.div.ul[1])); // Append NavList
container.appendChild(Community.Widgets.createDiv(obj.div.div[2]), false); // Append LogoToolTip
container.appendChild(Community.Widgets.createDiv(obj.div.div[3]), false); // Append search
}

}
}

this.footerObj = {"div":{"div":[{"div":[{"a":{"href":"/","img":{"src":"/sitewide/images/u/logo-mtv-white-small.gif","alt":"MTV HOME"},"id":"gft-search-logo"},"class":"gft-search-logo"},{"a":[{"href":"http://www.mtv.com/music/","class":"gft-search-hi","content":"MUSIC"},{"href":"http://www.mtv.com/ontv/","class":"gft-search-hi","content":"SHOWS"},{"href":"http://www.mtv.com/news/","class":"gft-search-hi","content":"NEWS"},{"href":"http://www.mtv.com/movies/","class":"gft-search-hi","content":"MOVIES"},{"href":"http://www.mtv.com/videos/home.jhtml","content":"FULL EPISODES"},{"href":"http://www.mtv.com/ontv/schedule/","content":"TV SCHEDULE"},{"href":"http://www.mtv.com/music/videos/","content":"MUSIC VIDEOS"},{"href":"http://www.mtv.com/movies/trailer_park/","content":"MOVIE TRAILERS"},{"href":"http://www.mtv.com/music/artists/browse.jhtml?chars=a","content":"BROWSE ARTISTS A-Z"},{"href":"http://www.mtv.com/music/radio/","content":"RADIO"},{"href":"http://www.mtv.com/games/arcade/","content":"ONLINE GAMES"},{"href":"http://www.mtv.com/mobile/","content":"MOBILE"},{"href":"http://www.mtv.com/toolbar/main/home/download.jhtml?xrs=toolbar_footer_2","content":"DOWNLOAD MTV DIRECT"}],"class":"gft-search-links"},{"form":{"input":{"value":"SEARCH","type":"text","name":"searchterm","id":"searchmtvF-text"},"action":"/search/","onsubmit":"return false;","name":"searchF","button":[{"class":"mtv","content":"GO","id":"searchmtvF-btn"},{"class":"web","content":"WEB","id":"searchwebF-btn"}],"method":"get"},"id":"searchmtvF"}],"class":"gft-row","id":"gft-search"},{"div":{"ul":[{"class":"gft-col","li":[{"class":"gft-col-header","content":"MTV BLOGS"},{"a":{"href":"http://labsblog.mtv.com/","content":"Labs"}},{"a":{"href":"http://buzzworthy.mtv.com/","content":"Buzzworthy Blog"}},{"a":{"href":"http://clutch.mtv.com/","content":"Guys Blog"}},{"a":{"href":"http://hollywoodcrush.mtv.com/","content":"Hollywood Crush"}},{"a":{"href":"http://moviesblog.mtv.com/","content":"Movies Blog"}},{"a":{"href":"http://hatsblog.mtv.com/","content":"MTV Hats Blog"}},{"a":{"href":"http://style.mtv.com/","content":"MTV Style"}},{"a":{"href":"http://multiplayerblog.mtv.com/","content":"Multiplayer Blog"}},{"a":{"href":"http://newsroom.mtv.com/","content":"Newsroom"}},{"a":{"href":"http://remotecontrol.mtv.com/","content":"Remote Control Blog"}},{"a":{"href":"http://splashpage.mtv.com/","content":"Splash Page"}},{"a":{"href":"http://your.mtv.com/","content":"You R Here Blog"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"MORE MTV"},{"a":{"href":"http://www.mtv.com/geek/","content":"MTV Geek!"}},{"a":{"href":"http://act.mtv.com/","content":"MTV Act"}},{"a":{"href":"http://shop.mtv.com/","content":"MTV Shop"}},{"a":{"href":"http://www.mtviggy.com/","content":"MTV Iggy"}},{"a":{"href":"http://www.getschooled.com/","content":"Get Schooled"}},{"a":{"href":"http://www.mtv.com/sites/?_requestid=179859","content":"Directory of MTV Sites"}},{"a":{"href":"http://www.mtv.com/ontv/castingcall/","content":"Casting"}},{"a":{"href":"http://www.mtv.com/sweepstakes/","content":"Sweepstakes and Contests"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"STAY CONNECTED"},{"a":{"href":"http://www.facebook.com/MTV","content":"MTV On Facebook"}},{"a":{"href":"http://twitter.com/MTV","content":"MTV On Twitter"}},{"a":{"href":"http://www.myspace.com/mtv","content":"MTV On MySpace"}},{"a":{"href":"/partners/newsletters/index.jhtml","content":"Newsletters"}},{"a":{"href":"http://www.mtv.com/rss/","content":"RSS"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"FEEDBACK / HELP"},{"a":{"href":"http://community.mtv.com/Content/Discussions/DiscussionResults.aspx?tcid=22916","content":"Site Feedback"}},{"a":{"href":"http://community.mtv.com/Content/Discussions/DiscussionResults.aspx?tcid=22922","content":"Suggestion Box"}},{"a":{"href":"http://community.mtv.com/Content/Discussions/DiscussionResults.aspx?tcid=22921","content":"Community Feedback"}},{"a":{"href":"http://community.mtv.com/Content/Discussions/DiscussionResults.aspx?tcid=22920","content":"Technical Support"}},{"a":{"href":"/sitewide/legal/tips_and_resources.jhtml","content":"Dealing With An Issue? Get Help Now"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"TERMS / POLICY"},{"a":{"href":"/sitewide/legal/terms.jhtml","content":"Terms of Use"}},{"a":{"href":"/sitewide/legal/privacy.jhtml","content":"Privacy Policy / Your CA Privacy Rights"}},{"a":{"href":"/sitewide/legal/copyright_compliance.jhtml","content":"Copyright Compliance Policy"}},{"a":{"href":"http://www.mtv.com/sitewide/legal/community_guidelines.jhtml","content":"Community Guidelines"}},{"a":{"href":"/sitewide/legal/user_content.jhtml","content":"User Content Submission Agreement"}},{"a":{"href":"http://www.socialproject.com/PrivacyPolicy.html","content":"Social Project Privacy Policy"}},{"a":{"href":"http://www.socialproject.com/TermsOfUse.html","content":"Social Project Terms Of Use"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"CORPORATE"},{"a":{"href":"http://www.mtvnetworkscareers.com/","content":"MTV Jobs"}},{"a":{"href":"http://mtvndigital.com/","content":"Advertising Opportunities"}},{"a":{"href":"http://offer.rhapsody.com/?footer","content":"Rhapsody"}},{"a":{"href":"http://eventful.com","content":"Eventful"}},{"a":{"href":"http://www.mtv.com/partners/mtv_tribe/index.jhtml","content":"Partners"}}]}],"class":"gft-row-subrow"},"class":"gft-row","id":"gft-brand"},{"div":[{"span":{"class":"mtv-logo-wide","content":"MTV Logo:"},"id":"gft-logo"},{"content":"&#169;2012 Viacom International Inc. All Rights Reserved. MTV and all related titles and logos are trademarks of Viacom International Inc.","id":"gft-copy"},{"a":{"href":"http://srp.mtvn.com/sitefaq.html","span":{"class":"mtv-adChoicesLogo","content":"Ad Choices logo"}},"id":"gft-adChoicesLogo"},{"a":{"href":"http://srp.mtvn.com/sitefaq.html","content":"Ad Choices"},"id":"gft-adChoicesCopy"}],"id":"gft-mtvnetworks"}],"class":"noindex","id":"gft"}};

this.createFooter = function(contextNodeId){
var obj = Community.Widgets.footerObj;

if (obj.div){
var container = document.getElementById(contextNodeId);

var div = document.createElement('div');
if(obj.div.id) div.setAttribute('id', obj.div.id);

for (var x=0; x<obj.div.div.length; x++){
div.appendChild(Community.Widgets.createDiv(obj.div.div[x]));
}
container.appendChild(div);
}
}

this.createArtistlist = function(contextNodeId){
var obj = Community.Widgets.headerObj.div.div[0].ul;
if(obj){
var container = document.getElementById(contextNodeId);
var ul = Community.Widgets.createUL(obj);
container.appendChild(ul);
}
}

this.createP = function(p, useSeparator){
var pElement = document.createElement('p');
if(p.id) pElement.setAttribute('id', p.id);
if(p['class']) pElement.className = p['class'];

if (p.a){
for (var x=0; x<p.a.length; x++){
pElement.appendChild(Community.Widgets.createA(p.a[x]));
if (x<p.a.length-1 && useSeparator && !p.a[x].img) pElement.appendChild(document.createTextNode("|"));
}
}
else{ pElement.innerHTML = p.content; }
return pElement;
}

this.createScript = function(scriptcontent) {

var scriptElement = document.createElement('script');

if(scriptcontent.src) {
scriptElement.setAttribute('src', scriptcontent.src);
} else {
scriptElement.innerHTML = scriptcontent;
}
return scriptElement;
}

this.createImg = function(img){
var imgElement = document.createElement('img');
if(img.id) imgElement.setAttribute('id', img.id);

if(img['class']) imgElement.className = img['class'];
if(img.height) imgElement.setAttribute('height', img.height);
if(img.width) imgElement.setAttribute('width', img.width);
if(img.src) {
if(img.src.substr(0,1) == '/') {
imgElement.setAttribute('src', Community.Widgets.baseUrl + img.src);
} else {
imgElement.setAttribute('src', img.src);
}
}
if(img.border) imgElement.setAttribute('border', img.border);
if(img.alt) imgElement.setAttribute('alt', img.alt);

return imgElement;
}

this.createUL = function(ul){

var ulElement = document.createElement('ul');

if(ul.id) ulElement.setAttribute('id', ul.id);

if(ul['class']) ulElement.className = ul['class'];

if(ul.li) {
if(ul.li instanceof Array) {
for (var x=0; x<ul.li.length; x++){
ulElement.appendChild(Community.Widgets.createLI(ul.li[x]));
}
} else {
ulElement.appendChild(Community.Widgets.createLI(ul.li));
}
}
if(ul.ul) {
if(ul.ul instanceof Array) {
for(var x=0; x<ul.ul.length; x++) {
ulElement.appendChild(Community.Widgets.createUL(ul.ul[x]));
}
} else {
ulElement.appendChild(Community.Widgets.createUL(ul.ul));
}
}

return ulElement;
}

this.createLI = function(li){

var liElement = document.createElement('li');

if(li.content) liElement.innerHTML = li.content;

if(li.id) liElement.setAttribute('id', li.id);
if(li['class']) liElement.className = li['class'];

if(li.a) {
if(li.a instanceof Array) {
for( var i=0; i<li.a.length; i++ ) {
liElement.appendChild(Community.Widgets.createA(li.a[i]));
}
} else {
liElement.appendChild(Community.Widgets.createA(li.a));
}
}

if(li.span){
if(li.span instanceof Array){
for (var i=0; i<li.span.length; i++){
liElement.appendChild(Community.Widgets.createSpan(li.span[i]));
}
}
else liElement.appendChild(Community.Widgets.createSpan(li.span));
}

if (li.ul) liElement.appendChild(Community.Widgets.createUL(li.ul));

if (li.div) liElement.appendChild(Community.Widgets.createDiv(li.div));

/*
if (window.attachEvent){
liElement.onmouseover=function() {	this.className+=" sfhover";	}
liElement.onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); }
}
*/
return liElement;
}

this.createDiv = function(div, useSeparator){

var divElement = document.createElement('div');

if(div.id) divElement.setAttribute('id', div.id);
if(div['class']) divElement.className = div['class'];

if(div.div instanceof Array){
for (var i=0; i<div.div.length; i++){
divElement.appendChild(Community.Widgets.createSubDiv(div.div[i], useSeparator));
}

}
else if(div.div instanceof Object && div.div.div instanceof Array){
for (var i=0; i<div.div.div.length; i++){
divElement.appendChild(Community.Widgets.createSubDiv(div.div.div[i], useSeparator));
}
}
else if(div.div instanceof Object && div.div.a instanceof Array){
var divContainer = document.createElement('div');
if(div.div.id) divContainer.setAttribute('id', div.div.id);
if(div['class']) divContainer.className = div['class'];
divElement.appendChild(divContainer);

for (var i=0; i<div.div.a.length; i++){
divContainer.appendChild(Community.Widgets.createA(div.div.a[i]));
if (i<div.div.a.length-1 && useSeparator && !div.div.a[i].img) divContainer.appendChild(document.createTextNode(" | "));
}
}
else if(div.div instanceof Object){
divElement.appendChild(Community.Widgets.createDiv(div.div));
}

if( div.ul ) {

if( div.ul instanceof Array ) {
for( var i = 0; i< div.ul.length; i++ ) {
divElement.appendChild(Community.Widgets.createUL(div.ul[i]));
}
} else {
divElement.appendChild(Community.Widgets.createUL(div.ul));
}
}

if(div.dl instanceof Array){
for (var i=0; i<div.dl.length; i++){
var dl = div.dl[i];
var dlElement = document.createElement('dl');
if(dl.id) dlElement.setAttribute('id', dl.id);
if(dl.dt){
var dtElement = document.createElement('dt');
dtElement.innerHTML = dl.dt;
dlElement.appendChild(dtElement);
}

if(dl.dd instanceof Array){
for (var j=0; j<dl.dd.length; j++){
var ddElement = document.createElement('dd');
ddElement.appendChild(Community.Widgets.createA(dl.dd[j].a));
dlElement.appendChild(ddElement);
}
}

divElement.appendChild(dlElement);
}
}

if(div.span){
if(div.span instanceof Array){
for (var i=0; i<div.span.length; i++){
divElement.appendChild(Community.Widgets.createSpan(div.span[i]));
}
}
else divElement.appendChild(Community.Widgets.createSpan(div.span));
}

if(div.a){
if(div.a instanceof Array){
for (var i=0; i<div.a.length; i++){
divElement.appendChild(Community.Widgets.createA(div.a[i]));
if (i<div.a.length-1 && useSeparator && !div.a[i].img) divElement.appendChild(document.createTextNode(" | "));
}
}
else divElement.appendChild(Community.Widgets.createA(div.a));
}

if(div.p){
if(div.p instanceof Array){
for (var i=0; i<div.p.length; i++){
divElement.appendChild(Community.Widgets.createP(div.p[i], useSeparator));
}
}
else divElement.appendChild(Community.Widgets.createP(div.p, useSeparator));
}

if(div.img){
if(div.img instanceof Array){
for (var i=0;i<div.img.length;i++){
divElement.appendChild(Community.Widgets.createImg(div.img[i]));
}
}
else divElement.appendChild(Community.Widgets.createImg(div.img));
}

if(div.form)
divElement.appendChild(Community.Widgets.createForm(div.form));

if(div.content && !(div.content instanceof Array)){
divElement.innerHTML = div.content;
}

return divElement;
}

this.createSubDiv = function(subDiv, useSeparator){

var subDivElement = document.createElement('div');
if(subDiv.id) subDivElement.setAttribute('id', subDiv.id);
if(subDiv['class']) subDivElement.className = subDiv['class'];
if(subDiv.strong) subDivElement.appendChild(Community.Widgets.createStrong(subDiv.strong));

if(subDiv.span){
if(subDiv.span instanceof Array){
for (var i=0; i<subDiv.span.length; i++){
subDivElement.appendChild(Community.Widgets.createSpan(subDiv.span[i]));
}
}
else subDivElement.appendChild(Community.Widgets.createSpan(subDiv.span));
}

if(subDiv.a instanceof Array){
for (var i=0; i<subDiv.a.length; i++){
subDivElement.appendChild(Community.Widgets.createA(subDiv.a[i]));
if (i<subDiv.a.length-1 && useSeparator && !subDiv.a[i].img) subDivElement.appendChild(document.createTextNode(" | "));
}
}

if(subDiv.div instanceof Array){
for (var i=0; i<subDiv.div.length; i++){
subDivElement.appendChild(Community.Widgets.createSubDiv(subDiv.div[i], useSeparator));
}
}
else if(subDiv.div instanceof Object && subDiv.div.a instanceof Array){
for (var i=0; i<subDiv.div.a.length; i++){
subDivElement.appendChild(Community.Widgets.createA(subDiv.div.a[i]));
if (i<subDiv.div.a.length-1 && useSeparator && !subDiv.div.a[i].img) subDivElement.appendChild(document.createTextNode(" | "));
}
}

if(subDiv.div) subDivElement.appendChild(Community.Widgets.createDiv(subDiv.div, useSeparator));

if(subDiv.p){
if(subDiv.p instanceof Array){
for (var i=0; i<div.p.length; i++){
subDivElement.appendChild(Community.Widgets.createP(subDiv.p[i], useSeparator));
}
}
else subDivElement.appendChild(Community.Widgets.createP(subDiv.p, useSeparator));
}

if(subDiv.img){
if(subDiv.img instanceof Array){
for (var i=0;i<div.img.length;i++){
subDivElement.appendChild(Community.Widgets.createImg(subDiv.img[i]));
}
}
else subDivElement.appendChild(Community.Widgets.createImg(subDiv.img));
}

if(subDiv.content && !(subDiv.content instanceof Array)){
subDivElement.innerHTML = subDiv.content;
}

if(subDiv.ul) {
if( subDiv.ul instanceof Array ) {
for( var i = 0; i< subDiv.ul.length; i++ ) {
subDivElement.appendChild(Community.Widgets.createUL(subDiv.ul[i]));
}
} else {
subDivElement.appendChild(Community.Widgets.createUL(subDiv.ul));
}
}

return subDivElement;
}

this.createA = function(a){
var aElement = document.createElement('a');

if(a.id) aElement.setAttribute('id', a.id);
if(a['class']) aElement.className = a['class'];
if(a.href) {
if(a.href.substr(0,1) == '/') {
aElement.setAttribute('href', Community.Widgets.baseUrl + a.href);
} else {
aElement.setAttribute('href', a.href);
}
}
if(a.target) aElement.setAttribute('target', a.target);
if(a.onclick) aElement.setAttribute('onclick', a.onclick);
if(a.img){
aElement.appendChild(Community.Widgets.createImg(a.img));
}
else {
aElement.innerHTML = a.content;
}

return aElement;
}

this.createSpan = function(span){
var spanElement = document.createElement('span');

if(typeof span == 'object'){
if(span['class']) spanElement.className = span['class'];
if(span.content) spanElement.innerHTML = span.content;
if(span.a instanceof Array){
for(var i=0; i<span.a.length; i++){
spanElement.appendChild(Community.Widgets.createA(span.a[i]));
spanElement.innerHTML += "\n";
spanElement.appendChild(document.createTextNode(""));
}
}
}
else { spanElement.innerHTML = span + "\n";}

return spanElement;
}

this.createStrong = function(strong){
var strongElement = document.createElement('strong');
strongElement.innerHTML = strong;
return strongElement;
}

this.createForm = function(form) {
var formElement = document.createElement('form');
if(form.action) formElement.setAttribute('action', form.action);
if(form.method) formElement.setAttribute('method', form.method);
if(form.name) formElement.setAttribute('name', form.name);
if(form.id) formElement.setAttribute('id', form.id);
if(form.onsubmit) formElement.setAttribute('onsubmit', form.onsubmit);

formElement.appendChild(Community.Widgets.createInput(form.input));
formElement.appendChild(Community.Widgets.createButton(form.button[0]));
formElement.appendChild(Community.Widgets.createButton(form.button[1]));
return formElement;
}

this.createButton = function(button) {
var buttonElement = document.createElement('button');
if(button.id) buttonElement.setAttribute('id', button.id);
if(button['class']) buttonElement.className = button['class']
if(button.onclick) buttonElement.setAttribute('onclick', button.onclick);
buttonElement.innerHTML = button.content;
return buttonElement;
}

this.createInput = function(input) {
var inputElement = document.createElement('input');
if(input.id) inputElement.setAttribute('id', input.id);
if(input.name) inputElement.setAttribute('name', input.name);
if(input.onclick) inputElement.setAttribute('onclick', input.onclick);
if(input.onkeypress) inputElement.setAttribute('onkeypress', input.onkeypress);
if(input.type) inputElement.setAttribute('type', input.type);
if(input.value) inputElement.value = input.value;
return inputElement;
}
}

