_strScene7QltFlag="";function jumpToEpraiseGroup(intGrpId){intGrpId=getElementId(intGrpId).options[getElementId(intGrpId).selectedIndex].value;if(intGrpId==null||intGrpId)window.location=getElementId(_strCPId+'hidSiteDomain').value+'epraise/epgrp/'+intGrpId}function jumpToEpraiseCard(intCardId){intCardId=getElementId(_strCPId+'hidCardId'+intCardId).value;window.location=getElementId(_strCPId+'hidSiteDomain').value+'epraise/personalize/'+intCardId}function clearCards(){for(i=1;i<=3;i++){getElementId('tdImgSlot'+i).className='no-show'}}function bringUpCards(strImgUrl){var hidSlot1=getElementId(_strCPId+'hidSlot1');var hidSlot2=getElementId(_strCPId+'hidSlot2');var intStart=hidSlot1.value;var intEnd=hidSlot2.value;var intCard=1;clearCards();for(i=intStart;i<=intEnd;i++){if(parseInt(i)-1>(arrEpraiseData.length-1)){break}var arrData=arrEpraiseData[i-1].split('|');getElementId(_strCPId+'imgSlot'+intCard).src=strImgUrl.replace('EPRAISECARDIMAGE',arrData[1]);getElementId(_strCPId+'imgSlot'+intCard).alt=arrData[5];getElementId('tdImgSlot'+intCard).className='show-inline';getElementId(_strCPId+'hidCardId'+intCard).value=arrData[0];getElementId(_strCPId+'hidCardImg'+intCard).value=arrData[1];intCard=parseInt(intCard)+1;if(parseInt(intCard)>3){break}}var strCardImg=_strCPId+'hidCardImg1';var strCardId=_strCPId+'hidCardId1';displayCardProducts(strCardId,strCardImg);}function previousSet(){var hidSlot1=getElementId(_strCPId+'hidSlot1');var hidSlot2=getElementId(_strCPId+'hidSlot2');var imgLeftArrow=getElementId(_strCPId+'imgLeftArrow');var imgLeftDisabled=getElementId(_strCPId+'imgLeftDisabled');var imgRightArrow=getElementId(_strCPId+'imgRightArrow');var imgRightDisabled=getElementId(_strCPId+'imgRightDisabled');var hidCurrPage=getElementId(_strCPId+'hidCurrPage');var hidTotalPages=getElementId(_strCPId+'hidTotalPages');var strCardImgUrl=getElementId(_strCPId+'hidCardImg').value;var hidNumSlides=getElementId(_strCPId+'hidNumSlides');var intDiff=parseInt(hidNumSlides.value)%3;if(intDiff>0){intDiff=3-intDiff}imgRightArrow.className="show-inline img-no-border mouse-pointer";imgRightDisabled.className="no-show img-no-border";var intSlot2=parseInt(hidSlot2.value)-3;var intSlot1=parseInt(hidSlot1.value)-3;hidSlot2.value=intSlot2;hidSlot1.value=intSlot1;hidCurrPage.value--;if(parseInt(hidCurrPage.value)<1){hidCurrPage.value=1}if(parseInt(hidSlot1.value)<=parseInt(1)){hidSlot1.value=1;imgLeftArrow.className="no-show img-no-border mouse-pointer";imgLeftDisabled.className="show-inline img-no-border";hidSlot2.value=3}if(parseInt(hidSlot2.value)<3){imgLeftArrow.className="no-show img-no-border mouse-pointer";imgLeftDisabled.className="show-inline img-no-border";hidSlot2.value=3}bringUpCards(strCardImgUrl);}function nextSet(){var hidSlot1=getElementId(_strCPId+'hidSlot1');var hidSlot2=getElementId(_strCPId+'hidSlot2');var imgLeftArrow=getElementId(_strCPId+'imgLeftArrow');var imgLeftDisabled=getElementId(_strCPId+'imgLeftDisabled');var imgRightArrow=getElementId(_strCPId+'imgRightArrow');var imgRightDisabled=getElementId(_strCPId+'imgRightDisabled');var hidCurrPage=getElementId(_strCPId+'hidCurrPage');var hidTotalPages=getElementId(_strCPId+'hidTotalPages');var strCardImgUrl=getElementId(_strCPId+'hidCardImg').value;var hidNumSlides=getElementId(_strCPId+'hidNumSlides');var intDiff=parseInt(hidNumSlides.value)%3;if(intDiff>0){intDiff=3-intDiff}hidCurrPage.value=parseInt(hidCurrPage.value)+1;if(parseInt(hidCurrPage.value)>parseInt(getElementId(_strCPId+'hidTotalPages').value)){hidCurrPage.value=getElementId(_strCPId+'hidTotalPages').value}imgLeftArrow.className="show-inline img-no-border mouse-pointer";imgLeftDisabled.className="no-show img-no-border";hidSlot1.value=parseInt(hidSlot2.value)+1;hidSlot2.value=parseInt(hidSlot2.value)+3;if(parseInt(hidSlot2.value)>=parseInt(hidNumSlides.value)){imgRightArrow.className="no-show img-no-border mouse-pointer";imgRightDisabled.className="show-inline img-no-border";hidSlot2.value=parseInt(hidNumSlides.value)+intDiff}bringUpCards(strCardImgUrl);}function clearProducts(){for(i=1;i<=4;i++){getElementId('tdProd'+i).className="no-show"}}function displayCardProducts(hidCardId,hidCardImg){var intSlot1=getElementId(_strCPId+'hidSlot1').value;var intSlot2=getElementId(_strCPId+'hidSlot2').value;var lngProdCount=1;clearProducts();hidCardId=getElementId(hidCardId);hidCardImg=getElementId(hidCardImg);for(i=0;i<=arrEpraiseProdData.length-1;i++){var arrProdData=new Array();arrProdData=arrEpraiseProdData[i].split('|');if(arrProdData[7]==hidCardImg.value){var strProdImg=getElementId(_strCPId+'hidProdImg').value;strProdImg=strProdImg.replace("EPRAISECARDIMAGE","BV_"+arrProdData[0]+"_FRONT");getElementId('imgProd'+lngProdCount).src=strProdImg;getElementId('imgProd'+lngProdCount).alt=arrProdData[8];getElementId('tdProd'+lngProdCount).className="show-inline";getElementId('lnkProd'+lngProdCount).href=getElementId(_strCPId+'hidSiteDomain').value+arrProdData[1];getElementId('spnLink').innerHTML=arrProdData[2]+' | ';getElementId('lnkCardProd').innerHTML=arrProdData[4];getElementId('lnkCardProd').href=getElementId(_strCPId+'hidSiteDomain').value+arrProdData[5];lngProdCount++;if(lngProdCount>4){break}}}}function ShowHelpPopup(strFileToPopup){if(strFileToPopup==null){strFileToPopup="epraise/help"}var strSiteDomain=getElementId(_strCPId+'hidSiteDomain').value;var strUrl=strSiteDomain+strFileToPopup;window.radopen(strUrl,"radwEpraiseHelp");}_errColor="#F9555E";function ValidateControlsClient(id){var controlsOK=true;if(!validateMultipleEmailAddresses(getElementId(_strCPId+'txtRecipEmail'))){getElementId(_strCPId+'lblRecipEmail').style.color=_errColor;controlsOK=false}else{getElementId(_strCPId+'lblRecipEmail').style.color=""}if(document.getElementById(_strCPId+'txtCCRecipEmail').value.trim().length>0){if(!validateEmailAddress(getElementId(_strCPId+'txtCCRecipEmail'))){getElementId(_strCPId+'lblCCRecipEmail').style.color=_errColor;controlsOK=false}else{getElementId(_strCPId+'lblCCRecipEmail').style.color=""}}else{getElementId(_strCPId+'lblCCRecipEmail').style.color=""}if(getElementId(_strCPId+'txtSenderName').value==""){getElementId(_strCPId+'lblSenderName').style.color=_errColor;controlsOK=false}else{getElementId(_strCPId+'lblSenderName').style.color=""}if(!validateEmailAddress(getElementId(_strCPId+'txtSenderEmail'))){getElementId(_strCPId+'lblSenderEmail').style.color=_errColor;controlsOK=false}else{getElementId(_strCPId+'lblSenderEmail').style.color=""}if(getElementId(_strCPId+'txtMessage').value==""){getElementId(_strCPId+'lblMessage').style.color=_errColor;controlsOK=false}else{getElementId(_strCPId+'lblMessage').style.color=""}if(controlsOK){__doPostBack(id,'');}else{getElementId(_strCPId+'divErrors').style.visibility='visible'}}function UpdateCardText(){var intMaxChars=900;var strMessageBox=getElementId(_strCPId+'txtMessage');var intCurrentChars=strMessageBox.value.length;if(intCurrentChars>intMaxChars){strMessageBox.value=strMessageBox.value.substring(0,intMaxChars);getElementId(_strCPId+'lblMessage').style.color=_errColor;getElementId(_strCPId+'lblMessage').innerHTML='Maximum Message Length Reached';return false}if(intCurrentChars!=intMaxChars){getElementId(_strCPId+'lblMessage').style.color="";getElementId(_strCPId+'lblMessage').innerHTML='Write your Personal Message'}var strMsg=getElementId(_strCPId+'txtMessage').value;var szUrl="http://s7d2.scene7.com/is/image/Baudville/";var Scene7Template=getElementId(_strCPId+'hidScene7Template').value;var Scene7Image=getElementId(_strCPId+'hidScene7Image').value;var Font=getElementId(_strCPId+'ddlFont').value;var FontSize=getElementId(_strCPId+'hidFontSize').value;var colorPicker=$find(_strCPId+'rcpFontColor');if(colorPicker!=null){getElementId(_strCPId+'hidFontColor').value=colorPicker.get_selectedColor();}var selectedColor=getElementId(_strCPId+'hidFontColor').value;selectedColor=selectedColor.replace('#','');var strRed=HexToR(selectedColor);var strGreen=HexToG(selectedColor);var strBlue=HexToB(selectedColor);strMsg=escapeSpecialCharacters(strMsg);strMsg=escapeLineBrakes(strMsg,"\\par","");getElementId(_strCPId+'hidEncodedMessage').value=strMsg;szUrl+=Scene7Template+"?layer=0&src="+Scene7Image+"&layer=1&$line1="+strMsg;szUrl+="&$red="+strRed+"&$green="+strGreen+"&$blue="+strBlue;szUrl+="&$line1fs="+FontSize;szUrl+="&$fn="+Font;getElementId(_strCPId+'imgCard').src=szUrl}function escapeLineBrakes(strText,replaceWith){var strReturn="";strReturn=strText.replace(new RegExp("\\n","g"),"\\par%20");strReturn=strReturn.replace(new RegExp("\\r","g"),"");return strReturn}function HexToR(h){return parseInt((cutHex(h)).substring(0,2),16)}function HexToG(h){return parseInt((cutHex(h)).substring(2,4),16)}function HexToB(h){return parseInt((cutHex(h)).substring(4,6),16)}function cutHex(h){return(h.charAt(0)=="#")?h.substring(1,7):h}function CalendarDateSelected(dateText){getElementId('ctl00_ContentPlaceHolder1_hidCalendarDate').value=dateText}
