// Survey rendering code; Author = Brenden West. Updated - 3-14-06 // Formats: 1=choices in n cols, 3=images, 4=scorecard, 5=comparison var sUA = navigator.appName.toLowerCase(); var sSpacer = ""; var aQuery = getQueryParams(); var sPrevVote = (aQuery["pv"]) ? aQuery["pv"] : ""; var levCounter = 60; var imgClear = "http://www.msnbc.msn.com/images/cleardot.gif"; var errorMsgSurvey = "Your response cannot be recorded. For assistance please contact MSNBC technical support."; function surveyDefaults(oData) { if (window.UberSniff && !window.oSniff) { oSniff = new UberSniff(); } bMoz = (oSniff.ie > 0) ? 0 : 1; var parentData = (aQuery["parentid"]) ? eval("top."+aQuery["parentid"]) : ""; if (parentData) { oData.appWidth = parentData.copyWidth-18-2*parentData.copyMargin; } else if (aQuery["w"]) { oData.appWidth = aQuery["w"]; } else if (!oData.appWidth) { oData.appWidth = 300; } if (parentData) { oData.appBG = parentData.appBG[1]; } else if (!oData.appBG) { oData.appBG = ""; } else { oData.appBG = oData.appBG.replace("bgcolor=","background-color:") + ";"; } if (!oData.appHeader) { oData.appHeader=""; } else if (oData.appHeader[0] && oData.appHeader[0].indexOf("") > -1) { oData.appHeader=""; } if (oData.HeaderIcon) { oData.appHeader = oData.HeaderIcon + oData.appHeader; } if (!oData.appDeck) { oData.appDeck = new Array("",""); } else if (oData.appDeck.indexOf("|") > -1) { oData.appDeck = oData.appDeck.split("|"); } else if (typeof oData.appDeck == "string") { oData.appDeck = new Array(oData.appDeck,oData.appDeck); } if (!oData.appFooter) { oData.appFooter = ""; } if (oData.appFmt == null) { oData.appFmt = 1; } if (parentData) { oData.sBodyFont = parentData.sBodyFont; } else if (!oData.sBodyFont) { oData.sBodyFont = ""; } oData.sBodyFont = "font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; font-weight: normal; line-height: 140%;" + oData.sBodyFont; if (!oData.sHedStyle) { oData.sHedStyle = ""; } oData.sHedStyle = "font-weight: bold;text-transform:uppercase;" + oData.sHedStyle; if (!oData.sDeckStyle) { oData.sDeckStyle = ""; } oData.sDeckStyle = "font-weight: bold;color:#666;padding-top:10px;"+oData.sDeckStyle; if (!oData.sSubHedStyle) { oData.sSubHedStyle = ""; } oData.sSubHedStyle="font-size: 14px; font-weight:bold;color:#CC0000;padding-top:8px;" + oData.sSubHedStyle; if (parentData) { oData.headlineStyle = parentData.headlineStyle; } else if (!oData.headlineStyle) { oData.headlineStyle = ""; } oData.headlineStyle = "font-weight:bold;padding:10px 0px 5px 0px;" + oData.headlineStyle; if (!oData.imgBar) { oData.imgBar = "http://msnbcmedia.msn.com/i/msnbc/Components/ColorBoxes/Styles/ColorboxImages(globalonlyplease)/dotRed.gif"; } oData.columns = (aQuery["cols"]) ? aQuery["cols"] : (oData.columns) ? oData.columns : 1; if (!oData.sResponseUrl) { oData.sResponseUrl = (sUA.indexOf("webtv") > -1) ? location.href : ""; } if (oData.bDhtml == null) { oData.bDhtml = (window.document && !oData.sResponseUrl) ? 1 : 0; } if (oData.bVoting == null) { oData.bVoting=1; } if (oData.bResults == null) { oData.bResults=1; } if (oData.bSort == null) { oData.bSort=0; } if (oData.bDispQNums == null) { oData.bDispQNums=0; } if (!oData.butSubmit) { oData.butSubmit = "http://msnbcmedia.msn.com/i/msnbc/Components/Art/SITEWIDE/buttons/vote.gif"; } if (!oData.sVotePrompt) { oData.sVotePrompt = "Vote to see results"; } if (!oData.sDisclaimer) { oData.sDisclaimer = "Not a scientific survey. Click to learn more."; if (oData.bResults) { oData.sDisclaimer += " Results may not total 100% due to rounding."; } } if (!oData.sAnswers) { oData.sAnswers=""; } if (!oData.sAnsText) { oData.sAnsText=""; } if (!oData.subHeds) { oData.subHeds=""; } if (!oData.rowAlt) { oData.rowAlt = "#EEEEEE"; } if (!oData.rowSpacer) { oData.rowSpacer = 15; } oData.copyMargin = (parentData) ? 0 : (oData.copyMargin == null) ? 9 : oData.copyMargin; if (parentData || !oData.copyBorder) { oData.copyBorder = "border:0px;"; } if (!oData.altPath) { oData.altPath = ""; } if (oData.sAnswers) { oData.butSubmit = "http://msnbcmedia.msn.com/i/msnbc/Components/Art/SITEWIDE/buttons/submit.gif"; oData.appDeck[1] += "Correct answers are shown in green. Percentages indicate how other MSNBC readers responded."; } if (!oData.bResults) { oData.sVotePrompt = ""; oData.sDisclaimer=""; } // LEV only if (oData.bCancel == null) { oData.bCancel = 1; } if (oData.bVoteAgain == null && oData.surveyType == "lev") { oData.bVoteAgain = 1; } if (oData.bRequireAll == null) { oData.bRequireAll=0; } } function getSurveyStyles(oData) { var LVname = oData.ID; var sTmp = ""; return sTmp; } function DisplayLV(oData) { if (oData) { surveyDefaults(oData); if (oData.author == "none" && oData.display == "results") { // no GUID oData.sDisclaimer = errorMsgSurvey; } document.write(getSurveyStyles(oData)); // conditional settings if (location.href.indexOf("refer=vote") > 0 || oData.bVoting==0) { oData.display="results"; } if (oData.appFmt == 4) { // scorecard if (oData.subHeds) { var aTmp = oData.subHeds.split("^"); oData.itemsPerSubHed = (aTmp[1]) ? aTmp.split("|") : ""; oData.subHeds = aTmp[0].split("|"); } } else if (oData.appFmt == 3) { LVDisplayPhoto(oData); } else { if (oData.display=="vote" && oData.bVoting) { LVDisplayForm(oData); if (oData.bDhtml) { LVDisplayRes(oData); } } else { LVDisplayRes(oData); if (oData.bVoteAgain && oData.bVoting) { setTimeout("SetClock()",1000); } } } } } function LVDisplayPhoto(oData) { oData.nTeaseW=Math.round((oData.appWidth-(oData.columns-1)*8)/oData.columns); oData.imgBrdr = " style=\"border:1px solid #000000;\""; if (!oData.teaseSize) { var aimsSize = new Array(); aimsSize[0] = new Array("vmod",92,69); aimsSize[1] = new Array("thumb",98,98); aimsSize[2] = new Array("cmug",126,300); aimsSize[3] = new Array("htease",148,110); aimsSize[4] = new Array("vsmall",148,198); aimsSize[5] = new Array("vmedium",198,298); for (var i = 0;i"); document.write(""); if (aLV.sResponseUrl) { document.write(""); } if (aLV.surveyType == "lev") { document.write(""); if (aLV.bCancel) { document.write(""); } } if (aLV.appHeader) { document.write(""); } document.write(""); // end box if (aLV.appFooter) { document.write(""); } document.write("
" + aLV.appHeader + "" +sSpacer+ "
"); if (aLV.appFmt != 4) { var widthQ = (aLV.appWidth-14*aLV.columns-2*aLV.copyMargin-10*(aLV.columns-1))/aLV.columns; var nToteCols = 2 + 2*aLV.columns + aLV.columns-1; if (aLV.appDeck[0]) { document.write(""); } var cntrQ = 1; for (i=1;i 1) { document.write(getSpaceRow(aLV.rowSpacer,nToteCols)); } cntrQ++; document.write(""); var cntr = 0 for (var j=1;j"); } document.write(""); if (cntr+1 % aLV.columns == 0) { document.write(""); } cntr++ } } } } document.write(""); } else if (aLV.appFmt==4) { var iQnum = 1; var nGroups = (aLV.subHeds) ? aLV.subHeds.length : 1; var nItems = (aLV.length-1)/nGroups; if (aLV.appDeck[0]) { document.write(""); } for (i=0;i 1) { // unequal # of items nItems = aLV.itemsPerSubHed[i]; } document.write(""); for (j=0;j"); iQnum++; } } document.write(""); } document.write("
" +sSpacer+ "" +aLV.appDeck[0]+ "" +sSpacer+ "
" +sSpacer+ "" + qNumDisp + aLV[i][0][0] + "" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ ""+ aLV[i][j][0] +"" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ "" +butSubmit + "
"+aLV.sVotePrompt+"
" +sSpacer+ "
" +sSpacer+ "
" +aLV.appDeck[0]+ "
" +sSubHed+ "
" +sSpacer+ "
 "+aLV[iQnum][0][0]+ ""); for (var k=1;k "); } document.write("" +sSpacer+ "
" +sSpacer+ "
" +butSubmit + "
"+aLV.sVotePrompt+"
" +sSpacer+ "
" +aLV.appFooter+ "
"); } function LVDisplayRes(aLV) { var sTmp = ""; var qNum = 0; var qNumDisp = ""; var LVname = aLV.ID; var sVisible = (aLV.display=="vote") ? " style='display:none;' " : ""; document.write(""); if (aLV.appHeader) { document.write(""); } document.write(""); // end box if (aLV.appFooter) { document.write(""); } document.write("
" + aLV.appHeader + "
"); if (aLV.appFmt < 4) { // vertical columns var nColWidth = (aLV.appWidth-10*aLV.columns)/aLV.columns; var nToteCols = 2*aLV.columns; if (aLV.appDeck[1]) { document.write(""); } if (aLV.bResults) { if (aLV.sAnswers) { var sAnswers = aLV.sAnswers.split(","); var sAnsText = aLV.sAnsText.split("|"); } var cntrQ = 1; for (i=1;i 1) { document.write(getSpaceRow(aLV.rowSpacer,nToteCols+2)); } cntrQ++; var spacer = (i>1) ? '
' : ''; var sPlural = (aLV[i][0][1] != 1) ? "s" : ""; document.write("
"); var cntr = 0; if (aLV.bSort) { aLV[i] = sortVoteResults(aLV[i]); } for (var j=1;j"; if (sAnsText[i-1]) { sTmp += sAnsText[i-1]; } } if (cntr % aLV.columns == 0) { document.write(""); } var barWidth = Math.round((nColWidth-65) * (percentCur/100)); var imgBar = (bMoz) ? "" : ""; sImg = (percentCur > 0) ? (aLV.imgBar.indexOf(".gif") == -1) ? "" +imgBar+ "" : "" : ""; document.write(""); if (cntr+1 % aLV.columns == 0) { document.write(""); } cntr++ } } } } } // LEV revote if (aLV.bVoting && aLV.bVoteAgain) { document.write(""); } } else if (aLV.appFmt==4) { var sAltColor = "bgcolor="+ aLV.rowAlt; var nToteCols = 5; if (aLV.appDeck[1]) { document.write(""); } if (aLV.bResults) { var sPlural = (aLV[1][0][1] != 1) ? "s" : ""; document.write(""); var nGroups = (aLV.subHeds) ? aLV.subHeds.length : 1; var nItems = (aLV.length-1)/nGroups; iQnum = 1; for (i=0;i"); if (aLV.itemsPerSubHed && aLV.itemsPerSubHed.length>1) { // unequal # of items nItems = aLV.itemsPerSubHed[i]; } var Rating = 0; for (j=0;j"); iQnum++; } // maybe make this conditional Rating = Math.round((Rating/nItems)*100)/100 document.write(""); } } // end results // LEV revote if (aLV.bVoting && aLV.bVoteAgain) { document.write(""); } } else if (aLV.appFmt==5) { // COMPARISON if (!aLV.subHeds) { aLV.subHeds = "responses|web|nbc/wsj" ; } aLV.subHeds = (aLV.subHeds.indexOf("|") > -1) ? aLV.subHeds.split("|") : new Array("responses","web", aLV.subHeds); var sAltColor = "bgcolor="+ aLV.rowAlt; var nToteCols=6; if (aLV.appDeck[1]) { document.write(""); } document.write(""); for (i=1;i1) ? '
' : ''; var sPlural = (aLV[i][0][1] != 1) ? "s" : ""; document.write(getSpaceRow(aLV.rowSpacer,6) + "
"); var cntr=0; for (var j=1;j"); cntr++; } } } } // LEV revote if (aLV.bVoting && aLV.bVoteAgain) { document.write(""); } } document.write(""); document.write("
" +sSpacer+ "" +aLV.appDeck[1]+ "" +sSpacer+ "
" +sSpacer+ "" + qNumDisp + aLV[i][0][0] + "   * " + aLV[i][0][1] + " response" +sPlural+ "" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ "" + sTmp + "
" + percentCur +"% " +sImg+ "
" +sSpacer+ "If you change your mind, you can vote again in seconds.

