var hostName = "http://affiliate.zap2it.com"; zcmv = {} zcmv.Conn = { /** creates a document element of 'type' with attribute list 'attrArr' * appends a TextNode 'textStr' as child element if not null * returns document elemet 'sfNode' */ getAttrsTextNode : function(type, attrArr, textStr) { var sfNode = document.createElement(type); if(attrArr!=null) { var attrList = attrArr.split('::'); //alert(attrList.length); for(var i=0; i3) { pageListStart = zcmv.Conn.thList.page; while(pageListStart>3) { pageListStart -= 3; count++; //alert(pageListStart + " "+ count); } pageListStart = (3 * count) + 1; } //alert(" start= " + start + " end = " + end + " pageTotal " + pageTotal); //alert(" zcmv.Conn.thList.page " + zcmv.Conn.thList.page + " pageListStart " + pageListStart + " count"); var thLtPagiDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-pagination::className=zc-pagination' , null); var thLtPagiAmtSpan = zcmv.Conn.getAttrsTextNode('span', 'class=zc-pagination-amount::className=zc-pagination-amount', (((zcmv.Conn.thList.page-1)*zcmv.Conn.thList.pageSize) + 1) + ' - ' + (((zcmv.Conn.thList.page-1)*zcmv.Conn.thList.pageSize) + zcmv.Conn.thList.pageSize) + ' of ' + thVO.theaters.length); thLtPagiDiv.appendChild(thLtPagiAmtSpan); var thLtPagiNavDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-pagination-nav::className=zc-pagination-nav', null); var prop = zcmv.Conn.thList.page>1 ? '::href=javascript:zcmv.Conn.thList.setPage(' + (zcmv.Conn.thList.page-1) +');' : ''; var thLtPagiPrevAnchor = zcmv.Conn.getAttrsTextNode('a', 'class=zc-pagination-back' + prop + '::className=zc-pagination-back' + prop, '<< Prev '); thLtPagiNavDiv.appendChild(thLtPagiPrevAnchor); var thLtPagiPagesSpan = zcmv.Conn.getAttrsTextNode('span', 'class=zc-pagination-pages::className=zc-pagination-pages', null); for(var pg = pageListStart; pg>'); thLtPagiNavDiv.appendChild(thLtPagiNextAnchor); thLtPagiDiv.appendChild(thLtPagiNavDiv); thLtInnerDiv.appendChild(thLtPagiDiv); var thLtList = zcmv.Conn.getAttrsTextNode('ol', 'class=zc-theater-list::className=zc-theater-list' , null); var thLtListData; for(var i = 0; i=end) thClass += ' zc-app-hidden'; thLtListData = zcmv.Conn.getAttrsTextNode('li', 'class=' + thClass + '::className=' + thClass + '::id=th' + thVO.theaters[i].theatreId , null); var thLtHead3 = zcmv.Conn.getAttrsTextNode('h3', 'class=fn org::className=fn org', null); var thLtSpan = zcmv.Conn.getAttrsTextNode('span', null, null); // add server name here ///// var thLtAnchor = zcmv.Conn.getAttrsTextNode('a', 'target=_blank::href=' + thVO.theaters[i].theaterurl, thVO.theaters[i].name); thLtSpan.appendChild(thLtAnchor); thLtHead3.appendChild(thLtSpan); thLtListData.appendChild(thLtHead3); var thLtAddDiv = zcmv.Conn.getAttrsTextNode('div', 'class=adr::className=adr', null); var thLtStreetDiv = zcmv.Conn.getAttrsTextNode('div', 'class=street-address::className=street-address', thVO.theaters[i].address); thLtAddDiv.appendChild(thLtStreetDiv); var thLtCitySpan = zcmv.Conn.getAttrsTextNode('div', 'class=locality::className=locality', thVO.theaters[i].city); thLtAddDiv.appendChild(thLtCitySpan); var thLtStateSpan = zcmv.Conn.getAttrsTextNode('div', 'class=region::className=region', thVO.theaters[i].state); thLtAddDiv.appendChild(thLtStateSpan); var thLtZipcodeSpan = zcmv.Conn.getAttrsTextNode('div', 'class=postal-code::className=postal-code', thVO.theaters[i].postalcode); thLtAddDiv.appendChild(thLtZipcodeSpan); thLtListData.appendChild(thLtAddDiv); var thLtGeoDiv = zcmv.Conn.getAttrsTextNode('div', 'class=geo::className=geo', null); var thLtLatSpan = zcmv.Conn.getAttrsTextNode('span', 'class=latitude::className=latitude', thVO.theaters[i].latitude); thLtGeoDiv.appendChild(thLtLatSpan); var thLtLngSpan = zcmv.Conn.getAttrsTextNode('span', 'class=longitude::className=longitude', thVO.theaters[i].longitude); thLtGeoDiv.appendChild(thLtLngSpan); thLtListData.appendChild(thLtGeoDiv); if(thVO.theaters[i].phonenumber) { var thLtTelDiv = zcmv.Conn.getAttrsTextNode('div', 'class=tel::className=tel', null); var thLtValueSpan = zcmv.Conn.getAttrsTextNode('span', 'class=value::className=value', thVO.theaters[i].phonenumber); thLtTelDiv.appendChild(thLtValueSpan); thLtListData.appendChild(thLtTelDiv); } if(thVO.theaters[i].theaterUrl) { var officialURL = thVO.theaters[i].theaterUrl; if(officialURL.indexOf("http://")<0) officialURL = "http://" + officialURL; var thLtURLDiv = zcmv.Conn.getAttrsTextNode('div', 'class=url::className=url', null); var thLtURLAnchor = zcmv.Conn.getAttrsTextNode('a', 'target=_blank::href=' + officialURL, 'Official Website'); thLtURLDiv.appendChild(thLtURLAnchor); thLtListData.appendChild(thLtURLDiv); } thLtList.appendChild(thLtListData); } thLtInnerDiv.appendChild(thLtList); thLtDiv.appendChild(thLtInnerDiv); //thLtDiv.innerHTML = "I am here ha ha ha"; //alert(thLtDiv.innerHTML); }, buildDirectXHTML : function(divId, listSize) { if(jdatastr!=undefined && jdatastr!=null) { var jsonstr = jdatastr; var returnStr = "Error"; //alert("jsonstr.theaterList = " + jsonstr.theaterList); var thVO = jsonstr.theaterList; if(thVO.status!=undefined && thVO.status!=null) { //alert("thVO.status.code ===" + thVO.status.code); var thLtWrapperDiv = zcmv.Conn.getAttrsTextNode('div', null, null); var thLtTabDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-tab-content::className=zc-tab-content', null); if(thVO.status.code==200 || thVO.status.code==201) { var thLtHead3 = zcmv.Conn.getAttrsTextNode('h3', null, 'Pick a Theater'); thLtTabDiv.appendChild(thLtHead3); var thLtList = zcmv.Conn.getAttrsTextNode('ol', null, null); if(listSize==undefined || listSize < 1 || thVO.theaters.length < listSize) listSize = thVO.theaters.length; for(var i=0; i>'); thLtMoreDiv.appendChild(thLtAnchor); thLtTabDiv.appendChild(thLtMoreDiv); thLtWrapperDiv.appendChild(thLtTabDiv); } //thLtWrapperDiv.innerHTML = ""; //thLtWrapperDiv.appendChild(thLtLtDiv); returnStr = thLtWrapperDiv.innerHTML; //alert("---"+returnStr+"---"); if(divId!='') { document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = returnStr; //alert(" just buildDirectxhtml ---"+zcmv.Conn.thList.returnStr+"---"); } else { zcmv.Conn.thList.returnStr = returnStr; //alert(" getconnector ---"+zcmv.Conn.thList.returnStr+"---"); } } } //else {alert("no jsonstg available" + jsonstg);} }, getXHTML : function(params) { //alert('XHTML ' + params); jQuery.ajax({ type: "GET", url: "/movies/theatreListService", data: params, dataType : "json", success: function(data) { zcmv.Conn.thList.setData(data, ''); } //alert('got result ' + data ); // }); }, getXHTML2 : function(params, listSize) { //alert('XHTML2 ' + params + ' ' + listSize ); jQuery.ajax({ type: "GET", url: "/movies/theatreListService", data: params, dataType : "json", success: function(data) { jdatastr = data; zcmv.Conn.thList.buildDirectXHTML('', listSize); } }); }, getConnector : function(divId) { //alert("into connector " + zcmv.Conn.thList.returnStr + ' divID ' + divId); if(zcmv.Conn.thList.returnStr!=undefined && zcmv.Conn.thList.returnStr!=null && zcmv.Conn.thList.returnStr!='') { document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = zcmv.Conn.thList.returnStr; zcmv.Conn.thList.divId = divId; } }, setPage : function(page) { //alert(' set page ' + page); if(page>1) zcmv.Conn.thList.page = page; else zcmv.Conn.thList.page = 1; zcmv.Conn.thList.buildXHTML(); //setTimeout("zcmv.Conn.thList.getConnector('" + divId + "');", 1500); }, setPageSize : function(size) { if(pageSize>0) zcmv.Conn.thList.pageSize = size; else zcmv.Conn.thList.pageSize = 3; zcmv.Conn.thList.buildXHTML(); } } zcmv.Conn.otwList = { divId : 'otwLtDiv', jsonStr : '', //returnStr : '', page : 1, pageSize : 3, getMoviesOpeningthisWeek : function(params, divId) { //alert('into getting movies form' + ' params ' + params); jQuery.ajax({ type: "GET", url: "/movies/jsp/movies/zcMVConnector.jsp", data: params, dataType : "json", success: function(data) { zcmv.Conn.otwList.setData(data, divId); } }); }, setData : function(data, divId) { zcmv.Conn.otwList.divId = divId; /* if(zcmv.Conn.otwList.divId!='')*/ document.getElementById(zcmv.Conn.otwList.divId).innerHTML = 'Please wait while movie list is getting updated...'; //alert('good till here ' + data); zcmv.Conn.otwList.jsonStr = eval((data)); if(zcmv.Conn.otwList.jsonStr.length == 0) { //alert("no jsonStr"); return "no jsonStr"; } else { //alert("into else " + zcmv.Conn.otwList.jsonStr.moviesthisweek.status.code + " " + zcmv.Conn.otwList.jsonStr.moviesthisweek.version); zcmv.Conn.otwList.buildXHTML(); } }, buildXHTML : function() { var returnStr = "Error"; var otwVO = zcmv.Conn.otwList.jsonStr.moviesthisweek; if(otwVO.status!=undefined && otwVO.status!=null) { //alert("otwVO.status.code ===" + otwVO.status.code); var thLtWrapperDiv = zcmv.Conn.getAttrsTextNode('div', null, null); //var = getAttrsTextNode(, , null); var otwLtDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-app zc-mltq::className=zc-app zc-mltq::id=mltq', null); if(otwVO.status.code!=200 && otwVO.status.code!=201) { var thLtInnerDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-app-result::className=zc-app-result', null); var thLtHead = zcmv.Conn.getAttrsTextNode('h2', null, 'Movies opening this week not available'); thLtInnerDiv.appendChild(thLtHead); var thLtErrorSpan = zcmv.Conn.getAttrsTextNode("span", null, ("Code : " + otwVO.status.code)); // //"class=zc-error" thLtInnerDiv.appendChild(thLtErrorSpan); thLtErrorSpan = zcmv.Conn.getAttrsTextNode("span", null, (" Message : " + otwVO.status.message)); // //"class=zc-error" thLtInnerDiv.appendChild(thLtErrorSpan); otwLtDiv.appendChild(thLtInnerDiv); } else { //alert("in buildXHTML with data just b4 display"); zcmv.Conn.otwList.displayList(otwLtDiv); } thLtWrapperDiv.innerHTML = ""; thLtWrapperDiv.appendChild(otwLtDiv); returnStr = thLtWrapperDiv.innerHTML; //alert("---"+returnStr+"---"); /*if(zcmv.Conn.otwList.divId!='') {*/ document.getElementById(zcmv.Conn.otwList.divId).innerHTML = ""; document.getElementById(zcmv.Conn.otwList.divId).innerHTML = returnStr; /*} else { zcmv.Conn.otwList.returnStr = returnStr; }*/ } }, displayList : function(otwLtDiv) { //alert("displaylist ()"); var otwVO = zcmv.Conn.otwList.jsonStr.moviesthisweek; var start = (zcmv.Conn.otwList.page-1) * zcmv.Conn.otwList.pageSize; var end = start + zcmv.Conn.otwList.pageSize; var pageTotal; if((otwVO.films.length % zcmv.Conn.otwList.pageSize)!=0) pageTotal = (otwVO.films.length + (zcmv.Conn.otwList.pageSize - (otwVO.films.length % zcmv.Conn.otwList.pageSize)))/ zcmv.Conn.otwList.pageSize; else pageTotal = otwVO.films.length / zcmv.Conn.otwList.pageSize; var otwInnerDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-app-result::className=zc-app-result', null); var otwHead = zcmv.Conn.getAttrsTextNode('h2', null, 'Movies Opening This Week'); otwInnerDiv.appendChild(otwHead); var count = 0; var pageListStart = 1; if(zcmv.Conn.otwList.page>3) { pageListStart = zcmv.Conn.otwList.page; while(pageListStart>3) { pageListStart -= 3; count++; //alert(pageListStart + " "+ count); } pageListStart = (3 * count) + 1; } //alert(" start= " + start + " end = " + end + " pageTotal " + pageTotal); //alert(" zcmv.Conn.otwList.page " + zcmv.Conn.otwList.page + " pageListStart " + pageListStart + " count"); var otwPagiDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-pagination::className=zc-pagination' , null); var otwPagiAmtSpan = zcmv.Conn.getAttrsTextNode('span', 'class=zc-pagination-amount::className=zc-pagination-amount', (((zcmv.Conn.otwList.page-1)*zcmv.Conn.otwList.pageSize) + 1) + ' - ' + (((zcmv.Conn.otwList.page-1)*zcmv.Conn.otwList.pageSize) + zcmv.Conn.otwList.pageSize) + ' of ' + otwVO.films.length); otwPagiDiv.appendChild(otwPagiAmtSpan); var otwPagiNavDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-pagination-nav::className=zc-pagination-nav', null); var prop = zcmv.Conn.otwList.page>1 ? '::href=javascript:zcmv.Conn.otwList.setPage(' + (zcmv.Conn.otwList.page-1) +');' : ''; var otwPagiPrevAnchor = zcmv.Conn.getAttrsTextNode('a', 'class=zc-pagination-back' + prop + '::className=zc-pagination-back' + prop, '<< Prev '); otwPagiNavDiv.appendChild(otwPagiPrevAnchor); var otwPagiPagesSpan = zcmv.Conn.getAttrsTextNode('span', 'class=zc-pagination-pages::className=zc-pagination-pages', null); for(var pg = pageListStart; pg>'); otwPagiNavDiv.appendChild(otwPagiNextAnchor); otwPagiDiv.appendChild(otwPagiNavDiv); otwInnerDiv.appendChild(otwPagiDiv); var otwList = zcmv.Conn.getAttrsTextNode('ol', 'class=zc-movie-list::className=zc-movie-list' , null); var otwListData; for(var i = 0; i=end) thClass += ' zc-app-hidden'; otwListData = zcmv.Conn.getAttrsTextNode('li', 'class=' + thClass + '::className=' + thClass + '::id=th' + otwVO.films[i].movieId, null); var otwHead3 = zcmv.Conn.getAttrsTextNode('h3', 'class=zc-movie-title::className=zc-movie-title', null); //var otwSpan = zcmv.Conn.getAttrsTextNode('span', null, null); // add server name here ///// var otwAnchor = zcmv.Conn.getAttrsTextNode('a', 'target=_blank::href=' + otwVO.films[i].movieurl, otwVO.films[i].title); //otwSpan.appendChild(otwAnchor); otwHead3.appendChild(otwAnchor); otwListData.appendChild(otwHead3); if(otwVO.films[i].imageurl!=undefined && otwVO.films[i].imageurl!=null && otwVO.films[i].imageurl.length>0) { var otwImgDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-movie-image::className=zc-movie-image', null); var otwImg = zcmv.Conn.getAttrsTextNode('img', 'height=::width=::alt' + otwVO.films[i].title + '::src=' + otwVO.films[i].imageurl, null); otwImgDiv.appendChild(otwImg); otwListData.appendChild(otwImgDiv); } var otwDetailList = zcmv.Conn.getAttrsTextNode('ul', null, null); if(otwVO.films[i].rating!=undefined) { var otwDetailListData = zcmv.Conn.getAttrsTextNode('li', 'class=zc-movie-rating::className=zc-movie-rating', null); var otwHead4 = zcmv.Conn.getAttrsTextNode('h4', null, 'Rating:'); otwDetailListData.appendChild(otwHead4); otwDetailListData.appendChild(document.createTextNode(' '+otwVO.films[i].rating)); otwDetailList.appendChild(otwDetailListData); } if(otwVO.films[i].actors!=undefined && otwVO.films[i].actors!=null && otwVO.films[i].actors.length>0) { var tempstr = ''; for(var r=0; r0) { otwDetailListData = zcmv.Conn.getAttrsTextNode('li', 'class=zc-movie-actors::className=zc-movie-actors', null); otwHead4 = zcmv.Conn.getAttrsTextNode('h4', null, 'Starring:'); otwDetailListData.appendChild(otwHead4); otwDetailListData.appendChild(document.createTextNode(' '+tempstr.substring(0, (tempstr.length-2)))); otwDetailList.appendChild(otwDetailListData); } } if(otwVO.films[i].directors!=undefined && otwVO.films[i].directors!=null && otwVO.films[i].directors.length>0) { var tempstr = ''; for(var r=0; r0) { otwDetailListData = zcmv.Conn.getAttrsTextNode('li', 'class=zc-movie-director::className=zc-movie-director', null); otwHead4 = zcmv.Conn.getAttrsTextNode('h4', null, 'Directed by:'); otwDetailListData.appendChild(otwHead4); otwDetailListData.appendChild(document.createTextNode(' '+tempstr.substring(0, (tempstr.length-2)))); otwDetailList.appendChild(otwDetailListData); } } if(otwVO.films[i].officialURL) { var otwOffURLDiv = zcmv.Conn.getAttrsTextNode('li', 'class=zc-movie-url::className=zc-movie-url', null); var otwURLAnchor = zcmv.Conn.getAttrsTextNode('a', 'class=url::className=url::title=' + otwVO.films[i].title + ' Home Page::target=_blank::href=' + otwVO.films[i].officialURL, 'Official Website'); otwOffURLDiv.appendChild(otwURLAnchor); otwDetailList.appendChild(otwOffURLDiv); } otwListData.appendChild(otwDetailList); otwList.appendChild(otwListData); } otwInnerDiv.appendChild(otwList); otwLtDiv.appendChild(otwInnerDiv); //otwLtDiv.innerHTML = "I am here ha ha ha"; //alert(otwLtDiv.innerHTML); }, setPage : function(page) { if(page>1) zcmv.Conn.otwList.page = page; else zcmv.Conn.otwList.page = 1; zcmv.Conn.otwList.buildXHTML(); }, setPageSize : function(size) { if(pageSize>0) zcmv.Conn.otwList.pageSize = size; else zcmv.Conn.otwList.pageSize = 3; zcmv.Conn.otwList.buildXHTML(); }, buildDirectXHTML : function(divId, listSize) { if(jdatastg!=undefined && jdatastg!=null) // && jsonstg.moviesthisweek!=undefined && jsonstg.moviesthisweek!=null { var jsonstr = jdatastg; var returnStr = "Error"; //alert("jsonstr.moviesthisweek = " + jsonstr.moviesthisweek); var otwVO = jsonstr.moviesthisweek; if(otwVO.status!=undefined && otwVO.status!=null) { //alert("otwVO.status.code ===" + otwVO.status.code); var otwWrapperDiv = zcmv.Conn.getAttrsTextNode('div', null, null); if(otwVO.status.code==200 || otwVO.status.code==201) { var otwHead2 = zcmv.Conn.getAttrsTextNode('h2', null, 'Movies Opening This Week'); otwWrapperDiv.appendChild(otwHead2); var getMovieImage = ""; for(var i=0; i0) { var otwImgOuterDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-img-wrapper-outer::className=zc-img-wrapper-outer', null); var otwImgInnerDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-img-wrapper::className=zc-img-wrapper::style=height:142px;', null); var otwImg = zcmv.Conn.getAttrsTextNode('img', 'height=144::width=216::alt=' + otwVO.films[i].title + '::src=' + getMovieImage, null); otwImgInnerDiv.appendChild(otwImg); otwImgOuterDiv.appendChild(otwImgInnerDiv); otwWrapperDiv.appendChild(otwImgOuterDiv); } var otwList = zcmv.Conn.getAttrsTextNode('ul', null, null); if(listSize==undefined || listSize < 1 || otwVO.films.length < listSize) listSize = otwVO.films.length; for(var i=0; i>'); otwMoreDiv.appendChild(otwAnchor); otwWrapperDiv.appendChild(otwMoreDiv); } //otwWrapperDiv.innerHTML = ""; //otwWrapperDiv.appendChild(otwLtDiv); returnStr = otwWrapperDiv.innerHTML; //alert("---"+returnStr+"---"); document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = returnStr; } } //else {alert("no jsonstg available" + jsonstg);} }, buildMVHomeXHTML : function(divId, listSize) { if(jdatastg!=undefined && jdatastg!=null) // && jsonstg.moviesthisweek!=undefined && jsonstg.moviesthisweek!=null { var jsonstr = jdatastg; var returnStr = "Error"; var otwVO = jsonstr.moviesthisweek; if(otwVO.status!=undefined && otwVO.status!=null) { var otwWrapperDiv = zcmv.Conn.getAttrsTextNode('div', null, null); if(otwVO.status.code==200 || otwVO.status.code==201) { var otwHead2 = zcmv.Conn.getAttrsTextNode('h3', null, 'Movies Opening This Week'); otwWrapperDiv.appendChild(otwHead2); var otwList = zcmv.Conn.getAttrsTextNode('ul', null, null); if(listSize==undefined || listSize < 1 || otwVO.films.length < listSize) listSize = otwVO.films.length; for(var i=0; i>'); thLtMoreDiv.appendChild(thLtAnchor); thLtTabDiv.appendChild(thLtMoreDiv); thLtWrapperDiv.appendChild(thLtTabDiv); } returnStr = thLtWrapperDiv.innerHTML; if(divId!='') { document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = returnStr; } else { zcmv.Conn.mpltList.returnStr = returnStr; } } } }, getEncodedTitle : function(titleToEncode) { encodedTitle = titleToEncode.toLowerCase() encodedTitle = encodedTitle.replace('\'', ''); encodedTitle = encodedTitle.replace('"', ''); encodedTitle = encodedTitle.replace('?', ''); encodedTitle = encodedTitle.replace('!', ''); encodedTitle = encodedTitle.replace(':', ''); encodedTitle = encodedTitle.replace(';', ''); encodedTitle = encodedTitle.replace('@', ''); encodedTitle = encodedTitle.replace('&', ''); encodedTitle = encodedTitle.replace('%', ''); encodedTitle = encodedTitle.replace('<', ''); encodedTitle = encodedTitle.replace('>', ''); encodedTitle = encodedTitle.replace('#', ''); encodedTitle = encodedTitle.replace(',', ''); encodedTitle = encodedTitle.replace('.', ''); encodedTitle = encodedTitle.replace('*', ''); encodedTitle = encodedTitle.replace('(', ''); encodedTitle = encodedTitle.replace(')', ''); while(encodedTitle.indexOf(' ')>-1) encodedTitle = encodedTitle.replace(' ', '-'); return encodedTitle; }, getConnector : function(divId) { if(zcmv.Conn.mpltList.returnStr!=undefined && zcmv.Conn.mpltList.returnStr!=null && zcmv.Conn.mpltList.returnStr!='') { document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = zcmv.Conn.mpltList.returnStr; zcmv.Conn.thList.divId = divId; } } } zcmv.Conn.csList = { divId : 'csList', jsonStr : '', returnStr : '', buildDirectXHTML : function(divId, listSize) { if(zcmv.Conn.csList.jsonStr!=undefined && zcmv.Conn.csList.jsonStr!=null && zcmv.Conn.csList.jsonStr!='') { var returnStr = "Error"; var csVO = zcmv.Conn.csList.jsonStr.TMSMoviesWebService; if(csVO.returnStatus!=undefined && csVO.returnStatus!=null) { var thLtWrapperDiv = zcmv.Conn.getAttrsTextNode('div', null, null); var thLtTabDiv = zcmv.Conn.getAttrsTextNode('div', 'class=zc-tab-content::className=zc-tab-content', null); if(csVO.returnStatus.code==200 || csVO.returnStatus.code==201) { var thLtHead3 = zcmv.Conn.getAttrsTextNode('h3', null, 'Movies Coming Soon'); thLtTabDiv.appendChild(thLtHead3); var thLtList = zcmv.Conn.getAttrsTextNode('ul', null, null); if(listSize==undefined || listSize < 1 || csVO.futureReleases.movies.length < listSize) listSize = csVO.futureReleases.movies.length; var thLtListData, seoURL, thLtAnchor; for(var i=0; i>'); thLtMoreDiv.appendChild(thLtAnchor); thLtTabDiv.appendChild(thLtMoreDiv); thLtWrapperDiv.appendChild(thLtTabDiv); } returnStr = thLtWrapperDiv.innerHTML; if(divId!='') { document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = returnStr; } else { zcmv.Conn.csList.returnStr = returnStr; } } } }, getEncodedTitle : function(titleToEncode) { encodedTitle = titleToEncode.toLowerCase() encodedTitle = encodedTitle.replace('\'', ''); encodedTitle = encodedTitle.replace('"', ''); encodedTitle = encodedTitle.replace('?', ''); encodedTitle = encodedTitle.replace('!', ''); encodedTitle = encodedTitle.replace(':', ''); encodedTitle = encodedTitle.replace(';', ''); encodedTitle = encodedTitle.replace('@', ''); encodedTitle = encodedTitle.replace('&', ''); encodedTitle = encodedTitle.replace('%', ''); encodedTitle = encodedTitle.replace('<', ''); encodedTitle = encodedTitle.replace('>', ''); encodedTitle = encodedTitle.replace('#', ''); encodedTitle = encodedTitle.replace(',', ''); encodedTitle = encodedTitle.replace('.', ''); encodedTitle = encodedTitle.replace('*', ''); encodedTitle = encodedTitle.replace('(', ''); encodedTitle = encodedTitle.replace(')', ''); while(encodedTitle.indexOf(' ')>-1) encodedTitle = encodedTitle.replace(' ', '-'); return encodedTitle; }, getConnector : function(divId) { if(zcmv.Conn.csList.returnStr!=undefined && zcmv.Conn.csList.returnStr!=null && zcmv.Conn.csList.returnStr!='') { document.getElementById(divId).innerHTML = ""; document.getElementById(divId).innerHTML = zcmv.Conn.csList.returnStr; zcmv.Conn.thList.divId = divId; } } } var connDiv = 'zc-otw' function displayMoviesOpeningThisWeek() { if(jdatastg && jdatastg != null && connDiv != null && document.getElementById(connDiv) && document.getElementById(connDiv).innerHTML == '') { zcmv.Conn.otwList.buildMVHomeXHTML(connDiv, '4'); } } var requestParams = 'aid=s9w&v=1&rty=jsona&rvar=jdatastg'; if(requestParams!='') { zcmv.Conn.loadScript(hostName + '/movies/openingThisWeekService?' + requestParams, displayMoviesOpeningThisWeek); }