if (typeof(prependDomain) == "undefined") { prependDomain = ""; } /** * Set, Get, and Delete Cookie utils * */ function GetCookieUtil (name) { var result = null; var myCookie = " " + document.cookie + ";"; var searchName = " " + name + "="; var startOfCookie = myCookie.indexOf(searchName); var endOfCookie; if (startOfCookie != -1) { startOfCookie += searchName.length; endOfCookie = myCookie.indexOf(";", startOfCookie); result = unescape(myCookie.substring(startOfCookie, endOfCookie)); } if (result == "") result = null; return result; } function SetCookieUtil (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "; path=/") + ((domain) ? "; domain=" + domain : "; domain="+document.location.hostname) + ((secure) ? "; secure" : ""); } function DeleteCookieUtil (name,path,domain) { if (GetCookieUtil(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } var today = new Date(); var oneDay = new Date(today.getTime() + 24 * 60 *60 * 1000); var oneWeek = new Date(today.getTime() + 24 * 60 *60 * 1000 * 7); var oneYear = new Date(today.getTime() + 24 * 60 *60 * 1000 * 365); /***** droplet src="/sitewide/droplets/downloadPop.jhtml" *****/ /***** MEDIAPLAYER LAUNCH SCRIPTS *****/ if (typeof additionalVals == "undefined") { additionalVals=""; } function launchVideo(clipy){ prependDomain = ""; players = new Array(); player = "defaultPlayer"; players['defaultPlayer'] = new Array("mtvmediaplayer","720","540"); clipyNew = clipy clipy = clipyNew if(clipyNew.indexOf('channelID=')<0 && window.channelID) clipy = clipy + "&" + "channelID=" + channelID if(clipyNew.indexOf('orgID=')<0 && window.orgID) clipy = clipy + "&" + "orgID=" + orgID if(clipyNew.indexOf('gateway=')<0 && window.gateway) clipy = clipy + "&" + "gateway=" + gateway if(clipyNew.indexOf('portal=')<0 && window.portal) clipy = clipy + "&" + "portal=" + portal; if(clipyNew.indexOf('paid=')<0 && window.paid) clipy = clipy + "&" + "paid=" + paid if(clipyNew.indexOf('seriesID=')<0 && window.seriesID) clipy = clipy + "&" + "seriesID=" + seriesID if(clipyNew.indexOf('episodeID=')<0 && window.episodeID) clipy = clipy + "&" + "episodeID=" + episodeID if(clipyNew.indexOf('albumid=')<0 && window.albumid) clipy = clipy + "&" + "albumid=" + albumid ap = "&adPth=" + escape(""); ap = ap.substring(0,ap.length-17); ap = ap + "&adPN=" + escape(""); refURL = document.location.pathname; pieces = refURL.split("/"); if (pieces.length == 2) pieces[1] = "home"; var ss = ''; for (var i = 1; i < pieces.length; i++) { sIndex = i - 1; ss = ss + "§ion_" + sIndex + "=" + pieces[i]; } ss = ss + "&refURL=" + refURL; clipy = clipy.replace(/'/g,'\\\'') attSw = 'no'; if(document.referrer.indexOf("yahoo")>=0) additionalVals += '&partner=yahoo'; sUrl = prependDomain + "/sitewide/apps/mediaplayer/index.jhtml?" + clipy + ss + ap + additionalVals; attrs = 'width=' + players[player][1] + ','; attrs += 'height=' + players[player][2] + ','; attrs += 'left=25,top=25,'; attrs += 'scrollbars=' + attSw + ',resizable=' + attSw + ',toolbar=' + attSw + ',location=' + attSw + ',directories=' + attSw + ',status=' + attSw + ',menubar=' + attSw; var pWin = false; pWin = window.open(sUrl, players[player][0], attrs); // popCheck(pWin); // pWin.focus(); } { function launchTrailer(stuff){ launchVideo(stuff) } } /***** URGE LAUNCH SCRIPTS *****/ var urge_referrer = "[no referrer provided]"; /************************************************************************* * URGE Launch: Launch the URGE player *************************************************************************/ function launchUrge (paramString) { var hash = {}; var pairs = paramString.split("&"); for (var i=0;i= 4) && (navigator.platform == "Win32")) || (this.os.indexOf("win32") != -1) || (this.os.indexOf("32bit") != -1)); //mac os this._isMac = (this.getOs().indexOf("mac") != -1); this._isMac68K = (this.isMac() && ((this.getOs().indexOf("68k") != -1) || (this.getOs().indexOf("68000") != -1))); this._isMacPPC = (this.isMac() && ((this.getOs().indexOf("ppc") != -1) || (this.getOs().indexOf("powerpc") != -1))); this._isMacOS8 = (this.isMac() && ((this.getOs().indexOf("os 8") != -1) || (this.getOs().indexOf("os8") != -1))); this._isMacOS9 = (this.isMac() && ((this.getOs().indexOf("os 9") != -1) || (this.getOs().indexOf("os9") != -1))); this._isMacOSX = (this.isMac() && ((this.getOs().indexOf("powerpc") != -1) || (this.getOs().indexOf("osx") != -1) || (this.getOs().indexOf("os x") != -1))); if (this.isMac()) this._isWindows =! this._isMac; }//end method /** * getOs - returns the os property */ function getOs() { return this.os; }//end method /** * isWindows - is windows, any version */ function isWindows() { return this._isWindows; }//end method /** * isWindows16 - is windows 16 bit */ function isWindows16() { return this._isWindows16; }//end method /** * isWindows31 - is windows 3.1 */ function isWindows31() { return this._isWindows31; }//end method /** * isWindows95 - is windows 95 */ function isWindows95() { return this._isWindows95; }//end method /** * isWindows98 - is windows 98 */ function isWindows98() { return this._isWindows98; }//end method /** * isWindowsME - is windows me */ function isWindowsME() { return this._isWindowsME; }//end method /** * isWindowsNT - is windows NT */ function isWindowsNT() { return this._isWindowsNT; }//end method /** * isWindows2K - is windows 2000 */ function isWindows2K() { return this._isWindows2K; }//end method /** * isWindowsXP - is windows xp */ function isWindowsXP() { return this._isWindowsXP; }//end method /** * isWindows32 - is windows 32 bit */ function isWindows32() { return this._isWindows32; }//end method /** * isWindows64 - is windows 64 bit */ function isWindows64() { return this._isWindows64; }//end method /** * isWindowsDotNet - is windows dot net */ function isWindowsDotNet() { return this._isWindowsDotNet; }//end method /** * isWindowsVista - is windows vista */ function isWindowsVista() { return this._isWindowsVista; }//end method /** * isMac - is mac os any version */ function isMac() { return this._isMac; }//end method /** * isMac68K is mac 6800 series */ function isMac68K() { return this._isMac68K; }//end method /** * isMacPPC is mac power pc */ function isMacPPC() { return this._isMacPPC; }//end method /** * isMacOS8 is mac os 8 */ function isMacOS8() { return this._isMacOS8; }//end method /** * isMacOS9 is mac os 9 */ function isMacOS9() { return this._isMacOS9; }//end method /** * isMacOSX is mac os x */ function isMacOSX() { return this._isMacOSX; }//end method /** * isPlayerPossible */ function isPlayerPossible() { //all these platforms cant get wmp 9 if (this.isWindows95() || this.isWindowsNT() || this.isWindows98() || this.isWindowsME() || this.isMacOS9() || this.isMacOS9() || this.isMacOS8() || this.isMacPPC() || this.isMac68K() ) { return false; } return true; }//end method os = new OSDetector(); os.detect(); //for wmp detection /* if (os.isWindows()) { if (isPlayerPossible()) { //player possible, do player detection } else { //no player possible, download vmc } } */ /*************************************************************************/ // Requires the following script libraries. // // /global/apps/mediaplayer/scripts/os_detect.js // /shared/scripts/flash_detect.js // /sitewide/droplets/scripts/detect_overdrive.js // /*************************************************************************/ var od_win; var detectState=""; var fn=""; var ok=""; function launchOverdriveDetect(){ var resultStatus = getOverdriveState().detectState; if (resultStatus == "ok"){ return true; } else{ window.location.href = detectFailUrlWin + "?error=" + resultStatus; } } function launchOverdrive(){ if (getOverdriveState().detectState == "XXXok") { var broadband_parent = parentWindowVar; var url = detectSuccessUrl; var width; var height; var odscrollbars; var odresizable; var purlArray = null; if (getOverdriveState().dim == "lowres"){ width = 800; height = 600; odscrollbars = "yes"; odresizable = "yes"; } else { width = winWidth; height = winHeight; odscrollbars = "no"; odresizable = "no"; } // CONSTRUCT DEEP LINK ARGS var qs = ""; if(arguments.length > 0){ qs = "?"+arguments[0]; for(i=1; i 0)) { docloc = fullLoc.substr(fullLoc.indexOf('#') +1, fullLoc.length).split("?")[0]; } if(qs.length > 0){ qs += "&launchedFrom=" + docloc; } else{ qs += "?launchedFrom=" + docloc; } var path = url+qs; od_win = window.open(path, "player", "width=" + width + ", height=" + height + ", left=" + (Math.round(window.screen.width/2) - Math.round(width/2)) + ", top=" + (Math.round(window.screen.height/2) - Math.round(height/2)) + ",scrollbars=" + odscrollbars + ", resizable=" + odresizable + ", menubar=no, location=no, toolbar=no, status=no, directories=no" ); if (purlArray != null) window.location.href = purlArray[1]; broadbandWindowPopped(od_win, path); } else{ // window.location.href = detectFailUrl; var qs = ""; if(arguments.length > 0){ qs = arguments[0]; for(i=1; i= 8 && GetCookieUtil("sitePreferenceSet") == "false") { var args = ""; if(arguments.length > 0){ args = arguments[0]; for(i=1; i 0) { args = param[0]; if (param.length > 1) { for (i=1; i= 9) { return true; } else { return false; } } catch(e) { return false; } } function hasIE55plus(){ var version=0; if (navigator.appVersion.indexOf("MSIE")!=-1){ temp=navigator.appVersion.split("MSIE"); version=parseFloat(temp[1]); } if (version >= 5.5) { return true; } else { return false; } } function broadbandWindowPopped(win, path) { try { win.focus(); showAlertsPromo(); } catch (e) { window.location.replace(path); } } function launchContentOn(){ document.getElementById('flaunchContent').style.visibility = "visible"; } function launchShell(){ var hostname = ""; var hpA = window.location.host.split("."); var hp; hp = (hpA[0].substr(0,1) == "o" && hpA[0].indexOf("-") == -1) ? hpA[2]: hpA[1].replace("x", ""); if ( (hp != "mtv") && (hp != "mtv-d") && (hp != "mtv-q")) hostname = "http://www.mtv.com"; var broadband_parent = parentWindowVar; var url = hostname + "/overdrive/"; var width = 1034; var height = 768; var odscrollbars; var odresizable; var purlArray = null; // CONSTRUCT DEEP LINK ARGS var qs = ""; if(arguments.length > 0){ qs = "?" +arguments[0]; for(i=1; i 0)) { docloc = fullLoc.substr(fullLoc.indexOf('#') +1, fullLoc.length).split("?")[0]; } var path = url+qs; shell_win = window.open(path, "shell", "width=" + width + ", height=" + height + ", left=" + (Math.round(window.screen.width/2) - Math.round(width/2)) + ", top=" + (Math.round(window.screen.height/2) - Math.round(height/2)) + ",scrollbars=yes" + ", resizable=yes" + ", menubar=yes, location=yes, toolbar=yes, status=yes, directories=yes" ); shell_win.focus(); if (purlArray != null) window.location.href = purlArray[1]; broadbandWindowPopped(od_win, path); } function broadbandWindowPopped(win, path) {} /***** RADIO LAUNCH SCRIPTS *****/ function launchRSNu(getUrl){ var tuner = false; tuner = window.open(getUrl,'TUNERLogin','width=700,height=312,toolbar=no,resizable=no,scrollbars=no'); tuner.focus(); } function launchRSN(varStationID){ var tuner = false; tuner = window.open(prependDomain + '/mtvradio/radiolaunch.jhtml?oparam=radio&serviceSubjectID='+ varStationID + '&A='+ varStationID ,'TUNERLogin','width=700,height=312,toolbar=no,resizable=no,scrollbars=no'); tuner.focus(); // popCheck(tuner); } /***** FLIPBOOK LAUNCH SCRIPTS *****/ /* * @description Opens the sitewide flipbook player. * @param fbKey Flipbook ID or URL. * @param obj, Object, used to customize the flipbook skin and values. */ function popFlip(fbKey, obj){ if (flashVersion >= 8 && (siteVersion=="FBML" || (GetCookieUtil("sitePreferenceSet") == "false" && siteVersion == "HTML"))) { var fbArgs = ""; for (var p in obj){ fbArgs += "&" + p + "=" + obj[p]; } var lfArg; // for fbml urls fullLoc = window.location.toString(); if ((typeof browserManager != "undefined") && (fullLoc.indexOf('#') > 0)) { lfArg = "&launchedFrom=" + fullLoc.substr(fullLoc.indexOf('#') +1, fullLoc.length).split("?")[0]; } else { lfArg = "&launchedFrom=" + window.location.pathname; } var pWin = false; if (fbKey.indexOf("fid=")>=0) { // new flip pop, old w=556, h=486 pWin = window.open('/sitewide/flipbook/index.jhtml?'+fbKey+fbArgs+lfArg,'flipbook','width=747,height=505,scrollbars=no'); } else { var flipLoc = fbKey.split("?"); flipLocPath = flipLoc[0].split("index.jhtml"); var flipLocFull = flipLocPath[0]; if (flipLoc[1] != "" && flipLoc[1] != null) flipLocFull += "&" + flipLoc[1]; pWin = window.open('/sitewide/flipbook/index.jhtml?pf='+flipLocFull+fbArgs+lfArg+'','flipbook','width=747,height=505,scrollbars=no'); } // popCheck(pWin); return false; } else{ return true; } } function popFlipWithReturnValue(){ if (flashVersion >= 8 && (siteVersion=="FBML" || (GetCookieUtil("sitePreferenceSet") == "false" && siteVersion == "HTML"))) { var args = ""; if(arguments.length > 0){ args = arguments[0]; for(i=1; i 0){ url = url + arguments[0]; } else{ url = url + "title=" + escape(title) + "&image=" + escape(image) + "&url=" + escape(document.location.toString()); } window.open(url, 'sendtofriend', 'width=578,height=485,location=no'); } /***** COMMUNITY LAUNCH SCRIPTS *****/ // Library used for community services var thisHost = window.location.host; if (typeof(prependDomain) == "undefined") { prependDomain = ""; } var Prefix = prependDomain; var SIGNPAGE = Prefix + '/community/account/signin.jhtml'; var REGPAGE = Prefix + '/community/account/join.jhtml'; var BOARDPAGE = Prefix + '/community/message_boards/adredirect.jhtml'; var MYPROFILEPAGE = Prefix + '/community/profiles/myProfile.jhtml'; var BOARDTHREADPAGE = Prefix + '/community/message_boards/viewthread.jhtml'; var REDFLAGPAGE = Prefix + '/community/message_boards/redflag.jhtml'; var ARTISTBOARDPAGE = Prefix + '/community/message_boards/artistboard.jhtml'; var CHATPAGE = Prefix + '/community/chat/chat.jhtml'; var IMPAGE = Prefix + '/community/im/imlaunch.jhtml'; var IMDOWNLOAD = Prefix + '/community/im/imdownload.jhtml'; var INFOPAGE = Prefix + '/community/account/smryinfo.jhtml'; var mcPAGE = Prefix + '/community/messages/mclaunch.jhtml'; var VMPHONEPAGE = Prefix + '/secure/vmu/editvmu.jhtml?returnPage='+escape('http://'+thisHost+'/community/account/editvmusuccess.jhtml'); var VMPHONETEXT = Prefix + '/secure/vmu/editvmu.jhtml?returnPage='+escape('http://'+thisHost+'/community/account/editvmutext.jhtml?updateVMUser=true'); var winTarget= "im"; var openPARAMS = 'resizable=yes,menubar=yes,location=yes,toolbar=yes,status=yes,scrollbars,directories=no,width=805,height=500'; // This is the default for winPARAMS var winPARAMS = 'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,width=260,height=425'; var mcPARAMS = openPARAMS; var vmPARAMS = 'resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,directories=no,width=376,height=260'; var USER_BROWSER = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))) function popMsg(daURL){ newwin = window.open(daURL,'messages','width=556,height=486,scrollbars,resizable'); } function signin(){ signinPop(); } function signinMsg(mtvparams, service){ if(arguments.length != 2) { mtvparams=""; service=""; } editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=' + mtvparams + '&oparam=' + service + '&target=', 'SignIn', openPARAMS); } function signinPop(){ editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=&target=', 'SignIn', openPARAMS); } function popSignin(){ editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=&target=', 'SignIn', openPARAMS); } function editProfile(){ if(USER_BROWSER){ var editwindow; editwindow = window.open(SIGNPAGE + '?serv=profile&mtvparams=&target=&oparam=edit_profile&mesg=', 'SignIn', openPARAMS); }else{ editwindow = window.open(SIGNPAGE + '?serv=signin&mtvparams=&oparam=edit_profile&target=', 'mtv', openPARAMS); //window.open(SIGNPAGE + '?serv=profile&mtvparams=&target=self&mesg=','EditProfile',IEPARAMS); } } function goToMyProfile(){ var editwindow; editwindow = window.open(MYPROFILEPAGE, 'mtv', openPARAMS); } function boardPop(bid,tid,mid,offset){ var mbPARAMS = 'resizable=yes,menubar=no,location=no,toolbar,status,scrollbars,directories=no,width=760,height=435'; if(arguments.length == 2){editwindow = window.open(BOARDPAGE + '?bID=' + bid + '&tID=' + tid, 'Board' + bid, mbPARAMS);} else if(arguments.length == 4){editwindow = window.open(BOARDTHREADPAGE + '?bID=' + bid + '&tID=' + tid + '&mID=' + mid + '&offset=' + offset, 'Board' + bid, mbPARAMS);} else{editwindow = window.open(BOARDPAGE + '?bID=' + bid, 'Board' + bid, mbPARAMS);} editwindow.focus; popCheck(editwindow); } function popCheck(obj){ if (!obj) { alert("Some content on MTV.com is displayed using pop-ups. \n\nIf you're using a Pop-up Blocker, you'll need to permit pop-ups \nfrom MTV.com in order to view Videos, photos and other content on our site."); } } function redFlag(bid,mid) { open(REDFLAGPAGE + '?mID=' + mid + '&bID=' + bid, 'RedFlag', 'width=400,height=200'); } function artistBoardPop(artistid){ var mbPARAMS = 'resizable=yes,menubar=no,location=no,toolbar,status,scrollbars,directories=no,width=600,height=440'; editwindow = window.open(ARTISTBOARDPAGE + '?artistid=' + artistid, 'Board' + artistid, mbPARAMS); } function popChat(room){ var chatPARAMS = 'resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars,directories=no,width=605,height=560'; editwindow = window.open(CHATPAGE + '?oparam=chat&room=' + room, 'chat' + room,chatPARAMS); } // legacy chat opener function launchPopUpApp(p,room){ l = room.length; var room = room.substring(5,l) var chatPARAMS = 'resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars,directories=no,width=605,height=560'; editwindow = window.open(CHATPAGE + '?room=' + room, 'chat' + room,chatPARAMS); } function popIm(){ randid = new String(Math.random()); var editwindow; popimwin = window.open(IMPAGE + '?rnd=' + randid,winTarget,winPARAMS); } function popImDownload(){ editwindow = window.open(IMDOWNLOAD, 'imdownload',openPARAMS); } function sendMessage(username){ randid = new String(Math.random()); editwindow = window.open(IMPAGE + '?rnd=' + randid + '&sendto=' + username,'im',openPARAMS); } function popEmailLogin(){ editwindow = window.open(SIGNPAGE + '?serv=mail&mtvparams=email&target=self&mesg=', 'EmailLogin', openPARAMS); } function popEmailRegister(){ editwindow = window.open(REGPAGE + '?serv=mail&mtvparams=email&target=self&mesg=', 'EmailLogin', openPARAMS); } function popMessageCenter(){ editwindow = window.open(mcPAGE, 'messages', mcPARAMS); } function editAccount(){ editwindow = window.open(INFOPAGE, 'EditAccount', openPARAMS); } function linkPhone(host){ window.open(host+VMPHONEPAGE, 'LinkPhone', vmPARAMS); } function linkPhoneForText(host){ window.location.href = host+VMPHONETEXT; } function popMessageCenterFromNav(page, params) { editwindow = window.open('/community/messages/inbox.jhtml', 'messages', 'width=556,height=486,scrollbars=yes,resizable'); } function logoutFromNav() { document.logoutform.submit(); } function signInFromNav() { var thisUrl = document.location; signinMsg(thisUrl,'default'); } function joinFromNav() { var thisUrl = escape(document.location); genPop('/community/account/join.jhtml?serv=url&mtvparams=' + thisUrl, 'account', 'width=605,height=535,resizable,scrollbars'); } function editProfileFromNav() { location.href = '/community/profiles/profile.jhtml?username=' + if_nt_userName; } function editProfileWrapper() { editProfileFromNav(); } function editNewsletters() { genPop('http://ebm.cheetahmail.com/r/regf2?aid=409502673&n=102&a=0', 'newsletters', 'width=690,height=550,resizable,scrollbars'); } function editProfileWrapper() { editProfile(); } /***** SHELL SCRIPTS *****/ function toggleFBML() { if(document.getElementById('flashObj').style.display == 'none') { document.getElementById('noFlash').style.display='none'; document.getElementById('flashObj').style.display='block'; } else { document.getElementById('noFlash').style.display='block'; document.getElementById('flashObj').style.display='none'; } } var flip = "false"; function setHTML() { var loc = window.location+""; if (flip=='true'){ if ((typeof window.opener != "undefined") && (window.opener != null)){ window.close(); } else { loc = loc.substring(0, loc.indexOf('.com/') + 5); if(legacyFBMLPopup=='true') window.open(loc); else window.location = loc; } } else{ SetCookieUtil("sitePreferenceSet", "true", oneWeek); SetCookieUtil("cSiteVersion", "HTML", oneWeek); var hash = loc.indexOf('#'); (hash >= 0) && ((hash +1) < loc.length) ? url = loc.substr(hash + 1): url = window.location.pathname + window.location.search; window.location = url; } } function setFBML() { if (flip=='true'){ var loc = window.location+""; (loc.indexOf('?') > 0 ) ? loc = loc + "&siteVersion=FBML" : loc = loc + "?siteVersion=FBML"; window.location = loc; } else{ SetCookieUtil("sitePreferenceSet", "true", oneWeek); SetCookieUtil("cSiteVersion", "FBML", oneWeek); window.location.reload(); } } function setUpgradeFlash() { document.getElementById('flashObj').style.display='none'; document.getElementById('noFlash').style.display='none'; if (typeof document.getElementById('upgradeFlash') != "undefined") { document.getElementById('upgradeFlashImage').src = "/relaunch/sitewide/images/flashupgrade/promo_02_html.jpg"; document.getElementById('upgradeFlash').style.display='block'; } } function report() { if (typeof REPORTING != "undefined") { var reportingObj = new Object(); reportingObj.tVars = new Object(); var pageKeyVals = new Array(); if (typeof adCall.pageVals != "undefined") pageKeyVals = adCall.pageVals.split(";"); if (typeof adCall.additionalValues == "undefined") adCall.additionalValues = ""; if (typeof clientEnvironmentVars == "undefined") clientEnvironmentVars = ""; if (typeof personalizationVars == "undefined") personalizationVars = ""; for (var item in pageKeyVals) { var p = pageKeyVals[item].split("="); if (p[0] != null && p[0] != undefined && p[0] !="") reportingObj[p[0]] = p[1]; } otherVals = adCall.additionalValues + ";" + clientEnvironmentVars + ";" + personalizationVars; var otherKeyVals = otherVals.split(";"); for (var item in otherKeyVals) { var p = otherKeyVals[item].split("="); if (p[0] != null && p[0] != undefined && p[0] !="") reportingObj.tVars[p[0]] = p[1]; } REPORTING.makeCall('fbml_pv', reportingObj); } } function hatTrick(hatNumber) { var noFlashDiv = document.getElementById('noFlash'); var classList = noFlashDiv.className; if (classList.indexOf("hat") > -1) { var tempClasses = new Array(); var classes = classList.split(" "); var j = 0; for(i = 0; i < classes.length; i++) { if(classes[i].substr(0,3) != "hat") tempClasses[j++] = classes[i]; } classList = tempClasses.join(" "); } if (hatNumber == null) hatNumber = Math.round(22*Math.random()); var newHat = " hat" + hatNumber; noFlashDiv.className = classList + newHat + ""; } function toggleContinousPlay(preference) { if(preference == null) { preference = new Object(); if(GetCookieUtil("cContinuousPlay") == null){ preference.checked = true; } else { preference.checked = GetCookieUtil("cContinuousPlay"); } } document.getElementById('embeddedPlayer').setContinuousPlay(preference.checked); isChecked = (preference.checked == false) ? "0" : "1"; SetCookieUtil("cContinuousPlay", isChecked, oneYear); } // WMP Detection // ************************************** function getWMPVer() { var version = "undefined"; var gkoaxwma = detectMozillaActiveXObject(); if (window.ActiveXObject || gkoaxwma) { try { if (window.ActiveXObject && navigator.userAgent.indexOf('Win') != -1) { var axo = new ActiveXObject("WMPlayer.OCX.7"); } else if (gkoaxwma) { var axo = new GeckoActiveXObject("WMPlayer.OCX.7"); } if (axo) { parseFloat(axo.versionInfo); version=parseFloat(axo.versionInfo); } } catch(e) {} } return version; } function detectWMPVer(reqVer) { var version = getWMPVer(); if (parseInt(version) != NaN && parseInt(version) >= parseFloat(reqVer)) { return true; } else if (parseInt(version) != NaN && parseInt(version) < parseFloat(reqVer)) { return false; } else if (navigator.plugins && navigator.plugins.length) { for (var i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf('Windows Media') != -1) { // WMP installed but cannot detect version. hope for the best return true; } } } else { return false; } } function detectMozillaActiveXObject() { var hasaxo; if (navigator.plugins && navigator.plugins.length) { var hasaxo = false; for (var i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf('ActiveX') != -1 && window.GeckoActiveXObject) { hasaxo = true; break; } } } return hasaxo; } // Flash Detection // ************************************** function getFlashVer() { PlayerVersion = function(arrVersion){ this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; this.revision = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; } var version = new PlayerVersion([0,0,0]); if(navigator.plugins && navigator.mimeTypes.length){ var x = navigator.plugins["Shockwave Flash"]; if(x && x.description) { version = new PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); } }else{ try{ var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); }catch(e){ try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); version = new PlayerVersion([6,0,21]); axo.AllowScriptAccess = "always"; } catch(e) { if (PlayerVersion.major == 6) { return version; } } try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(e) {} } if (axo != null) { version = new PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); } } return version; } function detectFlashVer(reqMajorVer, reqMinorVer, reqRevision) { var versionArr = getFlashVer(); if (versionArr.major > parseFloat(reqMajorVer)) { return true; } else if (versionArr.major == parseFloat(reqMajorVer)) { if (versionArr.minor > parseFloat(reqMinorVer)) { return true; } else if (versionArr.minor == parseFloat(reqMinorVer)) { if (versionArr.revision >= parseFloat(reqRevision)) { return true; } } } return false; } function swapImage (targetImg, srcImg) { var swapImg = document.getElementById(targetImg); swapImg.src = srcImg.src; } navigateTop = function(args) { top.location.href = args; } /***** SIMPLE WINDOW OPEN AND FOCUS UTILITY *****/ function openAndFocus(url,name,features){ var o = window.open(url, name, features); o.focus(); } /***** WINDOW OPEN UTILITY *****/ function windowOpener(args){ var argsArray = args.split(',') var url = ""; var name = ""; var features = ""; var replace = ""; for (i = 0; i < argsArray.length; i++){ switch(i){ case 0: url = argsArray[i]; break; case 1: name = argsArray[i]; break; case 2: features = argsArray[i]; break; default: if (argsArray[i].indexOf("replace") > -1){ replace = argsArray[i]; } else { features = features + "," + argsArray[i]; } break; } } window.open(url, name, features, replace); } /**** PLAYER EMBEDDER/CONTROLLER FOR MULTIPLE MEDIA PLAYERS ****/ /** * the id is the string form of the var name * it will be called by flash to communicate with the instance * var pc = PlayerController("pc"); */ function PlayerController(instanceId) { // required if(!instanceId) return; //public vars this.pathToSwf = "/global/apps/fbml/mtvi/flash_browser_fp8.swf"; this.configUrl = "/player/embed/mtv/popup/configuration.jhtml" this.flashVersion = "8"; this.defaultWidth = 300; this.defaultHeight = 300; this.defaultBgcolor = "#000000"; //private vars var _players = new Array(); var _instanceId = instanceId; var _stopPlayers = function(dontStopId) { for(var i in _players) { var id = _players[i]; if(id != dontStopId) document.getElementById(id).stopPlayer(); } } this.write = function(navigateToUrl,target,id,width,height,bgcolor) { width = !isNaN(width) ? width : this.defaultWidth; height = !isNaN(height) ? height : this.defaultHeight; bgcolor = !isNaN(bgcolor) ? bgcolor : this.bgcolor; var so = new SWFObject(this.pathToSwf, id, width, height, this.flashVersion, bgcolor); so.addParam("allowFullScreen","true"); so.addVariable("CONFIG_URL",this.configUrl+navigateToUrl); so.addParam("bgcolor",bgcolor); so.addVariable("name",id); so.addVariable("playerControllerId",_instanceId); so.write(target); _players.push(id); } this.onPlay = function (id) { try { if(id) _stopPlayers(id); }catch(e) {} } }; /**** COAD FOR EMBEDDED PLAYER ON HTML SITE ****/ function CoAdBrowser(targetDiv,scrolling) { //private vars var inited = false; var iframeBrowser; var target; var currentSrc; this.updateWindow = function (src,width,height) { try { if(!inited) init(); iframeBrowser.style.cssText = 'width:' + 300 + 'px;height:' + height + 'px;'; }catch(e) {} setSrc(src); } this.destroyWindow = function() { try{ iframeBrowser.contentWindow.location.replace("about:blank"); }catch(e){} target.removeChild(iframeBrowser); } // private methods var init = function() { try { var scrolling = scrolling && scrolling != "null" ? scrolling : "no"; if(navigator.appName=="Microsoft Internet Explorer"){ iframeBrowser = document.createElement(''); }else{ iframeBrowser = document.createElement('iframe'); iframeBrowser.setAttribute("frameborder", 0); iframeBrowser.setAttribute("scrolling", scrolling); iframeBrowser.setAttribute("allowtransparency", "true"); iframeBrowser.setAttribute("background-color", "transparent"); } iframeBrowser.style.display = 'none'; target = document.getElementById(targetDiv); target.appendChild(iframeBrowser); inited = true; if(src) this.updateWindow(position,left,top,width,height,src,depth,visible); }catch(e) {} } var setSrc = function(src) { if(src && currentSrc!=src){ try{ if(iframeBrowser.contentWindow) iframeBrowser.contentWindow.location.replace(src); else iframeBrowser.src = src; currentSrc = src; }catch(e){ iframeBrowser.src = src; currentSrc = src; } } } }; /** @fileoverview This JavaScript file represents the core browser-side functionality supplied by Taconite. In general, the tools in this file wrap an instance of XMLHttpRequest object and provide utility methods for gather data from form elements to be sent to the server as par of an Ajax request. */ /** Constructor for the AjaxRequest class.

Example:

var ajaxRequest = new AjaxRequest("YOUR_URL"); @class The AjaxRequest object wraps an instance of XMLHttpRequest and provides facilities for setting functions that are called before a request is made and after a request returns. By default, AjaxRequest handles the server response by simply calling eval(), passing to it the responseText from the XMLHttpRequestObject, of course assuming that the response was generated by Taconite on the server side and that running eval() will update the web page.

Example Usage:

var ajaxRequest = new AjaxRequest("YOUR_URL");
ajaxRequest.addFormElements("form_element_id_attribute_value");
ajaxRequest.sendRequest(); @constructor @param {String} a String repesenting the URL to which the Ajax request will be sent. */ var taconite_client_version=1.6; function AjaxRequest(url) { /** @private */ var self = this; /** @private */ var xmlHttp = createXMLHttpRequest(); /** @private */ var queryString = ""; /** @private */ var requestURL = url; /** @private */ var method = "GET"; /** @private */ var preRequest = null; /** @private */ var postRequest = null; /** @private */ var debugResponse = false; /** @private */ var async = true; /** @private errorHandler*/ var errorHandler = null; /** @private */ var useCacheBust = false; /** Return the instance of the XMLHttpRequest object wrapped by this object. @return XMLHttpRequest */ this.getXMLHttpRequestObject = function() { return xmlHttp; } /** Set the pre-request function. This function will be called prior to sending the Ajax request. The pre-request function is passed a reference to this object. @param {Function} The function to be called prior to sending the Ajax request. The function is passed a refernce of this object. */ this.setPreRequest = function(func) { preRequest = func; } /** Set the post-request function. This function will be called after the response has been received and after eval() has been called using the XMLHttpRequest object's responseText. The post-request function is passed a reference to this object. @param {Function} The function to be called after receiving the Ajax response. The function is passed a refernce of this object. */ this.setPostRequest = function(func) { postRequest = func; } /** Return the post request function. */ this.getPostRequest = function() { return postRequest; } /** Send the Ajax request using the POST method. Use with caution -- some browsers do not support the POST method with the XMLHttpRequest object. */ this.setUsePOST = function() { method = "POST"; } /** Send the Ajax request using the GET method, where parameters are sent as a query string appended to the URL. This is the default behavior. */ this.setUseGET = function() { method = "GET"; } /** Enable client-side debugging. The server's response will be written to a text area appended to the bottom of the page. If parsing is performed on the client side, then the results of the parsing operations are shown in their own text areas. */ this.setEchoDebugInfo = function() { debugResponse = true; } /** Indicate if debugging is enabled. @return boolean */ this.isEchoDebugInfo = function() { return debugResponse; } /** Set the query string that will be sent to the server. For GET requests, the query string is appended to the URL. For POST requests, the query string is sent in the request body. This method is useful, for example, if you want to send an XML string or JSON string to the server. @param {String} qa, the new query string value. */ this.setQueryString = function(qs) { queryString = qs; } /** Return the query string. @return The query string. */ this.getQueryString = function() { return queryString; } /** @param {Boolean} asyncBoolean, set to true if asynchronous request, false synchronous request. */ this.setAsync = function(asyncBoolean){ async = asyncBoolean; } /** @param {Function} Set the error handler function that is called if the server's HTTP response code is something other than 200. */ this.setErrorHandler = function(func){ errorHandler = func; } /** Set cache busting on the request. (reifmanm) */ this.setUseCacheBust = function() { useCacheBust = true; } /** Add all of the form elements under the specified form to the query string to be sent to the server as part of the Ajax request. The values are automatically encoded. @param {String} formID, the value of the id attribute of the form from which you wish to accumulate the form values. */ this.addFormElements = function(formID) { var formElements = document.getElementById(formID).elements; var values = toQueryString(formElements); accumulateQueryString(values); } /** @private */ function accumulateQueryString(newValues) { if(queryString == "") { queryString = newValues; } else { queryString = queryString + "&" + newValues; } } /** Add the name/value pair to the query string. @param {String} name @param {String} value */ this.addNameValuePair = function(name, value) { var nameValuePair = name + "=" + encodeURIComponent(value); accumulateQueryString(nameValuePair); } /** Same as addNamedFormElements, except it will filter form elements by form's id. For example, these are all valid uses:

ajaxRequest.addNamedFormElements("form-id""element-name-1");
ajaxRequest.addNamedFormElements("form-id","element-name-1", "element-name-2", "element-name-3"); */ this.addNamedFormElementsByFormID = function() { var elementName = ""; var namedElements = null; for(var i = 1; i < arguments.length; i++) { elementName = arguments[i]; namedElements = document.getElementsByName(elementName); var arNamedElements = new Array(); for(j = 0; j < namedElements.length; j++) { if(namedElements[j].form && namedElements[j].form.getAttribute("id") == arguments[0]){ arNamedElements.push(namedElements[j]); } } if(arNamedElements.length > 0){ elementValues = toQueryString(arNamedElements); accumulateQueryString(elementValues); } } } /** Add the values of the named form elements to the query string to be sent to the server as part of the Ajax request. This method takes any number of Strings representing the form elements for wish you wish to accumulate the values. The Strings must be the value of the element's name attribute.

For example, these are all valid uses:

ajaxRequest.addNamedFormElements("element-name-1");
ajaxRequest.addNamedFormElements("element-name-1", "element-name-2", "element-name-3"); */ this.addNamedFormElements = function() { var elementName = ""; var namedElements = null; for(var i = 0; i < arguments.length; i++) { elementName = arguments[i]; namedElements = document.getElementsByName(elementName); elementValues = toQueryString(namedElements); accumulateQueryString(elementValues); } } /** Add the values of the id'd form elements to the query string to be sent to the server as part of the Ajax request. This method takes any number of Strings representing the ids of the form elements for wish you wish to accumulate the values. The Strings must be the value of the element's name attribute.

For example, these are all valid uses:

ajaxRequest.addFormElementsById("element-id-1");
ajaxRequest.addFormElementsById("element-id-1", "element-id-2", "element-id-3"); */ this.addFormElementsById = function() { var id = ""; var element = null; var elements = new Array(); for(var h = 0; h < arguments.length; h++) { element = document.getElementById(arguments[h]); if(element != null) { elements[h] = element; } } elementValues = toQueryString(elements); accumulateQueryString(elementValues); } /** Send the Ajax request. */ this.sendRequest = function() { if(preRequest) { preRequest(self); } var obj = this; if(async) xmlHttp.onreadystatechange = function () { handleStateChange(self) }; if(useCacheBust){ if(requestURL.indexOf("?") > 0) { requestURL = requestURL + "&ts=" + new Date().getTime(); } else { requestURL = requestURL + "?ts=" + new Date().getTime(); } } try { if(method == "GET") { if(queryString.length > 0) { var connector = (requestURL.indexOf("?") > 0) ? "&" : "?"; requestURL = requestURL + connector + queryString; } xmlHttp.open(method, requestURL, async); xmlHttp.send(null); } else { xmlHttp.open(method, requestURL, async); //Fix a bug in Firefox when posting try { if (xmlHttp.overrideMimeType) { xmlHttp.setRequestHeader("Connection", "close");//set header after open } } catch(e) { // Do nothing } xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.send(queryString); } } catch(exception) { if(errorHandler) { errorHandler(self, exception); } else { throw exception; } } if(!async) { //synchronous request, handle the state change handleStateChange(self); } if(self.isEchoDebugInfo()) { echoRequestParams(); } } handleStateChange = function(ajaxRequest) { if(ajaxRequest.getXMLHttpRequestObject().readyState != 4) { return; } try { var debug = ajaxRequest.isEchoDebugInfo(); if(debug) { echoResponse(ajaxRequest); } //handle null responseXML var nodes = null; if (ajaxRequest.getXMLHttpRequestObject().responseXML != null) { nodes = ajaxRequest.getXMLHttpRequestObject().responseXML.documentElement.childNodes; } else { nodes = new Array(); } var parser = new XhtmlToDOMParser(); var parseInBrowser = ""; for(var i = 0; i < nodes.length; i++) { if(nodes[i].nodeType != 1 || !isTaconiteTag(nodes[i])) { continue; } parseInBrowser = nodes[i].getAttribute("parseInBrowser"); if(parseInBrowser == "true") { parser.parseXhtml(nodes[i]); var js = parser.getJavaScript(); if(debug) { echoParsedJavaScript(js); } } else { eval(nodes[i].firstChild.nodeValue); } } if(ajaxRequest.getPostRequest()) { var f = ajaxRequest.getPostRequest(); f(ajaxRequest); } } catch(exception) { if(errorHandler) { errorHandler(self, exception); } else { throw exception; } } } /** @private */ function isTaconiteTag(node) { return node.tagName.substring(0, 9) == "taconite-"; } /** @private */ function toQueryString(elements) { var node = null; var qs = ""; var name = ""; var tempString = ""; for(var i = 0; i < elements.length; i++) { tempString = ""; node = elements[i]; name = node.getAttribute("name"); //use id if name is null if (!name) { name = node.getAttribute("id"); } if(node.tagName.toLowerCase() == "input") { if(node.type.toLowerCase() == "radio" || node.type.toLowerCase() == "checkbox") { if(node.checked) { tempString = name + "=" + node.value; } } if(node.type.toLowerCase() == "text" || node.type.toLowerCase() == "hidden" || node.type.toLowerCase() == "password") { tempString = name + "=" + encodeURIComponent(node.value); } } else if(node.tagName.toLowerCase() == "select") { tempString = getSelectedOptions(node); } else if(node.tagName.toLowerCase() == "textarea") { tempString = name + "=" + encodeURIComponent(node.value); } if(tempString != "") { if(qs == "") { qs = tempString; } else { qs = qs + "&" + tempString; } } } return qs; } /** @private */ function getSelectedOptions(select) { var options = select.options; var option = null; var qs = ""; var tempString = ""; for(var x = 0; x < options.length; x++) { tempString = ""; option = options[x]; if(option.selected) { tempString = select.name + "=" + option.value; } if(tempString != "") { if(qs == "") { qs = tempString; } else { qs = qs + "&" + tempString; } } } return qs; } /** @private */ function echoResponse(ajaxRequest) { var echoTextArea = document.getElementById("debugResponse"); if(echoTextArea == null) { echoTextArea = createDebugTextArea("Server Response:", "debugResponse"); } var debugText = ajaxRequest.getXMLHttpRequestObject().status + " " + ajaxRequest.getXMLHttpRequestObject().statusText + "\n\n\n"; echoTextArea.value = debugText + ajaxRequest.getXMLHttpRequestObject().responseText; } /** @private */ function echoParsedJavaScript(js) { var echoTextArea = document.getElementById("debugParsedJavaScript"); if(echoTextArea == null) { var echoTextArea = createDebugTextArea("Parsed JavaScript (by JavaScript Parser):", "debugParsedJavaScript"); } echoTextArea.value = js; } /** @private */ function createDebugTextArea(label, id) { echoTextArea = document.createElement("textarea"); echoTextArea.setAttribute("id", id); echoTextArea.setAttribute("rows", "15"); echoTextArea.setAttribute("style", "width:100%"); echoTextArea.style.cssText = "width:100%"; document.getElementsByTagName("body")[0].appendChild(document.createTextNode(label)); document.getElementsByTagName("body")[0].appendChild(echoTextArea); return echoTextArea; } /** @private */ function echoRequestParams() { var qsTextBox = document.getElementById("qsTextBox"); if(qsTextBox == null) { qsTextBox = createDebugTextBox("Query String:", "qsTextBox"); } qsTextBox.value = queryString; var urlTextBox = document.getElementById("urlTextBox"); if(urlTextBox == null) { urlTextBox = createDebugTextBox("URL (Includes query string if GET request):", "urlTextBox"); } urlTextBox.value = requestURL; } /** @private */ function createDebugTextBox(label, id) { textBox = document.createElement("input"); textBox.setAttribute("type", "text"); textBox.setAttribute("id", id); textBox.setAttribute("style", "width:100%"); textBox.style.cssText = "width:100%"; document.getElementsByTagName("body")[0].appendChild(document.createTextNode(label)); document.getElementsByTagName("body")[0].appendChild(textBox); return textBox; } } /** Create an instance of the XMLHttpRequest object, using the appropriate method for the type of browser in which this script is running. For Internet Explorer, it's an ActiveX object, for all others it's a native JavaScript object. @return an instance of the XMLHttpRequest object. */ function createXMLHttpRequest() { var req = false; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } } } return req; } // JavaScript Document var taconite_parser_version=1.502; var isIE=document.uniqueID; String.prototype.trim = function() { //skip leading and trailing whitespace //and return everything in between var x=this; x=x.replace(/^\s*(.*)/, "$1"); x=x.replace(/(.*?)\s*$/, "$1"); return x; }; function requiresContextNode(xmlTagName) { return !(xmlTagName == "taconite-execute-javascript" || xmlTagName == "taconite-redirect"); } function XhtmlToDOMParser(){ this.parseXhtml = function(xml){ var xmlTagName=xml.tagName.toLowerCase(); var contextNode=document.getElementById(xml.getAttribute("contextNodeID")); if(contextNode == null && requiresContextNode(xmlTagName)){ return false; } switch (xmlTagName) { case "taconite-append-as-children": getReplaceChildren(contextNode,xml,false); break; case "taconite-delete": getDelete(contextNode,xml); break; case "taconite-append-as-first-child": getAppendAsFirstChild(contextNode,xml); break; case "taconite-insert-after": getInsertAfter(contextNode,xml); break; case "taconite-insert-before": getInsertBefore(contextNode,xml); break; case "taconite-replace-children": getReplaceChildren(contextNode,xml,true); break; case "taconite-replace": getReplace(contextNode,xml); break; case "taconite-set-attributes": xml.removeAttribute("contextNodeID"); xml.removeAttribute("parseInBrowser"); handleAttributes(contextNode,xml); break; case "taconite-redirect": handleRedirect(xml); break; case "taconite-execute-javascript": executeJavascript(xml); break; } return true; }; function isInlineMode(node) { var attrType; if(!node.tagName.toLowerCase() == "input") { return false; } attrType=node.getAttribute("type"); if(attrType=="radio" || attrType=="checkbox") { return true; } return false; } this.getJavaScript= function() { return "var dummy_taconite_variable=0"; }; function handleNode(xmlNode){ var nodeType = xmlNode.nodeType; switch(nodeType) { case 1: //ELEMENT_NODE return handleElement(xmlNode); case 3: //TEXT_NODE case 4: //CDATA_SECTION_NODE var textNode = document.createTextNode(xmlNode.nodeValue); if(isIE) { textNode.nodeValue = textNode.nodeValue.replace(/\n/g, '\r'); } return textNode; } return null; } function handleElement(xmlNode){ var domElemNode=null; var xmlNodeTagName=xmlNode.tagName.toLowerCase(); if(isIE){ if(isInlineMode(xmlNode)) { return document.createElement(""); } if(xmlNodeTagName == "style"){ //In internet explorer, we have to use styleSheets array. var text,rulesArray,styleSheetPtr; var regExp = /\s+/g; text=xmlNode.text.replace(regExp, " "); rulesArray=text.split("}"); domElemNode=document.createElement("style"); styleSheetPtr=document.styleSheets[document.styleSheets.length-1]; for(var i=0;i 0){ domElemNode.text=xmlNode.text; } } else{ for(var z = 0; z < xmlNode.childNodes.length; z++) { var domChildNode=handleNode(xmlNode.childNodes[z]); if(domChildNode!=null) { domElemNode.appendChild(domChildNode); } } } } return domElemNode; } function useIEFormElementCreationStrategy(xmlNodeTagName) { var useIEStrategy = false; if (isIE && ( xmlNodeTagName.toLowerCase() == "form" || xmlNodeTagName.toLowerCase() == "input" || xmlNodeTagName.toLowerCase() == "textarea" || xmlNodeTagName.toLowerCase() == "select" || xmlNodeTagName.toLowerCase() == "a" || xmlNodeTagName.toLowerCase() == "applet" || xmlNodeTagName.toLowerCase() == "button" || xmlNodeTagName.toLowerCase() == "img" || xmlNodeTagName.toLowerCase() == "link" || xmlNodeTagName.toLowerCase() == "map" || xmlNodeTagName.toLowerCase() == "object")) { useIEStrategy = true; } return useIEStrategy; } function createFormElementsForIEStrategy(xmlNode) { var attr = null; var name = ""; var value = ""; for (var x = 0; x < xmlNode.attributes.length; x++) { attr = xmlNode.attributes[x]; name = attr.name.trim(); if (name == "name") { value = attr.value.trim(); } } domElemNode = document.createElement("<" + xmlNode.tagName + " name='" + value + "' />"); // e.g. document.createElement(""); return domElemNode; } function handleAttributes(domNode, xmlNode) { var attr = null; var attrString = ""; var name = ""; var value = ""; var returnAsText = false; if(arguments.length == 3) { returnAsText = true; } for(var x = 0; x < xmlNode.attributes.length; x++) { attr = xmlNode.attributes[x]; name = cleanAttributeName(attr.name.trim()); value = attr.value.trim(); if(!returnAsText){ if(name == "style") { /* IE workaround */ domNode.style.cssText = value; /* Standards compliant */ domNode.setAttribute(name, value); } else if(name.trim().toLowerCase().substring(0, 2) == "on") { /* IE workaround for event handlers */ //domNode.setAttribute(name,value); eval("domNode." + name.trim().toLowerCase() + "=function(){" + value + "}"); } else if(name == "value") { /* IE workaround for the value attribute -- makes form elements selectable/editable */ domNode.value = value; } else if(useIEFormElementCreationStrategy(xmlNode.tagName) && name == "name") { //Do nothing, as the "name" attribute was handled in the createFormElementsForIEStrategy function continue; } else { /* Standards compliant */ domNode.setAttribute(name,value); } /* class attribute workaround for IE */ if(name == "class") { domNode.setAttribute("className",value); } }else{ attrString = attrString + name + "=\"" + value + "\" " ; } } return attrString; } function getAppendAsFirstChild(domNode,xml){ var firstNode=null; if(domNode.childNodes.length > 0) { firstNode=domNode.childNodes[0]; } for(var i=0;i0){ domNode.removeChild(domNode.childNodes[0]); } } for(var i=0;i<\/scr'+'ipt>'; } adCall.writeCall = function(size) { if (size) { var call = ''; call = adCall.beg + getDcoptStr() + getTileStr() + ';sz=' + size + adCall.end; //lose extra semi-colons call = call.replace(/;+/g, ';' ); if (siteVersion == 'HTML') { document.write(call); } else { document.write('advertisement'); } } } getDcoptStr = function() { var ds = ''; if (adCall.dcopt == 'on') ds += 'ist;'; else ds += 'off;'; //dcopt is on for only the first ad call of page adCall.dcopt = 'off'; return(';dcopt=' + ds); } getUpsellStr = function(sz) { var us = ''; if (sz == '728x90') us = '/sitewide/images/shadow/temp-upsell.gif'; else if (sz == '300x250') us = '/sitewide/images/shadow/temp-upsell-ad.jpg'; return(us); } getTileStr = function() { var ts = ''; ts = "tile=" + adCall.tile; adCall.tile++; return(ts); }