" +aLV.appDeck[1]+ "
* " + aLV[1][0][1] + " response" +sPlural+ "
" +sSubHed+ "Rating" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ ""+aLV[iQnum][0][0]+"" +MakeStars(subRating)+ "" +subRating+ "" +sSpacer+ "
" +sSpacer+ "
 Overall" +MakeStars(Rating)+ "" +Rating+ "
" +sSpacer+ "
" +sSpacer+ "If you change your mind, you can vote again in seconds.

" +sSpacer+ "
" +aLV.appDeck[1]+ "
" +sSpacer+ "
* Percentages may not total to 100% for each question due to non-responses
" +sSpacer+ "" + qNumDisp + aLV[i][0][0] + "  * " + aLV[i][0][1] + " web response" +sPlural+ "" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ "" + aLV.subHeds[0] + "" +sSpacer+ "" + aLV.subHeds[1] + " " +aLV.subHeds[2]+ " " +sSpacer+ "
" +sSpacer+ "" +sSpacer+ "" +sSpacer+ "
" +sSpacer+ "" +aLV[i][j][0]+ "" +sSpacer+ "" +percentCur+ "" +nbcres[i-1][j-1]+ "" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ "If you change your mind, you can vote again in seconds.

" +sSpacer+ "
"+ aLV.sDisclaimer+ "
" +aLV.appFooter+ "
"); } function getCurPercent(votesTotal,votesCurrent,votesCum,percentCum) { var percentCur = 0; if (votesTotal > 0) { percentCur = Math.round(100*(votesCurrent/votesTotal),0); if (votesCurrent + votesCum == votesTotal && percentCum + percentCur != 100) { // if this is the last choice ensure percents total 100 percentCur = 100 - percentCum; } } return percentCur; } function sortVoteResults(aTmp1) { // SORT CHOICES for a survey question based on # of votes var aTmp = new Array(0,0); var bChanged = true; while (bChanged) { bChanged = false; for (var j=1;j=.25 && stars2<.5) { stars += ""; } else if (stars2>=.50 && stars2<.75) { stars += ""; } else if (stars2>=.75) { stars += ""; } return stars; } function SetClock() { if (levCounter>0) { document.frmsurvey.clock.value = levCounter-1; } levCounter--; setTimeout("SetClock()",1000); } function CheckVoteTime() { if (levCounter <= 0) { var sUrl = location.href; if (sUrl.indexOf("refer=") > -1) { sUrl = sUrl.substring(0,sUrl.indexOf("refer=")-1); } if (sUrl.indexOf("pv=") > -1) { sUrl = sUrl.substring(0,sUrl.indexOf("pv=")-1); } var sep = (sUrl.indexOf("?") > -1) ? "&" : "?"; location.href = sUrl + sep + "pv=" + sPrevVote; } else { alert("Sorry. You must wait one minute between votes.\r You'll be able to vote again in " +levCounter+ " seconds."); } } function LVDisplayPhotoForm(aLV) { var LVname = aLV.ID; var nToteCols = 2 + 2*aLV.columns-1; var spaceCell = "" +sSpacer+ ""; var str1=""; var str2=""; document.write(""); if (aLV.sResponseUrl) { document.write(""); } if (aLV.surveyType == "lev") { document.write(""); if (aLV.bCancel) { document.write(""); } } if (aLV.appHeader) { document.write(""); } document.write(""); // end box if (aLV.appFooter) { document.write(""); } document.write("
" + aLV.appHeader + "" +sSpacer+ "
"); if (aLV.appDeck[0]) { document.write("" +spaceCell+ "" +spaceCell+ ""); } for (i=1;i" +spaceCell+ "" +spaceCell+ ""); var cntr = 0; for (j=1;j"; str2 += ""; } var choiceText = aLV[i][j][0]; var imgName = cntr; if (choiceText.indexOf("|") > -1) { // same structure as interactives var aTmp = choiceText.split("|"); imgName = aTmp[3]; choiceText = aTmp[1]; } if (imgName == 0 || parseInt(imgName)) { sCntr = (imgName < 10) ? "0" + imgName : imgName; var imgFolder = (ssID) ? ssID : LVname; var sep = (imgFolder.lastIndexOf("_") == imgFolder.length-1) ? "" : "_"; imgUrl = aLV.altPath + imgFolder + sep + sCntr + aLV.teaseSize +".jpg"; imgName = aLV.ID+"_img" +sCntr; } else { if (imgName.indexOf("http:") >= 0 || imgName.indexOf("/") == 0) { imgUrl = imgName; } else { imgUrl = aLV.altPath + imgName.toLowerCase(); if (imgUrl.indexOf(aLV.teaseSize) == -1) { imgUrl = imgUrl.replace(".jpg",aLV.teaseSize+".jpg"); } } } var imgSrc = (imgUrl.indexOf("<") == -1) ? "" : getTeaseCode(imgUrl); str1 += "" str2 += ""; if ( (cntr+1) % aLV.columns == 0) { document.write(str1 + spaceCell+ "" + str2 + spaceCell+ "" + getSpaceRow(aLV.rowSpacer,nToteCols)); str1 = "";str2=""; } cntr++; } } if (aLV.columns > 1) { document.write(str1 + "" + str2 + ""); } } var sType = (aLV.surveyType) ? aLV.surveyType.toUpperCase() : ""; document.write("" + spaceCell+ ""); document.write("
" +aLV.appDeck[0]+ "
" + qNumDisp + aLV[i][0][0] + "
" +sSpacer+ "
" +sSpacer+ "
" +imgSrc+ "" +choiceText+ "
" +makeButton(aLV.butSubmit,aLV.ID,sType+ "Vote('" +aLV.ID+ "',"+aLV.bDhtml+")") + "
"+aLV.sVotePrompt+"
" +aLV.appFooter+ "
"); } function SetPhotoRadio(oRadio) { oRadio.checked=true; } function LVDisplayPhotoRes(aLV) { var LVname = aLV.ID; var nToteCols = 2 + 2*aLV.columns-1; var spaceCell = "" +sSpacer+ ""; var str1=""; var str2=""; document.write(""); if (aLV.appHeader) { document.write(""); } document.write(""); // end box if (aLV.appFooter) { document.write(""); } document.write("
" + aLV.appHeader + "
"); if (aLV.appDeck[1]) { document.write(""); } for (i=1;i"); for (j=1;j -1) { // same structure as interactives var aTmp = choiceText.split("|"); imgName = aTmp[3]; choiceText = aTmp[1]; } if (imgName == 0 || parseInt(imgName)) { sCntr = (imgName < 10) ? "0" + imgName : imgName; var imgFolder = (window.ssID) ? ssID : LVname; var sep = (imgFolder.lastIndexOf("_") == imgFolder.length-1) ? "" : "_"; imgUrl = aLV.altPath + imgFolder + sep + sCntr + aLV.teaseSize +".jpg"; } else { if (imgName.indexOf("http:") >= 0 || imgName.indexOf("/") == 0) { imgUrl = imgName; } else { imgUrl = aLV.altPath + imgName.toLowerCase(); if (imgUrl.indexOf(aLV.teaseSize) == -1) { imgUrl = imgUrl.replace(".jpg",aLV.teaseSize+".jpg"); } } } var imgSrc = (imgUrl.indexOf("<") == -1) ? "" : getTeaseCode(imgUrl); sVote = (aLV[i][j][1] == 1) ? "vote" : "votes"; if (cntr % aLV.columns == 0) { str1 = "" +spaceCell; str2 = "" +spaceCell; } else if (cntr+1 % aLV.columns != 0) { str1 += ""; str2 += ""; } str1 += ""; str2 += ""; if ( (cntr+1) % aLV.columns == 0) { document.write(str1 + spaceCell+ ""); document.write(str2 + spaceCell+ "" + getSpaceRow(aLV.rowSpacer,nToteCols)); str1 = "";str2=""; } cntr++; } } if (aLV.columns > 1) { document.write(str1 + "" + str2 + ""); } document.write(""); } // LEV revote if (aLV.bVoting && aLV.bVoteAgain) { document.write(""); } document.write("
" + aLV.appDeck[1] + "
" + qNumDisp + aLV[i][0][0] + "
" +aLV[i][0][1]+ " votes
" +sSpacer+ "" +sSpacer+ "
" +imgSrc+ "" + (j) + ". " +choiceText+ "
(" +aLV[i][j][1]+ " " + sVote + ")
" +sSpacer+ "
" +sSpacer+ "
" +sSpacer+ "If you change your mind, you can vote again in seconds.

" +sSpacer+ "
" +aLV.sDisclaimer+ "
" +aLV.appFooter+ "
"); } // COMMON FUNCTIONS function getSpaceRow(rowSpacer,nColspan) { var sTmp = ""; if (parseInt(rowSpacer) > 0) { sTmp = "" +sSpacer+ ""; } else if (rowSpacer) { sTmp = "" +rowSpacer+ ""; } return sTmp; } function getQueryParams() { var sQuery = location.search.substring(1); var aTmp = new Array(); if (sQuery) { aTmp = sQuery.split("&"); for (i=0;i" +oItem[2]+ "" : ""; if ((oItem[11] || oItem[12]) && oData.appLayout != 7) { var sSep = (oItem[11] && oItem[12]) ? " / " : ""; var sOverlay = (oItem[10] == "bg") ? "position:absolute;top:" +(oItem[13]-15)+ ";right:" +(oData.copyWidth - oItem[14]+5)+ ";color:#C6C6C6;": ""; sCredit += "
" +oItem[11]+ sSep +oItem[12]+ "
"; } if (imgSrc.indexOf(".swf") > -1) { var oTmp=new flashObj2(); oTmp.ID = oData.ID + nItem; oTmp.flashFile = imgSrc; oTmp.url = getHref(oItem[6]); oTmp.height = oItem[13]; oTmp.width = oItem[14]; imgSrc = oTmp.render(); } else if (imgSrc && imgSrc.indexOf("<") == 0) { // custom coding sTmp = imgSrc; } else if (!oItem[4] && imgSrc && imgSrc.indexOf("<") == -1) { // img ref only if (imgSrc.indexOf("/") != 0 && imgSrc.indexOf("http:") != 0) { imgSrc = (oData.altPath) ? oData.altPath + imgSrc : "/d/ip/" +oData.ID+ "/" + imgSrc; } var imgAlt = (oItem[5]) ? oItem[5] : (oItem[1] && oItem[1].indexOf("<") == -1) ? oItem[1] : ""; var imgAlign = (oItem[10]) ? " align="+oItem[10] : ""; var imgBrdr = (oItem[15]) ? " style=\"border:1px solid " +oItem[15]+ ";\"" : ""; var imgW = (oItem[14]) ? " width="+oItem[14] : ""; var imgH = (oItem[13]) ? " height="+oItem[13] : ""; if (oItem[10] == "bg") { var sBody = (oItem.body) ? oItem.body : ""; sTmp = "
" +caption + sBody + sCredit + "
"; } else { var imgPad = (!oItem[10]) ? "" : (oItem[10] == "left") ? "style=margin-right:5px;" : "style=margin-left:5px;"; imgSrc = "\"""; sTmp = "
" + imgSrc + "
" + sCredit; if (caption) { sTmp += "
" +caption+ "

"; } sTmp += "
"; } } return sTmp; } function makeButton(sImg,sName,sAction) { // CONSTRUCT buttons w/ states var sTmp = ""; var isImg=0; var imgExt = sImg.substring(sImg.length-3).toLowerCase(); if ((imgExt == "gif" || imgExt == "jpg") && sImg.indexOf("/j/msnbc/") == -1) { sTmp = ""; isImg=1; } else if (sImg.indexOf("<") == 0) { sTmp = sImg; isImg=1; } if (isImg) { sTmp = "" + sTmp+""; } return sTmp; }