Community = new function(){}

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.hostname = 'http://www.mtv.com';

this.headerObj = {"div":{"div":[{"div":[{"a":[{"href":"http://www.mtv.com","class":"first","content":"Home"},{"href":"http://labsblog.mtv.com/2009/09/02/mtvcom-home-page-and-navigation-change/","target":"_blank","class":"last","content":"New Homepage Feedback"}],"class":"memberbarlinks"},{"code":{"class":"hide"},"class":"fluxWidget","id":"wQuickMenu"}],"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.mtvtr3s.com","content":"MTV Tr3s"},"class":"subLevel"},{"a":{"href":"http://www.mtvu.com","content":"mtvU"},"class":"subLevel"},{"a":{"href":"http://www.mtviggy.com","content":"MTV Iggy"},"class":"subLevel"},{"a":{"href":"http://www.thinkmtv.com","content":"Think MTV"},"class":"subLevel"},{"a":{"href":"http://www.mtv.com/directory/","content":"All MTV Sites"},"class":"subLevel"}]},"class":"topLevel"},"id":"mtvSitesNav"},"id":"memberbar"},{"a":{"href":"/","content":"mtv"},"id":"mtvLogo"},{"class":"navLogoToolTip","content":"MTV Home"},{"form":{"input":{"value":"SEARCH","type":"text","onkeypress":"catchEnter(this.form, event);","onclick":"this.value='';","name":"searchterm","id":"searchmtv-text"},"action":"/search/","onsubmit":"return false;","name":"search","button":[{"content":"GO","onclick":"submitSearch(this.form, 0); return false;","id":"searchmtv-btn"},{"content":"WEB","onclick":"submitSearch(this.form, 1); return false;","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":"browse artists a-z"},"class":""},{"a":{"href":"/movies/trailer_park/","content":"movie trailers"},"class":""},{"a":{"href":"/music/radio/","content":"radio"},"class":""},{"a":{"href":"/games/arcade/","content":"online games"},"class":""},{"a":{"href":"/mobile/","content":"mobile"},"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/","content":"Radio"}},{"a":{"href":"/lyrics/","content":"Lyrics"}},{"a":{"href":"http://community.mtvmusic.com/top100/","target":"_blank","content":"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":"Our Picks"}},{"a":{"href":"/music/video/premieres.jhtml","content":"Video Premieres"}},{"a":{"href":"/overdrive/?id=1568964","content":"MTV2 Video Premieres"}},{"a":{"href":"/music/video/popular.jhtml","content":"Most Popular Videos"}},{"a":{"href":"/music/playlists/","content":"Playlists"}},{"a":{"href":"/music/playlibs/","content":"Artist Hosted: Playlibs"}},{"a":{"href":"/music/live_performances/","content":"Live Performances"}},{"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/discover_download/","content":"New Artists: Discover . Download"}},{"a":{"href":"/music/photos/","content":"Artist Photos"}}]},{"class":"centerCol","li":[{"class":"first","span":"Specials"},{"a":{"href":"/specials/best_of/2009/","content":"Best Of 2009"}},{"a":{"href":"/ontv/vma/2009/","content":"2009 Video Music Awards"}},{"a":{"href":"http://www.mtv.com/ontv/woodieawards/2009/","target":"_blank","content":"mtvU Woodie Awards"}},{"a":{"href":"/specials/halloween/","content":"Halloween On MTV"}},{"a":{"href":"/specials/hottest/mc/","content":"Hottest MCs In The Game"}},{"a":{"href":"/music/the_leak/","content":"The Leak: Full Album Previews"}},{"a":{"href":"/specials/michaeljackson/","content":"Michael Jackson Remembered"}},{"a":{"href":"/music/unplugged/","content":"MTV Unplugged"}}]},{"ul":[{"class":"rightBlock split","li":[{"class":"first","span":"pop"},{"a":{"href":"/music/pop/","content":"Pop Main"}},{"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/you_rock_the_deuce/series.jhtml","content":"Rock The Deuce"}},{"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":"/news/topic/mixtape_daily/","content":"Mixtape Daily"}}]},{"class":"rightBlock ","li":[{"class":"first","span":"indie"},{"a":{"href":"/music/indie/","content":"Indie Main"}},{"a":{"href":"/shows/subterranean/series.jhtml","content":"Subterranean"}}]}],"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","target":"_blank","content":"MTV Shows Gossip Blog"}},{"a":{"href":"http://soundtrack.mtv.com","target":"_blank","content":"Music in Shows"}},{"a":{"href":"/ontv/photos/","content":"Show Photos"}},{"a":{"href":"/ontv/castingcall/","content":"Be on MTV"}},{"a":{"href":"http://shop.mtv.com/?v=mtv_shows","target":"_blank","content":"Shop MTV Shows"}}]},{"ul":[{"li":[{"a":{"href":"/shows/16_and_pregnant/season_1/series.jhtml","content":"16 and Pregnant"}},{"a":{"href":"/ontv/dyn/dance_crew/series.jhtml","content":"America's Best Dance Crew"}},{"a":{"href":"/ontv/dyn/behind_the_screen/series.jhtml","content":"Behind The Screen"}},{"a":{"href":"/shows/buried_life/series.jhtml","content":"The Buried Life"}},{"a":{"href":"/shows/the-city/series.jhtml","content":"The City"}},{"a":{"href":"/ontv/dyn/cribs/series.jhtml","content":"Cribs"}},{"a":{"href":"/shows/degrassi/series.jhtml","content":"Degrassi: The Next Generation"}},{"a":{"href":"/shows/disaster_date/series.jhtml","content":"Disaster Date"}},{"a":{"href":"http://www.mtv.com/fivedollarcover/","target":"_blank","content":"$5 Cover"}},{"a":{"href":"/shows/gone_too_far/series.jhtml","content":"Gone Too Far"}}]},{"li":[{"a":{"href":"/shows/the_hills/series.jhtml","content":"The Hills"}},{"a":{"href":"/shows/alexa_chung/series.jhtml","content":"It's On with Alexa Chung"}},{"a":{"href":"/shows/jersey_shore/series.jhtml","content":"Jersey Shore"}},{"a":{"href":"/shows/made/series.jhtml","content":"MADE"}},{"a":{"href":"/ontv/shorts/","content":"MTV Shorts"}},{"a":{"href":"/music/unplugged/","content":"MTV Unplugged"}},{"a":{"href":"/shows/sweet_16/series.jhtml","content":"My Super Sweet 16"}},{"a":{"href":"/ontv/dyn/nitro_circus/series.jhtml","content":"Nitro Circus"}},{"a":{"href":"http://northpalmwrestling.mtv.com/","target":"_blank","content":"North Palm Wrestling"}},{"a":{"href":"/shows/parental_control/series.jhtml","content":"Parental Control"}},{"a":{"href":"/shows/real_world/Washingtondc/series.jhtml","content":"The Real World DC"}}]},{"li":[{"a":{"href":"/shows/rwrr_challenge_theruins/series.jhtml","content":"RW/RR Challenge: The Ruins"}},{"a":{"href":"/ontv/dyn/fantasy_factory/series.jhtml","content":"Rob Dyrdek's Fantasy Factory"}},{"a":{"href":"/ontv/dyn/runs_house/series.jhtml","content":"Run's House"}},{"a":{"href":"/ontv/dyn/silent_library/series.jhtml","content":"Silent Library"}},{"a":{"href":"/shows/styld/series.jhtml","content":"Styl'D"}},{"a":{"href":"/ontv/dyn/teen_cribs/series.jhtml","content":"Teen Cribs"}},{"a":{"href":"/shows/teen_mom/series.jhtml","content":"Teen Mom"}},{"a":{"href":"/shows/truelife/series.jhtml","content":"True Life"}},{"a":{"href":"/shows/valemont/series.jhtml","content":"Valemont"}},{"a":{"href":"/shows/worlds_strictest_parents/series.jhtml","content":"World's Strictest Parents"}},{"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":"/ontv/vma/2009/","content":"2009 Video Music Awards"}},{"a":{"href":"/ontv/movieawards/2009/","content":"2009 Movie Awards"}},{"a":{"href":"/specials/best_of/2009/","content":"Best of 2009"}},{"a":{"href":"/ontv/woodieawards/2009/","content":"mtvU Woodie Awards"}},{"a":{"href":"/movies/movie/436051/moviemain.jhtml","content":"My Super Psycho Sweet 16"}},{"a":{"href":"/shows/return_to_duty/series.jhtml","content":"Real World Presents: Return To Duty"}},{"a":{"href":"/specials/what_were_u_thinking/","content":"What Were U Thinking?"}},{"a":{"href":"/shows/spring_break_10/series.jhtml","content":"Spring Break 2010"}}]},{"class":"centerCol last","li":[{"class":"first","span":"classics"},{"a":{"href":"/shows/aeon_flux/series.jhtml","content":"Aeon Flux"}},{"a":{"href":"/shows/beavis_and_butthead/series.jhtml","content":"Beavis . Butt-Head"}},{"a":{"href":"/ontv/dyn/celebrity_deathmatch/series.jhtml","content":"Celebrity Deathmatch"}},{"a":{"href":"/ontv/dyn/jackass/series.jhtml","content":"Jackass World"}},{"a":{"href":"/shows/laguna_beach/season_1/series.jhtml","content":"Laguna Beach"}},{"a":{"href":"/ontv/liquid_television/","content":"Liquid Television"}},{"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":"/shows/punkd/series.jhtml","content":"Punk'd"}},{"a":{"href":"/shows/the_state/series.jhtml","content":"THE STATE"}},{"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":"/news/topic/mixtape_daily/","content":"Mixtape Daily"}},{"a":{"href":"http://twitter.com/mtvnews","target":"_blank","content":"MTV News On Twitter"}},{"a":{"href":"http://your.mtv.com/","target":"_blank","content":"Your Uploads"}}]},{"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/#movie","content":"Movie News"},"id":"newsMain3Tab"},{"a":{"href":"/news/#celebrity","content":"Celebrity News"},"id":"newsMain4Tab"}]},{"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/wake-up-video/","content":"Wake Up-Video"}},{"a":{"href":"http://newsroom.mtv.com/category/oh-snap-poll/","content":"Daily Poll"}},{"a":{"href":"http://newsroom.mtv.com/category/top_categories/behind-the-scenes/","content":"Behind The Scenes"}}]},{"class":"centerCol","li":[{"class":"first","span":"Video Game News"},{"a":{"href":"http://multiplayerblog.mtv.com/","content":"Latest Posts"}},{"a":{"href":"http://multiplayerblog.mtv.com/category/navigation_menu/xbox-360/","content":"Xbox 360 News"}},{"a":{"href":"http://multiplayerblog.mtv.com/category/navigation_menu/wii/","content":"Wii News"}},{"a":{"href":"http://multiplayerblog.mtv.com/category/navigation_menu/ps3/","content":"PS3 News"}}]},{"class":"centerCol last","li":[{"class":"first","span":"mtv reporters"},{"a":{"href":"http://newsroom.mtv.com/author/jimc/","content":"Jim Cantiello"}},{"a":{"href":"/news/correspondents/kash/","content":"Tim Kash"}},{"a":{"href":"/news/correspondents/loder/","content":"Kurt Loder"}},{"a":{"href":"/news/correspondents/sway/","content":"Sway"}}]}],"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":"http://shop.mtv.com/?v=mtv_dvds","target":"_blank","content":"MTV Movies Shop"}},{"a":{"href":"/movies/photo/","content":"Red Carpet & On Set Photos"}}]},{"class":"centerCol","li":[{"class":"first","span":"trailers & reviews"},{"a":{"href":"/movies/trailer_park/","content":"Trailers"}},{"a":{"href":"/movies/news/loder/","content":"Kurt Loder Film Reviews"}}]},{"class":"centerCol","li":[{"class":"first","span":"news & blogs"},{"a":{"href":"/news/#movie","content":"Movies News"},"id":"newsMain3Tab"},{"a":{"href":"http://moviesblog.mtv.com","content":"Movies Blog"}},{"a":{"href":"http://splashpage.mtv.com","content":"Comic Book Movies Blog"}},{"a":{"href":"http://hollywoodcrush.mtv.com/","content":"Young Hollywood Blog"}},{"a":{"href":"/movies/features_interviews/morevideo.jhtml","content":"Video News & Interviews"}}]},{"class":"centerCol last","li":[{"class":"first","span":"specials"},{"a":{"href":"/specials/halloween/","content":"Halloween On MTV"}}]}],"class":"grid","id":"movies-grid"}}},"class":"toplvl","id":"n-movies"}],"id":"navlist"}],"class":"globalNav","id":"nav"}};

this.fnHeaderObj = {"div":{"div":{"div":{"code":{"class":"hide"},"class":"fluxWidget","id":"wQuickMenu"},"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

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":{"form":{"input":{"value":"SEARCH","type":"text","onkeypress":"catchEnter(this.form, event);","onclick":"this.value='';","name":"searchterm","id":"searchmtv-text"},"action":"/search/","onsubmit":"return false;","name":"search","button":[{"content":"GO","onclick":"submitSearch(this.form, 0); return false;","id":"searchmtv-btn"},{"content":"WEB","onclick":"submitSearch(this.form, 1); return false;","id":"searchweb-btn"}],"method":"get"},"id":"searchmtv"},"a":[{"href":"/","img":{"src":"/sitewide/images/u/logo-mtv-white-small.gif","alt":"MTV HOME"},"id":"gft-search-logo"},{"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"}],"class":"gft-row","content":["|","|","|","|","|","|","|","|","|","|","|"],"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://moviesblog.mtv.com/","content":"Movies Blog"}},{"a":{"href":"http://hatsblog.mtv.com/","content":"MTV Hats Blog"}},{"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://www.subterraneanblog.com/","content":"Subterranean Blog"}},{"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://think.mtv.com/","content":"Think MTV"}},{"a":{"href":"http://shop.mtv.com/","content":"MTV Shop"}},{"a":{"href":"http://www.seenonmtv.com/","content":"Seen On MTV"}},{"a":{"href":"http://www.mtviggy.com/","content":"MTV Iggy"}},{"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":{"content":"Newsletters","onclick":"openAndFocus('http://exodus.mtv.com/site/signup','newsletters','height=540,width=540,scrollbars=yes')","style":"cursor: pointer;"}},{"a":{"href":"http://www.mtv.com/rss/","content":"Podcasts"}},{"a":{"href":"http://www.mtv.com/rss/","content":"RSS"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"FEEDBACK"},{"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"}}]},{"class":"gft-col","li":[{"class":"gft-col-header","content":"TERMS / POLICY"},{"a":{"href":"http://www.mtv.com/sitewide/legal/terms.pdf","content":"Terms of Use"}},{"a":{"href":"http://www.mtv.com/sitewide/legal/privacy.pdf","content":"Privacy Policy / Your CA Privacy Rights"}},{"a":{"href":"http://www.mtv.com/sitewide/legal/copyright_compliance.pdf","content":"Copyright Compliance Policy"}},{"a":{"href":"http://www.mtv.com/sitewide/legal/community_guidelines.jhtml","content":"Community Guidelines"}},{"a":{"href":"http://www.mtv.com/sitewide/legal/user_content.pdf","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://adspecs.mtvn.com/site/mtv/mtv.html","content":"Advertising Opportunities"}},{"a":{"href":"http://offer.rhapsody.com/?footer","content":"Rhapsody"}},{"a":{"href":"http://www.mtv.com/partners/mtv_tribe/index.jhtml","content":"Partners"}}]}],"class":"gft-row-subrow"},"class":"gft-row","id":"gft-brand"},{"div":[{"img":{"width":"136","height":"24","src":"/widgets/assets/mtvn.gif","border":"0","alt":"MTV Networks"},"id":"gft-logo"},{"content":"&#169; 2009 MTV Networks, &#169; and &#8482; MTV Networks. All Rights Reserved.","id":"gft-copy"}],"id":"gft-mtvnetworks"}],"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], true));
}
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('height', 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.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;
}
}
