
if(typeof documentDomain!="undefined")
document.domain=documentDomain;String.prototype.printf=function(){var pattern=/\{\d+\}/g;var args=arguments;return this.replace(pattern,function(capture){return args[capture.match(/\d+/)];});}
if(typeof GupShup=="undefined"||!GupShup){var GupShup={};}
GupShup.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=GupShup;for(j=(d[0]=="GupShup")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};(function(){GupShup.namespace("widget","conf","conf.user","conf.actions","callback","html","forms","html.dynamic","constants","labels");})();GupShup.constants={MILLISEC_IN_ONE_DAY:1000*60*60*24};GupShup.util=GupShup.util||{JSON_SECURE_START:"/*-secure-",JSON_SECURE_END:"*/",GSM_SPECIAL_CHARS:"|~^[]\\{}",trim:function(str)
{return((""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1'));},getSwfPath:function(fileName){fileName=GupShup.util.trim(fileName);var arr=fileName.split(".",2);return GupShup.conf.staticImageUrl+'/images/swf/'+GupShup.util.trim(arr[0])+GupShup.conf.websiteVersion+'.swf';},isInitialized:function(variable)
{return((typeof(variable)!='undefined')&&(variable!=null));},isNumber:function(str)
{var filter=/^[\d]+$/;return filter.test(str);},isPosiviteFloatNumber:function(str)
{str=this.trim(str);return/^[+]?[0-9]*(\.[0-9]+)?$/.test(str);},isFloatNumber:function(str)
{str=this.trim(str);return/^[-+]?[0-9]*(\.[0-9]+)?$/.test(str);},getDateDiffInDays:function(date1,date2){return(date1.getTime()-date2.getTime())/GupShup.constants.MILLISEC_IN_ONE_DAY;},validatePhoneNumber:function(num,isInternational){num=this.trim(num);if(this.isNumber(num))
{if(typeof isInternational=="undefined"||isInternational==false)
{if(num.length==10&&num.substring(0,1)!="0")
return true;else if(num.length==12&&num.substring(0,2)=="91"&&num.substring(2,3)!="0")
return true;else
return false;}
else
return true;}
else
return false;},getValidIndianPhoneNumber:function(num){num=this.trim(num);if(GupShup.util.validatePhoneNumber(num))
{if(num.length==12)
return num;else
return"91"+""+num;}
else
return"";},escapeCharsForHTML:function(str,replaceLineBreaks){var op="";for(var i=0;i<str.length;i++)
{var c=str.charAt(i);if(c>='a'&&c<='z'||c>='A'&&c<='Z'||c>='0'&&c<='9'||c=='*')
op+=c;else if(c==' ')
op+=" ";else if(c=='\n')
{if(replaceLineBreaks==true)
op+=" ";else
op+=c;}
else if(str.charCodeAt(i)!=0)
op+="&#"+str.charCodeAt(i)+";";}
return op;},replaceNewLine:function(str,c)
{return str.replace(/\n/g,c);},removeCarriageReturn:function(str)
{if(!GupShup.util.isInitialized(str))
return str;return str.replace(/\r/g,'');},isAscii:function(str)
{for(i=0;i<str.length;i++)
{if(str.charCodeAt(i)==13||str.charCodeAt(i)==10)
continue;if(!GupShup.util.isPrintableAsciiChar(str.charCodeAt(i)))
return false;}
return true;},isPrintableAsciiChar:function(ch)
{return((ch>31)&&(ch<128));},isWord:function(str)
{return/^[\w]+$/.test(str);},isValidContent:function(content,objectionableList)
{var words=content.split(" ");for(j=0;j<words.length;j++)
{var str=this.trim(words[j].toLowerCase());for(i=0;i<objectionableList.length;i++)
{var objectionableWord=this.trim(objectionableList[i].toLowerCase());if(str.indexOf(objectionableWord)!=-1)
return false;}}
return true;},isValidGroupName:function(name){return GupShup.util.isValidGroupNameWithLen(name,5,15);},isValidGroupNameWithLen:function(name,minLen,maxLen){var filter1=/^[\w]+$/;var filter2=/^[\d]+$/;if((name.length<minLen)||(name.length>maxLen))
{return{code:'SHORT_NAME',err:GupShup.html.errorMessages.groupNameGivenLength(minLen,maxLen)};}
if(!this.isValidContent(name,restrictedNames))
{return{code:'RESTRICTED_NAME',err:GupShup.html.errorMessages.blockedGroupName};}
if(!this.isValidContent(name,stopWords))
{return{code:'RESTRICTED_NAME',err:GupShup.html.errorMessages.blockedGroupName};}
if(!filter1.test(name))
{return{code:'INVALID_NAME',err:GupShup.html.errorMessages.invalidCharInGroup};}
if(filter2.test(name))
{return{code:'INVALID_NAME',err:GupShup.html.errorMessages.invalidGroupName};}
return{code:'VALID'};},isValidTagName:function(name){var filter1=/^[\w]+$/;var filter2=/^[\d]+$/;if(name.length>20)
{return{code:'LONG_NAME',err:GupShup.html.errorMessages.maxTagName};}
if(!this.isValidContent(name,restrictedNames))
{return{code:'RESTRICTED_NAME',err:GupShup.html.errorMessages.blockedTagName};}
if(!this.isValidContent(name,stopWords))
{return{code:'RESTRICTED_NAME',err:GupShup.html.errorMessages.blockedTagName};}
if(!filter1.test(name))
{return{code:'INVALID_NAME',err:GupShup.html.errorMessages.invalidCharInTag};}
if(filter2.test(name))
{return{code:'INVALID_NAME',err:GupShup.html.errorMessages.invalidCharInTag};}
return{code:'VALID'};},isValidEmail:function(value)
{var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(filter.test(this.trim(value)))
return true;else
return false;},isValidPhone:function(cCode,phone){var phone=this.trim(phone);var cCode=this.trim(cCode);if(phone.length<1||cCode.length<1)
{return false;}
if(cCode!="91")
{if(!this.validatePhoneNumber(phone,true))
{return false;}}
else
{if(!this.validatePhoneNumber(phone,false))
{return false;}}
return true;},changeCCodeLabel:function(frm,target,pDom){if(typeof pDom=="undefined")
pDom=document;var cCodeEle=pDom.getElementById(frm);var code=this.trim(cCodeEle.value);while(code.length<4)
{code="0"+code;}
pDom.getElementById(target).innerHTML=code;return code;},isValidUrl:function(url){url=this.trim(url);if(url.substr(0,4)!='http')
url='http://'+url;var regexp=/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return regexp.test(this.trim(url));},isValidUrlForEnterprise:function(url){url=this.trim(url);var regexp=/^(https?\:\/\/)?\w+\.[\w\.]+(:[0-9]+)?(\/|\/[\w#!:.?+=&%@!\-\/]+)*$/;return regexp.test(this.trim(url));},isValidLoginId:function(loginId){var loginIdRegEx=/^[a-zA-Z][\w\.]{4,14}$/;return loginIdRegEx.test(loginId);},isValidEmail:function(email){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return filter.test(this.trim(email));},putDummyPassword:function(obj)
{obj.value=this.getDummyPassword(obj.value.length);},getDummyPassword:function(pwdLen){var dummy='';for(var i=0;i<pwdLen;++i)
dummy+='*';return dummy;},getElementText:function(element){return(element.innerText||element.textContent);},removeHTMLComments:function(str){return str.replace('<!--','').replace('-->','');},getInnerHTML:function(elementName,pDom){if(typeof pDom=="undefined")
pDom=document;return pDom.getElementById(elementName).innerHTML;},getTemplateHTML:function(templateDivId,pDom){var html=GupShup.util.removeHTMLComments(GupShup.util.getInnerHTML(templateDivId,pDom));return html;},getAndClearInnerHTML:function(elementName,pDom){if(typeof pDom=="undefined")
pDom=document;var html=pDom.getElementById(elementName).innerHTML;pDom.getElementById(elementName).innerHTML="";return(html);},setInnerHTML:function(elementName,content,pDom){if(typeof pDom=="undefined")
pDom=document;pDom.getElementById(elementName).innerHTML=content;},copyContent:function(srcElementId,targetElementId,pDom){if(typeof pDom=="undefined")
pDom=document;var srcElement=pDom.getElementById(srcElementId);var targetElement=pDom.getElementById(targetElementId);targetElement.innerHTML=srcElement.innerHTML;},getPlaceHolderUrl:function(placeHolder)
{return GupShup.conf.placeHolderUrlTemplate.replace('<>',placeHolder);},expandTemplateInDiv:function(parentDivId,tmplDivId,tmplPlaceHolderMap,dataObjArray,pDom){if(typeof pDom=="undefined")
pDom=document;var template=GupShup.util.getTemplateHTML(tmplDivId,pDom);var innerHTML=GupShup.util.expandTemplate(template,tmplPlaceHolderMap,dataObjArray,pDom);var parentDiv=pDom.getElementById(parentDivId);parentDiv.innerHTML=innerHTML;},expandTemplate:function(template,tmplPlaceHolderMap,dataObjArray,pDom){if(typeof pDom=="undefined")
pDom=document;if(!GupShup.util.isInitialized(dataObjArray))
dataObjArray=[{}];var innerHTML="";for(var i=0;i<dataObjArray.length;i++)
{var dataEntry=dataObjArray[i];var expansion=template;for(var j=0;j<tmplPlaceHolderMap.length;j++)
{var entry=tmplPlaceHolderMap[j];if(!GupShup.util.isInitialized(entry)||!GupShup.util.isInitialized(entry.key))
continue;var key=entry.key;var replacementData=GupShup.util.getReplacementData(entry,dataEntry,i,pDom);var regExObj=new RegExp("\\$",'g');key=key.replace(regExObj,'\\\$');regExObj=new RegExp(key,'g');expansion=expansion.replace(regExObj,replacementData);}
innerHTML+=expansion;}
try
{innerHTML=innerHTML.replace(/<br\/>/g,'<br>');var ele=$('<div>').append(innerHTML);ele.find("[display=off]").remove();innerHTML=ele.html();innerHTML=innerHTML.replace(/<br>/g,'<br\/>');ele.remove();}
catch(e)
{}
return innerHTML;},getReplacementData:function(templateEntry,dataEntry,pos,pDom)
{if(typeof pDom=="undefined")
pDom=document;var replacementData='';if(typeof(templateEntry)=="undefined")
return replacementData;if(typeof templateEntry.dataMember!="undefined")
{replacementData=GupShup.util.getObjMemberVal(dataEntry,templateEntry.dataMember);if(typeof templateEntry.dataProcessor=="function")
replacementData=templateEntry.dataProcessor(replacementData,dataEntry,pos);}
else if(typeof templateEntry.fixedMember!="undefined")
{replacementData=templateEntry.fixedMember;if(typeof templateEntry.dataProcessor=="function")
replacementData=templateEntry.dataProcessor(replacementData,dataEntry,pos);}
else if(typeof templateEntry.templateMember=="object")
{var newDataObjArr=null;var tmplHTML='';if(typeof templateEntry.templateMember.tmplGenerator=="function")
tmplHTML=templateEntry.templateMember.tmplGenerator(templateEntry.templateMember.tmplDivId);else
tmplHTML=GupShup.util.getTemplateHTML(templateEntry.templateMember.tmplDivId,pDom);var tmplMap=templateEntry.templateMember.tmplMap;if(typeof templateEntry.templateMember.templateDataMember!="undefined")
newDataObjArr=GupShup.util.getObjMemberVal(dataEntry,templateEntry.templateMember.templateDataMember);else if(typeof templateEntry.templateMember.templateDataGenerator=="function")
newDataObjArr=templateEntry.templateMember.templateDataGenerator(dataEntry);else
newDataObjArr=[dataEntry];replacementData=GupShup.util.expandTemplate(tmplHTML,tmplMap,newDataObjArr);}
else if(typeof templateEntry.templateOptions=="object")
{var newDataObjArr=null;if(typeof templateEntry.templateDataMember!="undefined")
newDataObjArr=GupShup.util.getObjMemberVal(dataEntry,templateEntry.templateDataMember);else if(typeof templateEntry.templateDataGenerator=="function")
newDataObjArr=templateEntry.templateDataGenerator(dataEntry);else
newDataObjArr=[dataEntry];for(var i=0;i<newDataObjArr.length;i++)
{var templateIndex=templateEntry.templateSelector(newDataObjArr[i],dataEntry);if(templateIndex>=0)
{var template=templateEntry.templateOptions[templateIndex];var tmplHTML='';if(typeof template.tmplGenerator=="function")
tmplHTML=templateEntry.templateOptions[templateIndex].tmplGenerator(template.tmplDivId);else
tmplHTML=GupShup.util.getTemplateHTML(template.tmplDivId,pDom);var tmplMap=template.tmplMap;replacementData+=GupShup.util.expandTemplate(tmplHTML,tmplMap,[newDataObjArr[i]]);}}}
return replacementData;},getObjMemberVal:function(obj,dataMemberName){var val=null;if((obj!=null)&&(dataMemberName!=null)&&(GupShup.util.trim(dataMemberName).length>0))
{var memberArr=dataMemberName.split('.');if(typeof obj[memberArr[0]]!='undefined')
{val=obj[memberArr[0]];for(var i=1;i<memberArr.length;i++)
{if(typeof val[memberArr[i]]!='undefined')
val=val[memberArr[i]];else
return"";}}}
return(val==null)?"":val;},expandPaginationTemplate:function(reqObj,pagination,context,doc){if(typeof doc=='undefined')
doc=document;if(pagination.windowSize==1)
return this.expandDefaultPaginationTemplate(reqObj,pagination,context,doc);var offset=0;if(!isNaN(pagination.start))
offset=parseInt(pagination.start);var itemsPerPage=GupShup.conf.ITEMS_PER_PAGE;if(!isNaN(pagination.itemsPerPage))
itemsPerPage=parseInt(pagination.itemsPerPage);var totalItems=parseInt(pagination.total);var itemsRetrived=parseInt(pagination.returned);var currentPage=(offset/itemsPerPage)+1;var totalPages=Math.ceil(totalItems/itemsPerPage);var navOnClickFunction="javascript:GupShup.util.getJsonItems";var reqType='';var pgUrl='';var scrollToTop="window.scroll(0,0);";if(typeof pagination.scrollToTop!="undefined"&&pagination.scrollToTop==false)
scrollToTop="";if(GupShup.util.isInitialized(reqObj.navOnClickFunction))
{navOnClickFunction=reqObj.navOnClickFunction;reqType='ONCLICK';}
else
{pgUrl=reqObj.url;if(reqObj.url.indexOf("?")<0)
pgUrl+="?"+reqObj.queryStr;else
pgUrl+="&"+reqObj.queryStr;if(typeof reqObj.callBack=='object')
reqType='AJAX';else
reqType='RELOAD';}
if(totalItems<1||((currentPage==1)&&((itemsRetrived<itemsPerPage)||(totalItems==itemsPerPage))))
{return"";}
var hmPgLink,prevPgLink,nextPgLink,endPgLink;var hmPgF,prevPgF,nextPgF,endPgF;if(currentPage==1)
{prevPgLink=pgUrl+"&page=1";}
else
{prevPgLink=pgUrl+"&page="+(currentPage-1);}
if(currentPage==totalPages)
{nextPgLink=pgUrl+"&page="+totalPages;}
else
{nextPgLink=pgUrl+"&page="+(currentPage+1);}
hmPgLink=pgUrl+"&page=1";endPgLink=pgUrl+"&page="+totalPages;switch(reqType)
{case'ONCLICK':case'AJAX':{prevPgLink=nextPgLink=hmPgLink=endPgLink='javascript:void(0);';GupShup.conf[context]={};GupShup.conf[context].window=new Array();navOnClickFunction=navOnClickFunction+"(GupShup.conf."+context+".$PAGE$);"+scrollToTop+"return(false);"
break;}
case'RELOAD':navOnClickFunction="return(true);";break;}
var windowContent="";var windowSize=pagination.windowSize>totalPages?totalPages:pagination.windowSize;if(currentPage<=Math.floor(windowSize/2))
{for(var i=1;i<=windowSize;i++)
{if(currentPage==i)
windowContent+=this.expandTemplate(GupShup.util.getInnerHTML('paginationCurrentLinkTemplate'),GupShup.templates.paginationCurrentLinkMap,[{pageNo:i}]);else
{var windowPos=i%windowSize;GupShup.conf[context].window[windowPos]=this.clone(reqObj);GupShup.conf[context].window[windowPos].start=itemsPerPage*(i-1);GupShup.conf[context].window[windowPos].limit=itemsPerPage;var windowNavFunct=navOnClickFunction.replace('$PAGE$','window['+windowPos+']');windowContent+=this.expandTemplate(GupShup.util.getInnerHTML('paginationActiveLinkTemplate'),GupShup.templates.paginationActiveLinkMap,[{url:(pgUrl+"&page="+i),activeFunct:windowNavFunct,pageNo:i}]);}}}
else if(currentPage>(totalPages-Math.ceil(windowSize/2)))
{for(var i=(totalPages-(windowSize-1));i<=totalPages;i++)
{if(currentPage==i)
windowContent+=this.expandTemplate(GupShup.util.getInnerHTML('paginationCurrentLinkTemplate'),GupShup.templates.paginationCurrentLinkMap,[{pageNo:i}]);else
{var windowPos=i%windowSize;GupShup.conf[context].window[windowPos]=this.clone(reqObj);GupShup.conf[context].window[windowPos].start=itemsPerPage*(i-1);GupShup.conf[context].window[windowPos].limit=itemsPerPage;var windowNavFunct=navOnClickFunction.replace('$PAGE$','window['+windowPos+']');windowContent+=this.expandTemplate(GupShup.util.getInnerHTML('paginationActiveLinkTemplate'),GupShup.templates.paginationActiveLinkMap,[{url:(pgUrl+"&page="+i),activeFunct:windowNavFunct,pageNo:i}]);}}}
else
{for(var i=(currentPage-Math.floor(windowSize/2));i<(currentPage+Math.ceil(windowSize/2));i++)
{if(currentPage==i)
windowContent+=this.expandTemplate(GupShup.util.getInnerHTML('paginationCurrentLinkTemplate'),GupShup.templates.paginationCurrentLinkMap,[{pageNo:i}]);else
{var windowPos=i%windowSize;GupShup.conf[context].window[windowPos]=this.clone(reqObj);GupShup.conf[context].window[windowPos].start=itemsPerPage*(i-1);GupShup.conf[context].window[windowPos].limit=itemsPerPage;var windowNavFunct=navOnClickFunction.replace('$PAGE$','window['+windowPos+']');windowContent+=this.expandTemplate(GupShup.util.getInnerHTML('paginationActiveLinkTemplate'),GupShup.templates.paginationActiveLinkMap,[{url:(pgUrl+"&page="+i),activeFunct:windowNavFunct,pageNo:i}]);}}}
if(typeof GupShup.conf[context]=='object')
{GupShup.conf[context].homePage=this.clone(reqObj);GupShup.conf[context].homePage.start=0;GupShup.conf[context].homePage.limit=itemsPerPage;GupShup.conf[context].nextPage=this.clone(reqObj);GupShup.conf[context].nextPage.start=itemsPerPage*(currentPage<totalPages?currentPage:(totalPages-1));GupShup.conf[context].nextPage.limit=itemsPerPage;GupShup.conf[context].prevPage=this.clone(reqObj);GupShup.conf[context].prevPage.start=itemsPerPage*(currentPage>1?(currentPage-2):0);GupShup.conf[context].prevPage.limit=itemsPerPage;GupShup.conf[context].endPage=this.clone(reqObj);GupShup.conf[context].endPage.start=itemsPerPage*(totalPages-1);GupShup.conf[context].endPage.limit=itemsPerPage;}
var lType='messages';if(typeof pagination.listType=='string')
lType=pagination.listType;var dataForMap=[{listType:lType,start:(offset+1),limit:(offset+itemsRetrived),total:totalItems,homePageLink:hmPgLink,prevPageLink:prevPgLink,nextPageLink:nextPgLink,endPageLink:endPgLink,homePageFunct:navOnClickFunction.replace('$PAGE$','homePage'),prevPageFunct:navOnClickFunction.replace('$PAGE$','prevPage'),nextPageFunct:navOnClickFunction.replace('$PAGE$','nextPage'),endPageFunct:navOnClickFunction.replace('$PAGE$','endPage'),content:windowContent}]
var tmpl=(typeof(pagination.template)=="undefined")?'paginationTemplate':pagination.template;var op=this.expandTemplate(GupShup.util.getInnerHTML(tmpl,doc),GupShup.templates.paginationMap,dataForMap,doc);return op;},expandDefaultPaginationTemplate:function(reqObj,pagination,context,doc){var offset=0;if(typeof doc=='undefined')
doc=document;if(!isNaN(pagination.start))
offset=parseInt(pagination.start);var itemsPerPage=GupShup.conf.ITEMS_PER_PAGE;if(!isNaN(pagination.itemsPerPage))
itemsPerPage=parseInt(pagination.itemsPerPage);var itemsRetrived=parseInt(pagination.returned);var currentPage=(offset/itemsPerPage)+1;var navOnClickFunction="javascript:GupShup.util.getJsonItems";var reqType='';var pgUrl='';var scrollToTop="window.scroll(0,0);";if((typeof pagination.scrollToTop!="undefined"&&pagination.scrollToTop==false)||(itemsPerPage<GupShup.conf.ITEMS_PER_PAGE))
scrollToTop="";if(typeof pagination.scrollToTop!="undefined"&&pagination.scrollToTop==true)
scrollToTop="window.scroll(0,0);";if(GupShup.util.isInitialized(reqObj.navOnClickFunction))
{navOnClickFunction=reqObj.navOnClickFunction;reqType='ONCLICK';}
else
{pgUrl=reqObj.url;if(reqObj.url.indexOf("?")<0)
pgUrl+="?"+reqObj.queryStr;else
pgUrl+="&"+reqObj.queryStr;if(typeof reqObj.callBack=='object')
reqType='AJAX';else
reqType='RELOAD';}
if((currentPage==1)&&(itemsRetrived<=itemsPerPage))
{return"";}
var prevPgLink,nextPgLink;var prevPgF,nextPgF;if(currentPage==1)
{prevPgLink=pgUrl+"&page=1";}
else
{prevPgLink=pgUrl+"&page="+(currentPage-1);}
if(itemsRetrived>itemsPerPage)
{nextPgLink=pgUrl+"&page="+(currentPage+1);}
else
{nextPgLink=pgUrl+"&page="+(currentPage);}
switch(reqType)
{case'ONCLICK':case'AJAX':{prevPgLink=nextPgLink='javascript:void(0);';GupShup.conf[context]={};navOnClickFunction=navOnClickFunction+"(GupShup.conf."+context+".$PAGE$);"+scrollToTop+"return(false);"
break;}
case'RELOAD':navOnClickFunction="return(true);";break;}
if(typeof GupShup.conf[context]=='object')
{GupShup.conf[context].prevPage=this.clone(reqObj);GupShup.conf[context].prevPage.start=itemsPerPage*(currentPage>1?(currentPage-2):0);GupShup.conf[context].prevPage.limit=itemsPerPage+1;GupShup.conf[context].nextPage=this.clone(reqObj);GupShup.conf[context].nextPage.start=itemsPerPage*((itemsRetrived>itemsPerPage)?(currentPage):(currentPage-1));GupShup.conf[context].nextPage.limit=itemsPerPage+1;}
var dataForMap=[{prevPageLink:prevPgLink,nextPageLink:nextPgLink,prevPageFunct:navOnClickFunction.replace('$PAGE$','prevPage'),nextPageFunct:navOnClickFunction.replace('$PAGE$','nextPage'),content:currentPage}]
var tmpl=(typeof(pagination.template)=="undefined")?'defaultPaginationTemplate':pagination.template;var op=this.expandTemplate(GupShup.util.getInnerHTML(tmpl,doc),GupShup.templates.defaultPaginationMap,dataForMap,doc);return op;},expandPaginationTemplateInDiv:function(parentDivId,reqObj,pagination,context){var innerHTML=this.expandPaginationTemplate(reqObj,pagination,context);var parentDiv=document.getElementById(parentDivId);parentDiv.innerHTML=innerHTML;},getJsonFromResponse:function(content)
{content=content.replace(this.JSON_SECURE_START,"");var endPos=content.lastIndexOf(this.JSON_SECURE_END);if(endPos>0)
content=content.substr(0,endPos);return YAHOO.lang.JSON.parse(content);},getJsonItems:function(req){if(typeof req!='object')
return;var reqParams="start="+req.start+"&limit="+req.limit+"&"+req.queryStr;var reqUrl=req.url;if(req.url.indexOf("?")<0)
reqUrl+="?"+reqParams;else
reqUrl+="&"+reqParams;var callBack={success:req.callBack.success,failure:req.callBack.failure,argument:req.callBack.argument}
var transaction=GupShup.ajax.send('GET',reqUrl,callBack,'PAGINATION');},clone:function(obj){if(typeof obj!=='object'||obj==null){return obj;}
var c=obj instanceof Array?[]:{};for(var i in obj){var prop=obj[i];if(typeof prop=='object'){if(prop instanceof Array){c[i]=[];for(var j=0;j<prop.length;j++){if(typeof prop[j]!='object'){c[i].push(prop[j]);}else{c[i].push(this.clone(prop[j]));}}}else{c[i]=prop;}}else{c[i]=prop;}}
return c;},getDateFrom:function(dayBoxName,monthBoxName,yearBoxName){var myDayStr=document.getElementById(dayBoxName).value;var myMonthStr=document.getElementById(monthBoxName).value;var myYearStr=document.getElementById(yearBoxName).value;var myMonth=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var myDateStr=myDayStr+' '+myMonth[myMonthStr]+' '+myYearStr;var myDate=new Date();myDate.setFullYear(myYearStr,myMonthStr,myDayStr);return myDate;},checkDate:function(dayBoxName,monthBoxName,yearBoxName){var myDayStr=document.getElementById(dayBoxName).value;var myMonthStr=document.getElementById(monthBoxName).value;var myYearStr=document.getElementById(yearBoxName).value;var myMonth=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var myDateStr=myDayStr+' '+myMonth[myMonthStr]+' '+myYearStr;var myDate=new Date();myDate.setFullYear(myYearStr,myMonthStr,myDayStr);if(myDate.getMonth()!=myMonthStr){return false;}else{return myDate;}},isValidAge:function(dob,minAge){var today=new Date();var minDob=new Date();minDob.setYear(today.getYear-13);minDob.setMonth(today.getMonth);minDob.setDate(today.getDate);if(dob>=minDob)
return true;else
return true;},isValidImage:function(fileName){if(fileName.length>0)
{if(this.isImageFile(fileName))
{return true;}
else
{return false;}}
return true;},isImageFile:function(fileName){var supportedExtensions=new Array("jpg","jpeg","gif");incomingsupportedExtensions=fileName.split(".");var extensionPos=incomingsupportedExtensions.length-1;if(extensionPos>=0)
{fileExtension=incomingsupportedExtensions[extensionPos];fileExtension=fileExtension.toLowerCase();var isImage=false;for(var i=0;i<supportedExtensions.length&&!isImage;i++)
{if((fileExtension.lastIndexOf(supportedExtensions[i])==-1))
{isImage=false;}
else
{isImage=true;return true;}}
return false;}
else
return false;},getFileExtension:function(fileName){var fileName=this.trim(fileName);var incomingsupportedExtensions=fileName.split(".");var extensionPos=incomingsupportedExtensions.length-1;if(extensionPos>=0)
{var fileExtension=incomingsupportedExtensions[extensionPos];fileExtension=fileExtension.toLowerCase();return fileExtension;}
return"";},getFileAndExtension:function(fileName){var fileName=this.trim(fileName);var incomingsupportedExtensions=fileName.split(".");var extensionPos=incomingsupportedExtensions.length-1;if(extensionPos>=0)
{var fileExtension=incomingsupportedExtensions[extensionPos];fileExtension=fileExtension.toLowerCase();incomingsupportedExtensions.pop();return{ext:fileExtension,name:incomingsupportedExtensions.join(".")};}
return{};},getNewSubmitForm:function(){var submitForm=document.createElement("FORM");window.document.body.appendChild(submitForm);submitForm.method="POST";return submitForm;},createNewFormElement:function(inputForm,elementName,elementValue){var newElement=null;if(window.ActiveXObject)
newElement=document.createElement('<INPUT name="'+elementName+'">');else
newElement=document.createElement('INPUT');newElement.setAttribute('name',elementName);newElement.setAttribute('value',elementValue);newElement.setAttribute('type',"hidden");inputForm.appendChild(newElement);return newElement;},createAndAppendDummyForm:function(formName){if((arguments.length==0)||(arguments.length%2==0))
return;var form=null;if(typeof document.forms[formName]=="object")
{GupShup.html.util.destroyElement(document.forms[formName]);}
if(window.ActiveXObject)
form=document.createElement('<FORM name="'+formName+'">');else
form=document.createElement("FORM");form.setAttribute('method',"POST");form.setAttribute('id',formName);form.setAttribute('name',formName);for(var i=1;i<arguments.length;i=i+2)
{this.createNewFormElement(form,arguments[i],arguments[i+1]);}
if(typeof document.getElementById('KB927917')=='object')
document.getElementById('KB927917').appendChild(form);else
window.document.body.appendChild(form);return form;},postData:function(url){if((arguments.length==0)||(arguments.length%2==0))
return;var submitForm=this.getNewSubmitForm();for(var i=1;i<arguments.length;i=i+2)
{this.createNewFormElement(submitForm,arguments[i],arguments[i+1]);}
submitForm.action=url;submitForm.submit();},getQueryStringFromObject:function(obj,separator,delimiter){if(typeof obj!='object')
return'';if(typeof separator!='string')
separator='=';if(typeof delimiter!='string')
delimiter='&';var qStr='';for(var i in obj){if(qStr.length>0)
qStr+=delimiter;qStr+=i+separator+obj[i];}
return qStr;},getGroupNameFromAccessUrl:function(accUrl)
{accUrl=this.trim(accUrl);var start=accUrl.search(/groups/)+7;return accUrl.substr(start);},validateSearchQuery:function(){var searchForm=document.forms["headerSearchForm"];if(!GupShup.util.isInitialized(searchForm))
return false;var searchTextBox=searchForm.elements["query"];if(!GupShup.util.isInitialized(searchTextBox))
return false;if(!GupShup.util.isAscii(searchTextBox.value))
{alert(GupShup.html.errorMessages.invalidSearchQuery);return false;}
return true;},callUrchinTracker:function(xhr){try
{var respObject=GupShup.util.getJsonFromResponse(xhr.responseText);if((typeof(respObject)=='object')&&(GupShup.util.isInitialized(respObject.status))&&(respObject.status=='SUCCESS')&&(GupShup.util.isInitialized(respObject.urchinUrl)))
{if(typeof(_gat)=='object')
{var pageTracker=_gat._getTracker(GupShup.conf.gaWebarooCode);pageTracker._trackPageview(respObject.urchinUrl);}}}
catch(error)
{if(GupShup.conf.jsDebug)
alert('Error while calling urchin tracker'+error);}
GupShup.html.util.hideLoader();},disableRightClick:function(){var rightClikcFunct=function(e){if(document.all)
return false;if(document.layers||(document.getElementById&&!document.all))
{if(e.which==2||e.which==3)
return false;}};if(document.layers)
{document.captureEvents(Event.MOUSEDOWN);}
document.onmousedown=rightClikcFunct;document.onmouseup=rightClikcFunct;document.oncontextmenu=new Function("return false;");},htmlDecode:function(data){data=data.replace(/&#(\d+);/g,function(wholematch,parenmatch1){return String.fromCharCode(+parenmatch1);});return data;},htmlDoubleDecode:function(data){data=data.replace(/&amp;/g,'&');data=GupShup.util.htmlDecode(data);return data;},getFunction:function(fName){var resp={status:false,h:null};if(typeof fName=="string")
{fName=this.trim(fName);if(fName.length<1)
return resp;var f=fName.split(".");var o=window;for(var j=0;j<f.length-1;j++)
{if(typeof o[f[j]]!="undefined")
{o[f[j]]=o[f[j]];o=o[f[j]];}
else
return resp;}
if(typeof o[f[j]]=="function")
return{status:true,h:o[f[j]]};else
return resp;}
else if(typeof fName=="function")
return{status:true,h:fName};else
return resp;},getGSMASCIIMsgLength:function(msg){if(!GupShup.util.isInitialized(msg))
return 0;var len=0;for(var i=0;i<msg.length;i++)
{if(GupShup.util.GSM_SPECIAL_CHARS.indexOf(msg.charAt(i))>-1)
len++;len++;}
return len;},getSMSCount:function(contentLength,firstFragLen,multFragLen){var count=0;if(contentLength>0)
{if(contentLength<=firstFragLen)
count=1;else
{count=Math.floor(contentLength/multFragLen);if((contentLength%multFragLen)>0)
count++;}}
return count;},limitGSMASCIIMsg:function(msg,limit){if(!GupShup.util.isInitialized(msg))
return msg;var len=0;for(var i=0;i<msg.length;i++)
{if(GupShup.util.GSM_SPECIAL_CHARS.indexOf(msg.charAt(i))>-1)
len++;len++;if(len==limit)
return msg.substring(0,i+1);else if(len>limit)
return msg.substring(0,i);}
return msg;},eventTracker:function(category,action,label,value){_gaq.push(['_trackEvent',category,action,label,value]);},getDateInTimezone:function(tzOffset){return new Date(new Date().getTime+tzOffset);}};(function(){GupShup.events={};GupShup.events.types=new Array("POST_GROUP","DELETE","POST_P2P","POSTING_GROUP_CHANGED","POSTING_TYPE_CHANGED","POSTING_GROUP_UPDATED","ACCOUNT_SETTINGS_UPDATE","GROUP_SETTINGS_UPDATE","PROFILE_SETTINGS_UPDATE","CREATE_GROUP","SUBSCRIBE","UNSUBSCRIBE","SHARE_GROUP","FLAG_MSG","INVITE","GROUP_VIEW_CHANGED","P2P_TAB_CHANGED","P2P_NAV_CHANGED","WINDOW_ONSCROLL","PROFILE_IMAGE_UPDATED","PROFILE_NAME_UPDATED","SUCCESSFUL_TRANSACTION","UPDATE_TRANSACTION","ENT_MASK_UPDATED");GupShup.events.isValid=function(name){var isValid=false;for(var i=0;i<GupShup.events.types.length;i++)
{if(name==GupShup.events.types[i])
{isValid=true;break;}}
return isValid;}
GupShup.events.eventsQueue=new Array();GupShup.events.hookQueue=new Array();GupShup.events.register=function(hook){if(GupShup.events.isValid(hook.name))
{if(typeof hook.handler=='function')
GupShup.events.hookQueue.push(hook);}
else
{if(GupShup.conf.jsDebug)
alert("Error registering hook: "+hook.name);}};GupShup.events.unregister=function(identifier){var tempHooksQ=new Array();var hooksLen=GupShup.events.hookQueue.length;for(var j=0;j<hooksLen;j++)
{var hook=GupShup.events.hookQueue.pop();if(hook.identifier!=identifier)
tempHooksQ.push(hook);}
GupShup.events.hookQueue=tempHooksQ;};GupShup.events.add=function(event){if((event instanceof GupShup.html.event)&&event.isValid())
{GupShup.events.eventsQueue.push(event);GupShup.events.process();}};GupShup.events.process=function(){var len=GupShup.events.eventsQueue.length;for(var i=0;i<len;i++)
{var event=GupShup.events.eventsQueue.pop();var hooksLen=GupShup.events.hookQueue.length;for(var j=0;j<hooksLen;j++)
{var hook=GupShup.events.hookQueue[j];if(hook.name==event.name)
{try
{hook.handler(event);event.executeCallBack();}
catch(e)
{if(GupShup.conf.jsDebug)
alert("Error processing event: "+event.name+" generated by source: "+event.source+" Error: "+e);}}}}}
GupShup.events.clearQ=function(){GupShup.events.hookQueue=new Array();}})();(function(){GupShup.html.event=function(event){this.name=event.name;this.params=event.params;this.source=event.source;this.postEventHandler=event.postEventHandler;}
GupShup.html.event.prototype.publish=function(){GupShup.events.add(this);}
GupShup.html.event.prototype.isValid=function(){return GupShup.events.isValid(this.name);}
GupShup.html.event.prototype.executeCallBack=function(){if(typeof this.postEventHandler=='function')
this.postEventHandler(this);}
GupShup.html.event.prototype.getParamsString=function(){return GupShup.util.getQueryStringFromObject(this.params);}})();(function(){GupShup.html.actions=GupShup.html.actions||{forwardMsg:function(msgId){GupShup.html.actions.pageReload(GupShup.conf.contextPath+"/p2pgupshupspace?msgId="+msgId);},viewMsg:function(msgId){GupShup.html.actions.pageReload(GupShup.conf.contextPath+"/messages/"+msgId);},forwardToPaymentSystem:function(amount,phone,returnUrl){GupShup.html.actions.pageReload(GupShup.conf.paymentFundRU+"?phone="+phone+"&amt="+amount+"&ru="+returnUrl);},pageReload:function(url){window.location=url;},postToMyGroup:function(msgId){GupShup.html.actions.pageReload(GupShup.conf.contextPath+"/gupshupspace?msgId="+msgId);},sendMsg:function(sendMsgTo){GupShup.html.actions.pageReload(GupShup.conf.contextPath+"/p2pgupshupspace?sendMsgTo="+sendMsgTo);},reportOffensive:function(msgId){var flagtype=new GupShup.forms.controls({name:'flagMessage.flagType'});flagtype.init();var commentS=new GupShup.forms.controls({name:'flagMessage.comment'});commentS.init();if(commentS.get('length')>200)
{commentS.showNotification(GupShup.html.errorMessages.bigComment,{failure:true,position:'right'});return;}
else if(!GupShup.util.isAscii(commentS.getValue()))
{commentS.showNotification(GupShup.html.errorMessages.nonAsciiChar,{failure:true,position:'right'});return;}
else if(!GupShup.util.isValidContent(commentS.getValue(),stopWords))
{commentS.showNotification(GupShup.html.errorMessages.stopWordsInComment,{failure:true,position:'right'});return;}
if(flagtype.getValue()!='NONE')
{var obj=this;var callback={success:function(o){obj.flagSuccess(o,obj)},failure:function(o){obj.flagError(o,obj)},argument:{}};GupShup.html.util.disableBtn("flagMsgBtn");GupShup.html.util.disableBtn("flagMsgCancel");GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl,callback,"flagMessage",false);}
else
{flagtype.showNotification(GupShup.html.errorMessages.noFlagTypeSelected,{failure:true,position:'right'});}},showOffensivePopUp:function(msgId,msgType,ref){GupShup.forms.hideNotification();GupShup.html.util.showElement('flagMessageTemplate');document.forms['flagMessage'].comment.value='';document.forms['flagMessage'].flagType.selectedIndex=0;if(msgType=="REPLY")
{document.forms['flagMessage'].replyId.value=msgId;document.forms['flagMessage'].msgId.value=-1;}
else
{document.forms['flagMessage'].replyId.value=-1;document.forms['flagMessage'].msgId.value=msgId;}
var ele=document.getElementById('flagMessageTemplate');GupShup.html.util.overlay(ref,ele,"top left",0,-400);GupShup.html.util.adjustPopupTop(ele,false,10);},showLoginToFlagErr:function(queryStr){var lbObj={msg:GupShup.html.errorMessages.loginToFlagMsg};GupShup.html.util.showLightBox(lbObj);},flagSuccess:function(o,obj)
{var response=GupShup.util.getJsonFromResponse(o.responseText);if(response.status=="SUCCESS")
{GupShup.forms.showNotification(response.message,{success:true});GupShup.html.util.hideElement('flagMessageTemplate');}
else
{GupShup.forms.showNotification(response.message,{failure:true});GupShup.html.util.hideElement('flagMessageTemplate');}
GupShup.html.util.enableBtn("flagMsgBtn");GupShup.html.util.enableBtn("flagMsgCancel");GupShup.html.actions.pageReload("#");},flagError:function(o,obj){GupShup.forms.showNotification(GupShup.html.errorMessages.internalError,{failure:true});},shareGroup:function(formName){var callBack={success:GupShup.callback.shareResponseHandler,failure:GupShup.callback.shareResponseHandler}
GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl,callBack,formName,false);},processNoSpam:function(){var callBack={success:GupShup.callback.processNoSpamSuccess,failure:GupShup.callback.processNoSpamErr}
GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl,callBack,"spamControl",false);},renewSubscription:function(formName){var callback={success:GupShup.html.premiumPlan.methods.processSubscribeResp,failure:GupShup.html.premiumPlan.methods.processSubscribeResp};GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl+'&type='+GupShup.conf.actions.manageSubscribers,callback,formName,false);},requestSubscription:function(formName){var callback={success:GupShup.callback.processSubscribeResp,failure:GupShup.callback.processSubscribeResp};GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl+'&type='+GupShup.conf.actions.manageSubscribers,callback,formName,false);},requestComSubscription:function(formName){var callback={success:GupShup.callback.processComSubscribeResp,failure:GupShup.callback.processComSubscribeResp};GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl+'&type='+GupShup.conf.actions.manageSubscribers,callback,formName,false);},requestAccountBalance:function(callback){GupShup.ajax.send('POST',GupShup.conf.readUrl+'&type=USER_INFO&infoType=ACCOUNT_BALANCE',callback,'USER_INTIATED_READ');},removeSubscribers:function(formName){var callBack={success:GupShup.callback.processMySubscribers,failure:GupShup.callback.processMySubscribersErr}
GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl+'&type='+GupShup.conf.actions.manageSubscribers,callBack,formName,false);},deleteMsg:function(entityId,msgId,currPageStart,limit,callback){var queryUrl=GupShup.conf.writeUrl+'&type='+GupShup.conf.actions.deletePost
+'&msgId='+msgId+'&entityId='+entityId+'&start='+currPageStart+'&limit='+limit;GupShup.ajax.send('POST',queryUrl,callback,'WRITE');},blockUnblockSender:function(name,srcEntityId,action,callback,currPageStart,limit){var queryUrl=GupShup.conf.writeUrl+'&type='+action
+'&userIdentifier='+name+'&srcEntityId='+srcEntityId+'&start='+currPageStart+'&limit='+limit;GupShup.ajax.send('POST',queryUrl,callback,'WRITE');},showReplyBox:function(formName,status){if(!document.forms[formName])
return;if(status)
{document.forms[formName].style.display="block";if(typeof document.forms[formName].ctrl=="undefined")
{document.forms[formName].ctrl=new GupShup.forms.controls({name:formName+'.text',limit:GupShup.conf.replyMessageLength,toolTip:''});document.forms[formName].ctrl.init();var counter=GupShup.util.trim(document.forms[formName].counter.value);document.forms[formName].ctrl.addListner('counter',{holder:counter});}
document.forms[formName].text.focus();}
else
{document.forms[formName].style.display="none";document.forms[formName].text.value=document.forms[formName].to.value+" ";}},sendReply:function(formName){var formH=document.forms[formName];var reply=GupShup.util.trim(formH.text.value);var replyObj=GupShup.html.util.getDestinationsForReplies(formH.text.value);var validReply=replyObj.isTextPresent;var noOfGrps=replyObj.count;var overflow=(reply.length>GupShup.conf.replyMessageLength);if(validReply&&!overflow&&noOfGrps>0)
{if(!GupShup.util.isAscii(reply))
{formH.ctrl.showNotification(GupShup.html.errorMessages.nonAsciiReplyErr,{failure:true,position:'right'});return;}
var successH=GupShup.html.actions.sendReplySuccess;var failureH=GupShup.html.actions.ajaxFailure;var successCH=GupShup.util.getFunction(formH.onsuccess.value);var failureCH=GupShup.util.getFunction(formH.onfailure.value);if(successCH.status==true)
successH=successCH.h;if(failureCH.status==true)
failureH=failureCH.h;var callback={success:successH,failure:failureH,argument:{form:formName}}
GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl,callback,formName,false);}
if(overflow)
GupShup.forms.showNotification(GupShup.html.errorMessages.replyLengthOverFlow,{failure:true});if(!validReply)
formH.ctrl.showNotification(GupShup.html.errorMessages.invalidReply,{failure:true,position:'right'});return;},sendReplySuccess:function(request){var resp=GupShup.util.getJsonFromResponse(request.responseText);if(resp.status=='SUCCESS')
{GupShup.html.actions.showReplyBox(request.argument.form,false);GupShup.forms.showNotification(resp.message,{success:true});}
else
GupShup.forms.showNotification(resp.message,{failure:true});},ajaxFailure:function(){GupShup.forms.showNotification(GupShup.html.errorMessages.internalError,{failure:true});},updateReplyStatus:function(entityId,msgId,currPageStart,limit,action,callback){var queryUrl=GupShup.conf.writeUrl+'&type='+GupShup.conf.actions.updateReply
+'&replyId='+msgId+'&entityId='+entityId+'&start='+currPageStart+'&limit='+limit+'&updateAction='+action;GupShup.ajax.send('POST',queryUrl,callback,'WRITE');},redirectToPaymentFundRU:function(params,returnURL,promotionsURL){var fundruURL=GupShup.conf.paymentFundRU+'?'+params;fundruURL+='&ru='+escape(GupShup.conf.fromUrl+'/'+returnURL);if(GupShup.util.isInitialized(promotionsURL))
fundruURL+='&pu='+escape(GupShup.conf.fromUrl+'/'+promotionsURL);window.location=fundruURL;}}})();(function(){GupShup.html.pendingAction={};GupShup.html.pendingAction.ajaxSendPendingActionsSuccess=function(o){var response=GupShup.util.getJsonFromResponse(o.responseText);if(response.status!="SUCCESS")
{GupShup.forms.showNotification(GupShup.html.errorMessages.internalError,{failure:true});return;}
else
{var message="";switch(o.argument.type)
{case'FORWARD':message=GupShup.html.errorMessages.loginToForwardMsg;break;case'JOIN':message=GupShup.html.errorMessages.loginToJoinMsg;break;case'COMMUNITY':message=GupShup.html.errorMessages.loginToJoinComMsg;break;case'SEND_P2P':case'PIC':case'REPLY':default:message=GupShup.html.errorMessages.loginToGupShupMsg;break;}
var lbObj={msg:message,callBack:GupShup.html.pendingAction.cancelPendingAction}
GupShup.html.util.showLightBox(lbObj);}}
GupShup.html.pendingAction.ajaxSendPendingActionsFailure=function(o,obj){GupShup.forms.showNotification(GupShup.html.errorMessages.internalError,{failure:true});}
GupShup.html.pendingAction.sendP2PMsgPendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'SEND_P2P');}
GupShup.html.pendingAction.sendSharePendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'SHARE');}
GupShup.html.pendingAction.sendFwdPendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'FORWARD');}
GupShup.html.pendingAction.sendJoinPendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'JOIN');}
GupShup.html.pendingAction.sendComJoinPendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'COMMUNITY');}
GupShup.html.pendingAction.sendPicPendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'PIC');}
GupShup.html.pendingAction.sendReplyPendingAction=function(queryStr){GupShup.html.pendingAction.sendPendingAction(queryStr,'REPLY');}
GupShup.html.pendingAction.sendPendingAction=function(queryStr,actionType)
{queryStr=GupShup.util.trim(queryStr);if(queryStr!="")
{var callback={success:function(o){GupShup.html.pendingAction.ajaxSendPendingActionsSuccess(o);},failure:function(o){GupShup.html.pendingAction.ajaxSendPendingActionsFailure(o);},argument:{type:actionType}};var url=GupShup.conf.writeUrl+"&type=ADD_PENDING_ACTION&action="+queryStr;var cObj=GupShup.ajax.send('POST',url,callback,'PENDINGACTION');}}
GupShup.html.pendingAction.cancelPendingAction=function()
{var obj=this;var callback={success:function(o){GupShup.html.util.closeLightBox();},failure:function(o){GupShup.html.util.closeLightBox();}};var url=GupShup.conf.writeUrl+"&type=ADD_PENDING_ACTION&action=cancel";var cObj=GupShup.ajax.send('POST',url,callback,'PENDINGACTION');}})();(function(){GupShup.ajax={};GupShup.ajax.send=function(reqType,url,callBack,reqIdentifier){var callbackWrapper={success:GupShup.ajax.successCallback,failure:GupShup.ajax.failureCallback,argument:{callback:callBack,reqIdentifier:reqIdentifier}};var conn={method:reqType,url:url,callBack:callbackWrapper,tType:reqIdentifier,onAbort:function(){}};var t=GupShup.connectionManager.makeConnection(conn);if(t.status)
{if(reqIdentifier!='READ'&&reqIdentifier!='DYNAMICBAR'&&reqIdentifier!='PENDINGACTION')
GupShup.html.util.showLoader();return t.tObj;}
else
return null;};GupShup.ajax.sendForm=function(reqType,url,callBack,form,isMultiPartData){var callbackWrapper={};if(isMultiPartData)
callbackWrapper={upload:GupShup.ajax.successCallback,success:GupShup.ajax.successCallback,failure:GupShup.ajax.failureCallback,argument:{callback:callBack,reqIdentifier:'FORM'}};else
callbackWrapper={upload:GupShup.ajax.successCallback,success:GupShup.ajax.successCallback,failure:GupShup.ajax.failureCallback,argument:{callback:callBack,reqIdentifier:'FORM'}};var conn={method:reqType,url:url,callBack:callbackWrapper,tType:'FORM',onAbort:function(){},form:form,isMultiPartData:isMultiPartData};var t=GupShup.connectionManager.makeConnection(conn);if(t.status)
{GupShup.html.util.showLoader();return t.tObj;}
else
return null;};GupShup.ajax.successCallback=function(xhr){var originalCallback=xhr.argument.callback;var reqIdentifier=xhr.argument.reqIdentifier;xhr.argument=originalCallback.argument;originalCallback.success(xhr);if(reqIdentifier!='DYNAMICBAR')
GupShup.util.callUrchinTracker(xhr);};GupShup.ajax.failureCallback=function(xhr){var originalCallback=xhr.argument.callback;var reqIdentifier=xhr.argument.reqIdentifier;xhr.argument=originalCallback.argument;originalCallback.failure(xhr);}})();(function(){GupShup.connectionManager={};GupShup.connectionManager.transactionQ=new Array();GupShup.connectionManager.makeConnection=function(connection){if(typeof connection.form=='string')
{YAHOO.util.Connect.setForm(document.forms[connection.form],connection.isMultiPartData);}
else if(typeof connection.form=='object')
{YAHOO.util.Connect.setForm(connection.form,connection.isMultiPartData);}
if(!GupShup.connectionManager.isNextTransactionPermitted())
{return{status:false};}
var tObj=YAHOO.util.Connect.asyncRequest(connection.method,connection.url,connection.callBack);GupShup.connectionManager.addTransaction({obj:tObj,type:connection.tType,onAbort:connection.onAbort});return{status:true,tObj:tObj};}
GupShup.connectionManager.addTransaction=function(tObj){if(!GupShup.connectionManager.isNextTransactionPermitted())
{GupShup.connectionManager.abortTransaction(tObj);}
if(GupShup.connectionManager.isTransactionAlive(tObj))
{GupShup.connectionManager.abortLPTransactions(tObj.type);GupShup.connectionManager.transactionQ.push(tObj);}}
GupShup.connectionManager.isTransactionAlive=function(tObj){if(tObj==null||typeof tObj=='undefined')
return false;else
return YAHOO.util.Connect.isCallInProgress(tObj.obj);}
GupShup.connectionManager.isNextTransactionPermitted=function(){var allowed=true;var tQ=GupShup.connectionManager.transactionQ;for(var i=0;i<tQ.length;i++)
{if(!GupShup.connectionManager.isTransactionAlive(tQ[i]))
tQ[i]=null;else
{if(GupShup.connectionManager.isAbortable(tQ[i]))
continue;else
{allowed=false;break;}}}
return allowed;}
GupShup.connectionManager.isAbortable=function(tObj){switch(tObj.type)
{case'FORM':case'WRITE':return false;case'READ':case'DYNAMICBAR':case'PAGINATION':case'PENDINGACTION':case'USER_INTIATED_READ':case'TABSWITCH':return true;}}
GupShup.connectionManager.getPriority=function(type){switch(type)
{case'FORM':case'WRITE':return 1;case'TABSWITCH':return 2;case'DYNAMICBAR':return 3;case'PAGINATION':return 4;case'PENDINGACTION':return 5;case'USER_INTIATED_READ':return 6;default:return 7;}}
GupShup.connectionManager.abortLPTransactions=function(type){var tQ=GupShup.connectionManager.transactionQ;var tempQ=new Array();var pReq=GupShup.connectionManager.getPriority(type);var len=tQ.length;for(var i=0;i<len;i++)
{var transObj=tQ.pop();if(GupShup.connectionManager.isTransactionAlive(transObj))
{if(transObj.type!='READ')
{var pAvialable=GupShup.connectionManager.getPriority(transObj.type);if((transObj.type==type)||(pReq<pAvialable))
{GupShup.connectionManager.abortTransaction(transObj);}
else
{tempQ.push(transObj);}}}}
GupShup.connectionManager.transactionQ=tempQ;}
GupShup.connectionManager.abortTransaction=function(tObj){if(GupShup.connectionManager.isAbortable(tObj))
{YAHOO.util.Connect.abort(tObj.obj);if(typeof tObj.onAbort=='function')
tObj.onAbort();}}})();(function(){GupShup.forms.controls=function(control){var doc=control.doc;if(typeof doc=='undefined')
doc=document;if(typeof control.id!='undefined')
{this.ele=doc.getElementById(control.id);}
else
{var eleName=control.name.split(".")[1];var form=doc.forms[control.name.split(".")[0]];if(typeof form=='object')
this.ele=form[eleName];}
if((typeof this.ele=='undefined')||(this.ele==null))
return;this.id=this.ele.id;this.eleName=this.ele.name;this.style=this.ele.style;if(typeof control.dimText=='string')
this.addDimText(control.dimText);else
this.addDimText('');this.pattern=control.pattern;if(typeof control.toolTip=='string')
this.toolTip=control.toolTip;else
this.toolTip='';if(typeof control.limit=='number')
this.limit=control.limit;else
this.limit=-1;if(typeof control.isGSMASCIIMsg=='boolean')
this.isGSMASCIIMsg=control.isGSMASCIIMsg;else
this.isGSMASCIIMsg=true;if(typeof control.stripCRFromCount=='boolean')
this.stripCRFromCount=control.stripCRFromCount;else
this.stripCRFromCount=false;if(typeof(control.validator)=='object')
this.validator=control.validator;else
this.validator=null;this.err=false;}
GupShup.forms.controls.DEFAULT_INPUT_TEXT_COLOR="#000000";GupShup.forms.controls.DEFAULT_DIM_TEXT_COLOR="#CCCCCC";GupShup.forms.controls.DEFAULT_NOTIFICATION_CONTAINER="middle-col";GupShup.forms.controls.DEFAULT_NOTIFICATION_PROPERTIES={style:{superClass:"notification",success:"notificationGreen",failure:"notificationRed",warning:"notificationOrange"}};GupShup.forms.controls.prototype.isValidText=function(){return this.pattern.test(this.getValue());}
GupShup.forms.controls.prototype.validate=function(o){var result=null;if(this.validator!=null)
{result=this.validator.validatorF(this,this.validator.args);var styleClasses='';if(this.validator.style)
{var style=this.validator.style;if(typeof(style.superClass)=='string')
styleClasses=style.superClass;if(result.success)
styleClasses+=" "+style.success;else if(result.failure)
styleClasses+=" "+style.failure;else if(result.warning)
styleClasses+=" "+style.warning;}
GupShup.html.util.setClass(this.validator.notifEleId,styleClasses);if(result.success)
{if(typeof(result.message)=='string')
{GupShup.util.setInnerHTML(this.validator.notifEleId,result.message,this.doc);GupShup.html.util.showElement(this.validator.notifEleId,this.validator.isInline,this.doc);}
else
{GupShup.util.setInnerHTML(this.validator.notifEleId,'',this.doc);GupShup.html.util.hideElement(this.validator.notifEleId,this.doc);}}
else if(result.failure||result.warning)
{GupShup.util.setInnerHTML(this.validator.notifEleId,result.message,this.doc);GupShup.html.util.showElement(this.validator.notifEleId,this.validator.isInline,this.doc);}}
return result;}
GupShup.forms.controls.prototype.isValid=function(){if((typeof this.ele=='undefined')||(this.ele==null))
return false;else
return true;}
GupShup.forms.controls.prototype.get=function(attr){switch(attr)
{case'value':return this.getValue();case'length':var val=this.getValue();if(this.stripCRFromCount)
val=GupShup.util.removeCarriageReturn(val);return val.length;case'gsmASCIIMsgLength':var val=this.getValue();if(this.stripCRFromCount)
val=GupShup.util.removeCarriageReturn(val);return GupShup.util.getGSMASCIIMsgLength(val);case'object':return this.ele;default:return this[attr]?this[attr]:'';}}
GupShup.forms.controls.prototype.getValue=function(){switch(this.ele.type)
{case'text':case'password':case'hidden':case'textarea':case'file':return GupShup.util.trim(this.ele.value);case'select-one':if(this.ele.selectedIndex>=0)
return GupShup.util.trim(this.ele.options[this.ele.selectedIndex].value);else
return'';}}
GupShup.forms.controls.prototype.addEventListner=function(types,newF,keepPrev)
{var typeArr=types.split(",");for(var i=0;i<typeArr.length;i++)
{var type=GupShup.util.trim(typeArr[i]);switch(type)
{case'onchange':var prevF=this.ele.onchange;if(typeof prevF=='function')
this.ele.onchange=function(){prevF();newF();}
else
this.ele.onchange=function(){newF();}
break;case'onblur':var prevF=this.ele.onblur;if(typeof prevF=='function')
this.ele.onblur=function(){prevF();newF();}
else
this.ele.onblur=function(){newF();}
break;case'onfocus':var prevF=this.ele.onfocus;if(typeof prevF=='function')
this.ele.onfocus=function(){prevF();newF();}
else
this.ele.onfocus=function(){newF();}
break;case'onkeyup':var prevF=this.ele.onkeyup;if(typeof prevF=='function')
this.ele.onkeyup=function(){prevF();newF();}
else
this.ele.onkeyup=function(){newF();}
break;}}}
GupShup.forms.controls.prototype.removeEventListner=function(types)
{var typeArr=types.split(",");for(var i=0;i<typeArr.length;i++)
{var type=GupShup.util.trim(typeArr[i]);switch(type)
{case'onchange':this.ele.onchange=function(){};break;case'onblur':this.ele.onblur=function(){};break;case'onfocus':this.ele.onfocus=function(){}
break;case'onkeyup':this.ele.onkeyup=function(){}
break;}}}
GupShup.forms.controls.prototype.setOnChange=function(){try
{if(typeof this.ele.onchange=='function')
this.ele.onchange();}
catch(e){}}
GupShup.forms.controls.prototype.addListner=function(type,attr)
{var o=this;switch(type)
{case'counter':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);var count=o.limit-o.get('gsmASCIIMsgLength');displayBox.innerHTML=count;if(count<=0)
{o.trimLength();displayBox.innerHTML=0;}});break;case'usedCounter':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);displayBox.innerHTML=o.get('gsmASCIIMsgLength');});break;case'counterUnicode':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);var count=o.limit-o.get('length');displayBox.innerHTML=count;if(count<=0)
{o.trimLength();displayBox.innerHTML=0;}});break;case'usedCounterUnicode':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);displayBox.innerHTML=o.get('length');});break;case'sms-counter':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);var firstMsgLimit=160;if(typeof attr.startMsgLimit=="number")
firstMsgLimit=parseInt(attr.startMsgLimit);var multMsgLimit=153;if(typeof attr.smsLimit=="number")
multMsgLimit=parseInt(attr.smsLimit);var contentLength=o.get('gsmASCIIMsgLength');displayBox.innerHTML=GupShup.util.getSMSCount(contentLength,firstMsgLimit,attr.smsLimit);});break;case'sms-counterUnicode':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);var firstMsgLimit=70;if(typeof attr.startMsgLimit=="number")
firstMsgLimit=parseInt(attr.startMsgLimit);var multMsgLimit=66;if(typeof attr.smsLimit=="number")
multMsgLimit=parseInt(attr.smsLimit);var contentLength=o.get('length');displayBox.innerHTML=GupShup.util.getSMSCount(contentLength,firstMsgLimit,attr.smsLimit);});break;case'copy-to':this.addEventListner('onkeyup,onfocus',function(){var displayBox=document.getElementById(attr.holder);switch(displayBox.type)
{case'text':case'hidden':case'textarea':displayBox.value=o.getValue();break;}});break;}}
GupShup.forms.controls.prototype.removeListner=function(type)
{var o=this;switch(type)
{case'counter':case'usedCounter':case'counterUnicode':case'usedCounterUnicode':case'sms-counter':case'sms-counterUnicode':case'copy-to':this.removeEventListner('onkeyup,onfocus');break;}}
GupShup.forms.controls.prototype.isDefaultText=function(){return(this.get('value')==this.get('dimText'));}
GupShup.forms.controls.prototype.addDimText=function(text){var o=this;if(typeof o.dimText=='string'&&o.dimText.length>0)
{o.dimText=text;return;}
else if(text.length==0)
{o.dimText='';return;}
else
o.dimText=text;if(o.get('value').length<1)
o.set(o.get('dimText'));o.ele.style.color=GupShup.forms.controls.DEFAULT_DIM_TEXT_COLOR;o.addEventListner('onfocus',function(){var val=GupShup.util.trim(o.get('value'));if(val==o.get('dimText'))
o.set("");o.ele.style.color=GupShup.forms.controls.DEFAULT_INPUT_TEXT_COLOR;});o.addEventListner('onblur',function(){var val=GupShup.util.trim(o.get('value'));if(val=="")
o.set(o.get('dimText'));o.ele.style.color=GupShup.forms.controls.DEFAULT_DIM_TEXT_COLOR;});}
GupShup.forms.controls.prototype.trimLength=function(){if(this.isGSMASCIIMsg)
this.ele.value=GupShup.util.limitGSMASCIIMsg(this.get('value'),this.get('limit'));else
this.ele.value=this.get('value').substring(0,this.get('limit'));}
GupShup.forms.controls.prototype.init=function(){var o=this;o.addDimText(o.get('dimText'));if(o.limit>0)
{o.ele.setAttribute("maxLength",o.limit);o.addEventListner('onchange',function(){if(o.isGSMASCIIMsg)
o.set(GupShup.util.limitGSMASCIIMsg(o.get('value'),o.get('limit')));else
o.set(o.get('value').substring(0,o.get('limit')));});}
o.addEventListner('onblur',function(){o.err=false;GupShup.html.util.destroyElement('errorBox');GupShup.html.util.destroyElement('toolTip');});this.addToolTip(this.toolTip);if(o.validator!=null)
{if(typeof(o.validator.showNotifOn)=='object')
{for(var i=0;i<o.validator.showNotifOn.length;i++)
o.addEventListner(o.validator.showNotifOn[i],function(){o.validate();});}}};GupShup.forms.controls.prototype.addToolTip=function(text){this.toolTip=text;var o=this;if(o.get('toolTip').length>0)
{o.addEventListner('onfocus',function(){if(o.err==false)
{var toolTip=GupShup.html.util.createToolTipElement(o.toolTip);GupShup.html.util.overlay(o.ele,toolTip,"right",0,20);}});}}
GupShup.forms.controls.prototype.setFocus=function(){try
{if(typeof this.ele.onfocus=='function')
this.ele.focus();}
catch(e){}}
GupShup.forms.controls.prototype.setAttr=function(name,value){switch(name)
{case'limit':this.limit=value;this.ele.setAttribute("maxLength",value);break;case'style':this.style=this.ele.style=value;break;case'dimText':this.dimText=value;break;}}
GupShup.forms.controls.prototype.set=function(text){switch(this.ele.type)
{case'text':case'password':case'hidden':case'textarea':this.ele.value=GupShup.util.trim(text);if(typeof this.ele.onkeyup=='function')
this.ele.onkeyup();}}
GupShup.forms.controls.prototype.showNotification=function(text,notifStyle){switch(notifStyle.position)
{case'right':var overlayObj=null;if(notifStyle.failure==true)
{overlayObj=GupShup.html.util.createErrElement(text);this.err=true;if(this.ele.type!='file')
this.ele.focus();GupShup.html.util.overlay(this.ele,overlayObj,"right",0,0);}
else if(notifStyle.success==true)
{overlayObj=GupShup.html.util.createToolTipElement(text);GupShup.html.util.overlay(this.ele,overlayObj,"right",0,20);}
break;case'top':default:GupShup.forms.showNotification(text,notifStyle);break;}}
GupShup.forms.showNotification=function(text,notifStyle,divId,notifId,img){if(!GupShup.util.isInitialized(notifId)){notifId='notification';}
var notifEle=GupShup.html.util.createNotificationElement(text,function(){GupShup.html.util.destroyElement(notifId)},divId,notifId,img);var style=GupShup.forms.controls.DEFAULT_NOTIFICATION_PROPERTIES.style;var styleClasses=style.superClass;if(typeof notifStyle=='undefined')
notifStyle={success:true};if(notifStyle.success==true)
styleClasses+=" "+style.success;else if(notifStyle.failure==true)
styleClasses+=" "+style.failure;else if(notifStyle.warning==true)
styleClasses+=" "+style.warning;notifEle=GupShup.html.util.setClass(notifEle,styleClasses);if(!GupShup.util.isInitialized(divId)){divId=GupShup.forms.controls.DEFAULT_NOTIFICATION_CONTAINER;}
var notifHolder=document.getElementById(divId);notifHolder.insertBefore(notifEle,notifHolder.firstChild);window.scroll(0,0);}
GupShup.forms.hideNotification=function(){GupShup.html.util.destroyElement('notification');}
GupShup.forms.controls.hideNotification=function(){GupShup.html.util.destroyElement('errorBox');}
GupShup.forms.controls.initControls=function(controlArray){for(var i=0;i<controlArray.length;i++)
{var ctrl=controlArray[i];if(ctrl.isValid())
ctrl.init();}}})();(function(){GupShup.html.dynamicBar=GupShup.html.dynamicBar||{updateURL:function(){return GupShup.conf.contextPath+"/dynamicJsp";},COL_CONTAINER_SUFFIX:"-col",DYNAMIC_JS_CONTAINER_PREFIX:"dynamicScriptDiv_",updateTransaction:null,update:function(prevPage,nextPage,currOrientation,newPageParams,prevParentPage,nextParentPage){var obj=this;if(GupShup.util.isInitialized(obj.updateTransaction))
return false;var params='';if(typeof newPageParams=='object')
{params=GupShup.util.getQueryStringFromObject(newPageParams,'~','`');}
if(typeof prevParentPage=="undefined")
prevParentPage="";if(typeof nextParentPage=="undefined")
nextParentPage="";var qStr="newPage="+nextPage+"&newParentPage="+nextParentPage+"&oldPage="+prevPage+"&oldParentPage="+prevParentPage+"&orientation="+currOrientation+'&newPageParams='+params+"&withinPage=true";var callBack={success:function(o){obj.dynamicBarUpdateSuccess(o,obj)},failure:function(o){obj.dynamicBarUpdateFail(o,obj)},argument:{oldPage:prevPage,newPage:nextPage,oldParentPage:prevParentPage,newParentPage:nextParentPage,orientation:currOrientation}};obj.updateTransaction=GupShup.ajax.send('GET',this.updateURL()+"?"+qStr,callBack,'DYNAMICBAR');return true;},abortUpdate:function(){if(GupShup.util.isInitialized(this.updateTransaction))
{try
{this.updateTransaction.abort();}
catch(error)
{if(GupShup.conf.jsDebug)
alert("Could not abort dynamic bar update : error-"+error);}
this.updateTransaction=null;}},dynamicBarUpdateSuccess:function(o,obj){var content=o.responseText;if(obj.needForUpdate(content))
{obj.exapand(content,o.argument.orientation);}
obj.updateTransaction=null;},dynamicBarUpdateFail:function(o,obj){obj.updateTransaction=null;if(GupShup.conf.jsDebug)
alert("Could not update dynamic bar for: oldPage-"+o.argument.oldPage+", newPage-"+o.argument.newPage+", ori-"+o.argument.orientation+", httpStatus-"+o.status);},needForUpdate:function(content){if(GupShup.util.trim(content).length<1)
return false;else
return true;},exapand:function(innerHTML,orientation){var ele=document.getElementById(orientation.toLowerCase()+this.COL_CONTAINER_SUFFIX);if(typeof ele!='undefined')
ele.innerHTML=GupShup.util.trim(innerHTML);}}})();(function(){GupShup.html.util=GupShup.html.util||{createElement:function(type,id,content){this.destroyElement(id);var ele=document.createElement(type);ele.setAttribute('id',id);if(typeof content=='string')
ele.innerHTML=content;window.document.body.appendChild(ele);return ele;},createNotificationElement:function(text,onCloseFunct,divId,notifId,img){if(!GupShup.util.isInitialized(notifId)){notifId='notification';}
this.destroyElement(notifId);var closeBox=document.createElement("P");var closeLink=document.createElement("A");closeLink.innerHTML="Hide";closeLink.setAttribute('href','javascript:void(0);');closeLink.onclick=function(){onCloseFunct()};closeBox.appendChild(closeLink);var ele=document.createElement("DIV");var textEle=document.createElement("DIV");textEle.innerHTML=text;ele.appendChild(closeBox);ele.appendChild(textEle);ele.setAttribute("id",notifId);return ele;},createErrElement:function(text){this.destroyElement('errorBox');var msgBox=document.createElement("DIV");msgBox.setAttribute('id','errorMsg');msgBox.innerHTML=text;var ele=document.createElement("DIV");ele.setAttribute('id','errorBox');ele.appendChild(msgBox);window.document.body.appendChild(ele);return ele;},createLoaderElement:function(text){this.destroyElement('loader');var loader=document.createElement("DIV");loader.setAttribute('id','loader');loader.innerHTML=text;window.document.body.appendChild(loader);return loader;},showLoader:function(text){if(typeof text!='string')
var text='Processing your request..';var loader=this.createLoaderElement(text);GupShup.events.register({name:'WINDOW_ONSCROLL',identifier:'GupShup.html.util.floatLoader',handler:GupShup.html.util.floatLoader});GupShup.html.util.floatLoader();},hideLoader:function(){this.destroyElement('loader');GupShup.events.unregister('GupShup.html.util.floatLoader');},floatLoader:function(){var loader=document.getElementById("loader");GupShup.html.util.alignPopUpTo(loader,{bottom:true,left:true});},createToolTipElement:function(text){this.destroyElement('toolTip');var toolTip=document.createElement("DIV");toolTip.setAttribute('id','toolTip');toolTip.innerHTML=text;window.document.body.appendChild(toolTip);return toolTip;},hideElement:function(elementID,parentDom,dStyle){if(typeof parentDom=="undefined")
parentDom=document;var element=parentDom.getElementById(elementID);if(element!=null)
element.style.display=(typeof(dStyle)=="undefined")?"none":dStyle;},setVisibility:function(elementID,dStyle,parentDom){if(typeof parentDom=="undefined")
parentDom=document;var element=parentDom.getElementById(elementID);if(element!=null)
element.style.visibility=dStyle;},showElement:function(elementID,isInline,parentDom){if(typeof parentDom=="undefined")
parentDom=document;var element=parentDom.getElementById(elementID);if(element!=null)
element.style.display=(isInline==true)?"inline":"block";},destroyElement:function(eleId){if(typeof eleId=='object')
(eleId.parentNode).removeChild(eleId);else
{var ele=document.getElementById(eleId);if(ele)
(ele.parentNode).removeChild(ele);}},setClass:function(ele,styleClasses){if(typeof ele=="string")
ele=document.getElementById(ele);ele.setAttribute("class",styleClasses);ele.setAttribute("className",styleClasses);return ele;},getElementsByClass:function(searchClass,domNode,tagName){if(domNode==null)domNode=document;if(tagName==null)tagName='*';var el=new Array();var tags=domNode.getElementsByTagName(tagName);var tcl=" "+searchClass+" ";for(i=0,j=0;i<tags.length;i++){var test=" "+tags[i].className+" ";if(test.indexOf(tcl)!=-1)
el[j++]=tags[i];}
return el;},changeTagsDisplayTo:function(src,tagName,style){var tags=src.getElementsByTagName(tagName);for(var i=0;i<tags.length;i++)
{tags[i].style.display=style;}},showHideElement:function(showId,hideId){this.showElement(showId);this.hideElement(hideId);},setImageSource:function(imgId,imgSrc){document.getElementById(imgId).src=imgSrc;},disableBtn:function(Btn){var btn=document.getElementById(Btn);if(btn)
{btn.disabled="disabled";btn.style.cursor="wait";GupShup.html.util.setClass(btn,"dbtn");}},enableBtn:function(Btn){var btn=document.getElementById(Btn);if(btn)
{btn.disabled=false;btn.style.cursor="pointer";GupShup.html.util.setClass(btn,"mbtn");}},getWindowEventTarget:function(e){if(e.target)target=e.target;else if(e.srcElement)target=e.srcElement;if(target.nodeType==3)
target=targ.parentNode;return target;},getWindowSize:function(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number')
{myWidth=window.innerWidth;myHeight=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
var X=myWidth;var Y=myHeight;return{X:X,Y:Y};},getScrollXY:function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number')
{scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
var X=scrOfX;var Y=scrOfY;return{X:X,Y:Y};},alignPopUpTo:function(popupdiv,pos){var windowScrolled=this.getScrollXY();var windowSize=this.getWindowSize();if(pos.top)
popupdiv.style.top=windowScrolled.Y+"px";if(pos.left)
popupdiv.style.left="0px";if(pos.right)
popupdiv.style.left=(windowSize.X-popupdiv.offsetWidth)+"px";if(pos.bottom)
popupdiv.style.top=(windowSize.Y+windowScrolled.Y-popupdiv.offsetHeight)+"px";},adjustPopupTop:function(popupdiv,alignAtCenter,bottomMargin)
{var windowScrolled=this.getScrollXY();var windowSize=this.getWindowSize();var popupHeight=parseInt(popupdiv.clientHeight);var currentPopupTop=parseInt(popupdiv.style.top);if(!GupShup.util.isNumber(currentPopupTop))
currentPopupTop=0;var adjustedPopuptop=parseInt(currentPopupTop);if((windowScrolled.Y+windowSize.Y)<(currentPopupTop+popupHeight))
{adjustedPopuptop=(windowSize.Y+windowScrolled.Y)-(popupHeight+bottomMargin);}
else if(windowScrolled.Y>currentPopupTop)
{adjustedPopuptop=windowScrolled.Y;}
if(alignAtCenter)
adjustedPopuptop=parseInt((windowSize.Y/2+windowScrolled.Y)-(popupHeight/2));popupdiv.style.top=adjustedPopuptop+"px";},alignBoxAtCenter:function(boxName)
{var box=document.getElementById(boxName);var leftPos=this.getposOffset(box);var width=box.offsetWidth;var ht=box.offsetHeight;var windowSize=this.getWindowSize();var newLeft=(width>=windowSize.X)?0:(windowSize.X/2)-(width/2);var newtop=(ht>=windowSize.Y)?0:(windowSize.Y/2)-(ht/2);box.style.left=newLeft+"px";box.style.top=newtop+"px";},getposOffset:function(overlay,offsettype){var totaloffset=(offsettype=="left")?overlay.offsetLeft:overlay.offsetTop;var parentEl=overlay.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;},getElementPosition:function(referenceObj){var xpos=this.getposOffset(referenceObj,"left");var ypos=this.getposOffset(referenceObj,"top");return{x:xpos,y:ypos,w:referenceObj.offsetWidth,h:referenceObj.offsetHeight};},overlay:function(referenceObj,currObj,opt_position,vPad,hPad){var xpos=this.getposOffset(referenceObj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?referenceObj.offsetWidth:0);var ypos=this.getposOffset(referenceObj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?referenceObj.offsetHeight:0);currObj.style.left=xpos+hPad+"px";currObj.style.top=ypos+vPad+"px";return true;},changeOpac:function(opacity,id){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";},showLightBox:function(content)
{var blurBg=document.createElement("DIV");blurBg.setAttribute("id","blurBg");window.document.body.appendChild(blurBg);var windowSize=this.getWindowSize();var ht=window.document.body.offsetHeight;blurBg.style.height=(ht>700?ht+100:700)+'px';if(typeof content.callBack!='function')
{content.callBack=GupShup.html.util.closeLightBox;}
if(typeof content.msg=='string')
{var bigErrHolder=this.createBigErr(content);this.showElement("bigError");this.adjustPopupTop(bigErrHolder,200);bigErrHolder.style.left=(windowSize.X-995)/2+(730/2-bigErrHolder.offsetWidth/2)+'px';}
else if(typeof content.element=='string')
{this.showElement(content.element);this.alignBoxAtCenter(content.element);}
this.showElement("blurBg");this.changeOpac(50,"blurBg");},closeLightBox:function(){GupShup.html.util.destroyElement('bigError');;GupShup.html.util.destroyElement('blurBg');},createBigErr:function(content)
{var bigErrHolder=document.createElement("DIV");bigErrHolder.setAttribute("id",'bigError');if(typeof content.containerClass=="undefined")
content.containerClass="bigErrorWidth";bigErrHolder.setAttribute("class",content.containerClass);bigErrHolder.setAttribute("className",content.containerClass);if(typeof content.width=="number")
bigErrHolder.style.width=content.width+"px";if(typeof content.height=="number")
bigErrHolder.style.height=content.height+"px";var bigErrTop=document.createElement("DIV");bigErrTop.setAttribute("class",'bigErrtop bigWarnTopBg');bigErrTop.setAttribute("className",'bigErrtop bigWarnTopBg');var closeLink=document.createElement("A");closeLink.innerHTML="[x]";closeLink.setAttribute('href','javascript:void(0);');closeLink.onclick=content.callBack;var bigErrMiddle=document.createElement("DIV");if(typeof content.contentClass=="undefined")
content.contentClass="bigWarnMidBg";bigErrMiddle.setAttribute("class",'middleErr '+content.contentClass);bigErrMiddle.setAttribute("className",'middleErr '+content.contentClass);bigErrMiddle.innerHTML=content.msg;var bigErrEnd=document.createElement("DIV");bigErrEnd.setAttribute("class",'bigErrBot bigWarnBotBg');bigErrEnd.setAttribute("className",'bigErrBot bigWarnBotBg');bigErrTop.appendChild(closeLink);bigErrHolder.appendChild(bigErrTop);bigErrHolder.appendChild(bigErrMiddle);bigErrHolder.appendChild(bigErrEnd);window.document.body.appendChild(bigErrHolder);return bigErrHolder;},clearTextBox:function(box){if(document.getElementById(box))
document.getElementById(box).value="";},submitFormUsingAjax:function(method,url,callback,formName,isMultiPartData){if(isMultiPartData==null||typeof isMultiPartData=='undefined')
{isMultiPartData=false;}
var cObj=GupShup.ajax.sendForm(method,url,callback,formName,isMultiPartData);},getEntityAccessUrl:function(groupName)
{return GupShup.conf.fromUrl+"/groups/"+GupShup.util.trim(groupName);},isNickValid:function(nick1,len)
{var filter1=/^[\w]+$/;var filter2=/^[\d]+$/;var nick=GupShup.util.trim(nick1);var maxNickLen=(typeof(len)=="number")?len:10;if(nick.length<1)
{return{status:false,err:GupShup.html.errorMessages.blankNick,code:'LENGTH'};}
else if(nick.length>maxNickLen)
{return{status:false,err:GupShup.html.errorMessages.invalidNick,code:'LENGTH'};}
else if(!filter1.test(nick)||filter2.test(nick))
{return{status:false,err:GupShup.html.errorMessages.invalidNick,code:'INVALID_CHAR'};}
if(!GupShup.util.isValidContent(nick,restrictedNames)||!GupShup.util.isValidContent(nick,stopWords))
{return{status:false,err:GupShup.html.errorMessages.blockedNick,code:'NOT_ALLOWED'};}
return{status:true};},validatePhoneList:function(content,chkForGrpName){var content=GupShup.util.trim(content);var count=0;var recvList=content.split(',');var index=0;var validPhones=new Array();for(index=0;index<recvList.length;index++)
{var recvr=GupShup.util.trim(recvList[index]);if(recvr.length>0)
{if(chkForGrpName)
{if(GupShup.util.isNumber(recvr)&&!GupShup.util.validatePhoneNumber(recvr))
return{status:'INVALID'};else if(chkForGrpName&&!GupShup.util.isNumber(recvr)&&GupShup.util.isValidGroupName(recvr).code!='VALID')
return{status:'INVALID'};}
else
{if(!GupShup.util.isNumber(recvr)||!GupShup.util.validatePhoneNumber(recvr))
return{status:'INVALID'};}
count++;var validEntry=GupShup.util.isNumber(recvr)?GupShup.util.getValidIndianPhoneNumber(recvr):recvr;for(var i=0;i<validPhones.length;i++)
{if(validPhones[i]==validEntry)
return{status:'DUPLICATE'};}
validPhones.push(validEntry);}}
return{status:'VALID',total:count};},reloadIFrame:function(parentDom,iframeId){var frame=parentDom.getElementById(iframeId);var src=frame.src;var dt=new Date();var params="sid="+dt.getTime();if(src.indexOf("?")>-1)
params="&"+params;else
params="?"+params;frame.src=src+params;},addIFrame:function(parentDom,props){var frame=parentDom.getElementById(props.id);if(frame!=null)
return frame;var isIE=(navigator.appName=="Microsoft Internet Explorer")?true:false;var ifrm=null;if(isIE)
ifrm=parentDom.createElement('<IFRAME frameborder="0" vspace="0" hspace="0" scrolling="no"></IFRAME>');else
{ifrm=parentDom.createElement("IFRAME");ifrm.setAttribute("frameborder","0");ifrm.setAttribute("vspace","0");ifrm.setAttribute("hspace","0");ifrm.setAttribute("border","0");ifrm.setAttribute("scrolling","no");}
ifrm.setAttribute("src",props.src);ifrm.setAttribute("id",props.id);ifrm.setAttribute("name",props.name);if(typeof props.width=="number"&&typeof props.height=="number")
{ifrm.style.width=props.width+"px";ifrm.style.height=props.height+"px";}
if(typeof(props.position)=="string")
{ifrm.style.position=props.position;ifrm.style.left="0px";ifrm.style.top="0px";ifrm.style.zIndex="100";}
parentDom.body.appendChild(ifrm);return ifrm;},moveElementOverIfrmae:function(refEle,targetEleInParent,frameId,parentDom,vPad,hPad){var frame=parentDom.getElementById(frameId);if(frame==null||typeof(frame)=="undefined")
return;var target=parentDom.getElementById(targetEleInParent);if(target==null||typeof(target)=="undefined")
return;var refElePosInIframe=GupShup.html.util.getElementPosition(refEle);hPad+=refElePosInIframe.x;vPad+=refElePosInIframe.y;GupShup.html.util.overlay(frame,target,"left top",vPad,hPad);},isIE:function(){return(navigator.appName=="Microsoft Internet Explorer")?true:false;},caluclateDocDimension:function(doc){if(GupShup.html.util.isIE())
{return{h:doc.body.scrollHeight,w:doc.body.scrollWidth};}
else
{return{h:doc.body.offsetHeight,w:doc.body.offsetWidth};}},autoIframeResize:function(parentDom,frameId,iframeDim){var frame=parentDom.getElementById(frameId);if(frame==null||typeof(frame)=="undefined")
return;var objToResize=(frame.style)?frame.style:frame;objToResize.display="block";var dim=null;if(typeof iframeDim=="undefined")
{if(GupShup.html.util.isIE())
dim=GupShup.html.util.caluclateDocDimension(frame.contentWindow.document);else
dim=GupShup.html.util.caluclateDocDimension(frame.contentDocument);}
else
dim=iframeDim;if(dim.h>0)
{objToResize.display="block";objToResize.height=dim.h+"px";}},popUpIframeResize:function(parentDom,frameId,iframeDim){var frame=parentDom.getElementById(frameId);if(frame==null||typeof(frame)=="undefined")
return;var objToResize=(frame.style)?frame.style:frame;objToResize.display="block";var dim=null;if(typeof iframeDim=="undefined")
{if(GupShup.html.util.isIE())
dim=GupShup.html.util.caluclateDocDimension(frame.contentWindow.document);else
dim=GupShup.html.util.caluclateDocDimension(frame.contentDocument);}
else
dim=iframeDim;objToResize.height=dim.h+"px";objToResize.width=dim.w+"px";},changeParentWindow:function(href){return function(){self.parent.window.location=href;}},changeParentWindowSmartly:function(oldHref,newHref){if(newHref.indexOf("http://")==0)
self.parent.window.location=newHref;else
self.parent.window.location=oldHref;},changeHrefsInIFRAME:function(parentDom,frameId){var frame=parentDom.getElementById(frameId);var innerDoc=(frame.contentDocument)?frame.contentDocument:frame.contentWindow.document;var aArray=innerDoc.getElementsByTagName("A");for(var k=0;k<aArray.length;k++)
{if(aArray[k].target=="_blank"||aArray[k].target=="_BLANK")
continue;var href=aArray[k].href;if(href.indexOf("#")<0&&href.indexOf("javascript")<0)
{if(href.indexOf("$")>-1)
{var key=href.substring(href.indexOf("$"),href.lastIndexOf("$")+1);aArray[k].href="javascript:self.parent.GupShup.html.util.changeParentWindowSmartly('"+href+"','"+key+"');";}
else
{aArray[k].href="#";aArray[k].onclick=GupShup.html.util.changeParentWindow(href);}}}},attachEventToObj:function(obj,event,handler){var isIE=(navigator.appName=="Microsoft Internet Explorer")?true:false;if(isIE)
{if(obj.addEventListener){obj.addEventListener(event,handler,false);}else if(obj.attachEvent){obj.attachEvent("on"+event,handler);}}
else
obj["on"+event]=handler;},getDestinationsForReplies:function(text){var destPattern=/^@(\w+)$/;text=GupShup.util.trim(text);var replyWords=text.split(/[\s!"#$%&'()*+,-./:;<=>?[\]^_`{|}~]/);var noOfGrps=0;var wordWithNoAtPresent=false;for(var k=0;k<replyWords.length;k++)
{var w=GupShup.util.trim(replyWords[k]);if(destPattern.test(w))
noOfGrps++;else if(w.length>0)
wordWithNoAtPresent=true;}
return{count:noOfGrps,isTextPresent:(wordWithNoAtPresent&&(noOfGrps>0))};}}})();GupShup.html.catPage={};GupShup.html.catPage.vars={};GupShup.html.catPage.vars.pageParams={};GupShup.html.catPage.tabHeaderHolder='tabHeader';GupShup.html.catPage.catHeaderHolder='catHeader';GupShup.html.catPage.changeCatHeader=function(newLabel){if(GupShup.util.trim(newLabel).length<1)
newLabel="ALL";document.getElementById(GupShup.html.catPage.catHeaderHolder).innerHTML=newLabel;}
GupShup.html.catPage.changeTabHeader=function(newLabel){document.getElementById(GupShup.html.catPage.tabHeaderHolder).innerHTML=newLabel;}
GupShup.html.catPage.handleActiveTabChange=function(e){var oldTab=e.prevValue;var newTab=e.newValue;GupShup.connectionManager.addTransaction({obj:newTab.dataConnection,type:'TABSWITCH',onAbort:function(){newTab._loading=false;}});if(oldTab==newTab)
return;else
{oldTab.set('content',"");var catName=GupShup.html.catPage.vars.pageParams.catName.replace(" ","_").replace("&","_").toUpperCase();var prevPage=oldTab.gupshupConf.tabType+"_"+catName;var nextPage=newTab.gupshupConf.tabType+"_"+catName;GupShup.html.dynamicBar.update(oldTab.gupshupConf.tabType,newTab.gupshupConf.tabType,'right',GupShup.html.catPage.vars.pageParams,prevPage,nextPage);}
GupShup.html.catPage.changeTabHeader(newTab.get('label'));}
GupShup.html.catPage.processCatTabCustomResponse=function(text,catId){var xhr=new Object();xhr.responseText=text;xhr.argument={tab:GupShup.conf.catTabView.yahooTabView.get('activeTab'),other:catId}
GupShup.callback.processCatTabResponse(xhr);}
GupShup.callback.processCatTabResponse=function(xhr){var tab=xhr.argument.tab;var catPageContent=GupShup.util.getJsonFromResponse(xhr.responseText);if(catPageContent.status=='SUCCESS')
{var ele=new Array();var paginationObj={start:catPageContent.params.start,total:'',returned:catPageContent.entities.length,windowSize:1,listType:"groups"};var reqObj={url:GupShup.conf.contextPath+'/getJsonItems',queryStr:'type='+tab.gupshupConf.tabType+"&catId="+xhr.argument.other,callBack:{success:GupShup.callback.processCatTabResponse,failure:GupShup.callback.processCatTabError,argument:{tab:tab,other:xhr.argument.other}}};switch(tab.gupshupConf.tabType)
{case'CATEGORY_POPULAR':case'CATEGORY_MOST_JOINED':case'CATEGORY_FEATURED':case'CATEGORY_RECENTLY_CREATED':paginationObj.total=catPageContent.totalForPg,paginationObj.windowSize=GupShup.conf.windowSize;break;case'CATEGORY_PICTURE_TIMELINE':case'CATEGORY_TIMELINE':reqObj.queryStr+="&needTotalForPg=false";break;}
var paginationContent=GupShup.util.expandPaginationTemplate(reqObj,paginationObj,tab.gupshupConf.tabType);if(paginationObj.windowSize==1)
ele=catPageContent.entities.slice(0,GupShup.conf.ITEMS_PER_PAGE);else
ele=catPageContent.entities;var content=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('entityMsgTemplate'),GupShup.msgTemplates.entityMsgMap,ele);tab.set('content',content+paginationContent);GupShup.html.catPage.changeCatHeader(catPageContent.category.displayName);}}
GupShup.callback.processCatTabError=function(xhr,tab,args){};var MAX_RECEIVER_LENGTH=15;GupShup.html.share={};GupShup.html.share.vars={eId:-1,eName:''};var sharePhoneReceivers=null;var shareEmailReceivers=null;var emailFrom=null;GupShup.html.share.initCtrl=function(){sharePhoneReceivers=new GupShup.forms.controls({name:'sharePhone_'+GupShup.html.share.vars.eId+'.guestList',limit:-1,toolTip:''});shareEmailReceivers=new GupShup.forms.controls({name:'shareEmail_'+GupShup.html.share.vars.eId+'.guestList',limit:-1,toolTip:''});emailFrom=new GupShup.forms.controls({name:'shareEmail_'+GupShup.html.share.vars.eId+'.emailId',limit:-1,toolTip:''});};GupShup.html.share.map=[{key:'$ENTITY_NAME$',dataMember:'eName'},{key:'$ENTITY_ID$',dataMember:'eId'}];GupShup.html.share.clearInputBoxes=function(){sharePhoneReceivers.set("");shareEmailReceivers.set("");};GupShup.html.share.validateSharePhoneNumbers=function(phoneListControl){var content=phoneListControl.get('value');if(content.length<1)
return'INVALID';var count=0;var recvList=content.split(',');var shareRecvIndex=0;for(shareRecvIndex=0;shareRecvIndex<recvList.length;shareRecvIndex++)
{var recvr=GupShup.util.trim(recvList[shareRecvIndex]);if(recvr.length>0)
{if(!GupShup.util.isNumber(recvr)||!GupShup.util.validatePhoneNumber(recvr))
return'INVALID';count++;if(count>MAX_RECEIVER_LENGTH)
return'LIMITS_REACHED';}}
return'VALID';}
GupShup.html.share.validateShareEmailIds=function(emailListControl){var content=emailListControl.get('value');if(content.length<1)
return'INVALID';var count=0;var recvList=content.split(',');var shareRecvIndex=0;for(shareRecvIndex=0;shareRecvIndex<recvList.length;shareRecvIndex++)
{var recvr=GupShup.util.trim(recvList[shareRecvIndex]);if(recvr.length>0)
{if(!GupShup.util.isValidEmail(recvr))
return'INVALID';count++;if(count>MAX_RECEIVER_LENGTH)
return'LIMITS_REACHED';}}
return'VALID';}
GupShup.html.share.shareWithFriendsBySMS=function()
{var result=GupShup.html.share.validateSharePhoneNumbers(sharePhoneReceivers);switch(result)
{case'VALID':GupShup.html.actions.shareGroup('sharePhone_'+GupShup.html.share.vars.eId);GupShup.html.util.disableBtn('sendEmail_'+GupShup.html.share.vars.eId);GupShup.html.util.disableBtn('sendSMS_'+GupShup.html.share.vars.eId);break;case'INVALID':GupShup.forms.showNotification(GupShup.html.errorMessages.shareInvalidPhones,{failure:true});break;case'LIMITS_REACHED':GupShup.forms.showNotification(GupShup.html.errorMessages.shareLimitReached,{failure:true});break;}}
GupShup.html.share.shareWithFriendsByEmail=function()
{var result=GupShup.html.share.validateShareEmailIds(shareEmailReceivers);switch(result)
{case'VALID':if(GupShup.util.isValidEmail(emailFrom.getValue()))
{GupShup.html.actions.shareGroup('shareEmail_'+GupShup.html.share.vars.eId);GupShup.html.util.disableBtn('sendEmail_'+GupShup.html.share.vars.eId);GupShup.html.util.disableBtn('sendSMS_'+GupShup.html.share.vars.eId);}
else
{GupShup.forms.showNotification(GupShup.html.errorMessages.shareInvalidFromEmail,{failure:true});}
break;case'INVALID':GupShup.forms.showNotification(GupShup.html.errorMessages.shareInvalidEmail,{failure:true});break;case'LIMITS_REACHED':GupShup.forms.showNotification(GupShup.html.errorMessages.shareLimitReached,{failure:true});break;}}
GupShup.callback.shareResponseHandler=function(xhr)
{var status=GupShup.util.getJsonFromResponse(xhr.responseText);switch(status.status)
{case'FAILURE':{if(typeof status.throttledMessage=='string'&&status.throttledMessage.length>0)
GupShup.forms.showNotification(status.throttledMessage,{failure:true});else
GupShup.forms.showNotification(status.message,{failure:true});}
break;case'SUCCESS':{var err=status.errorCode;switch(err)
{case'SUCCESS':case'NO_ERROR':GupShup.forms.showNotification(status.message,{success:true});GupShup.html.share.clearInputBoxes();if(typeof status.entityDetails=='object')
{GupShup.html.share.updateEntityDetails(status);}
break;}}}
GupShup.html.util.enableBtn('sendEmail_'+GupShup.html.share.vars.eId);GupShup.html.util.enableBtn('sendSMS_'+GupShup.html.share.vars.eId);GupShup.html.util.hideElement('share_box');}
GupShup.html.share.init=function(showShareBox,eId,eName){GupShup.conf.shareTabs=new Array();GupShup.conf.shareTabsPos=new Array();var index=0;var html='';GupShup.html.share.hideShareBox();GupShup.html.share.vars.eId=eId;GupShup.html.share.vars.eName=eName;GupShup.html.share.vars.showShareBox=showShareBox;if(!showShareBox)
{GupShup.html.util.setVisibility('shareLinkContainer_'+eId,"hidden",document);return;}
GupShup.conf.shareTabsPos['MOBILE']=index;html=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('sharePhoneTemplate'),GupShup.html.share.map,[GupShup.html.share.vars]);GupShup.conf.shareTabs[index++]={yahooConf:{label:'Mobile',isActive:false,content:html}};GupShup.conf.shareTabsPos['EMAIL']=index;html=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('shareEmailTemplate'),GupShup.html.share.map,[GupShup.html.share.vars]);GupShup.conf.shareTabs[index++]={yahooConf:{label:'Email',isActive:false,content:html}};GupShup.conf.shareTabsPos['PERMALINK']=index;html=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('permaLinkTemplate'),GupShup.html.share.map,[GupShup.html.share.vars]);GupShup.conf.shareTabs[index++]={yahooConf:{label:'Permalink',isActive:false,content:html}};GupShup.conf.shareTabView=null;GupShup.util.setInnerHTML('SHARE_TABS',"");GupShup.conf.shareTabView=GupShup.util.createTabView(GupShup.conf.shareTabs,'SHARE_TABS');GupShup.html.share.initCtrl();return;}
GupShup.html.share.hideShareBox=function(){GupShup.html.util.hideElement('share_box');GupShup.forms.hideNotification();}
GupShup.html.share.showShareTab=function(name,refObj){if(!GupShup.html.share.vars.showShareBox)
return;switch(name){case'MOBILE':GupShup.conf.shareTabView.setActive(GupShup.conf.shareTabsPos[name]);break;case'EMAIL':GupShup.conf.shareTabView.setActive(GupShup.conf.shareTabsPos[name]);break;case'PERMALINK':GupShup.conf.shareTabView.setActive(GupShup.conf.shareTabsPos[name]);break;}
GupShup.html.share.showShareBox(refObj);}
GupShup.html.share.showShareBox=function(refObj)
{GupShup.forms.hideNotification();GupShup.html.util.showElement('share_box',false);if(typeof refObj=="object")
{var obj=document.getElementById('share_box');var left=obj.offsetWidth+10;GupShup.html.util.overlay(refObj,obj,"top left",0,0-left);}
else
GupShup.html.util.showElement('share_box');return false;}
GupShup.html.share.showFaceBookPopUp=function(){var u=GupShup.conf.fromUrl+'/groups/'+GupShup.html.share.vars.eName;var t=GupShup.html.share.vars.eName+"'"+" SMS GupShup";var popup=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;};(function(){GupShup.html.util.tab=function(tabInfo){if((typeof(tabInfo)!='object'))
return;this.id=tabInfo.id;this.cid=tabInfo.cid;this.isActive=tabInfo.isActive;this.enableRefresh=(GupShup.util.isInitialized(tabInfo.enableRefresh)&&tabInfo.enableRefresh);this.style={};if(typeof(tabInfo.style)=='object')
{this.style.activeClass=tabInfo.style.activeClass;this.style.inactiveClass=tabInfo.style.inactiveClass;}
this.handler={};if(typeof(tabInfo.handler)=='object')
{this.handler.beforeTabActivate=tabInfo.handler.beforeTabActivate;this.handler.afterTabActivate=tabInfo.handler.afterTabActivate;this.handler.beforeTabInactivate=tabInfo.handler.beforeTabInactivate;this.handler.afterTabInactivate=tabInfo.handler.afterTabInactivate;this.handler.beforeTabRefresh=tabInfo.handler.beforeTabRefresh;this.handler.afterTabRefresh=tabInfo.handler.afterTabRefresh;this.handler.arg=tabInfo.handler.arg;}
this.props=tabInfo.props;}
GupShup.html.util.tab.prototype.init=function(){if(this.isActive)
{GupShup.html.util.setClass(this.id,this.style.activeClass);GupShup.html.util.showElement(this.cid);}
else
{GupShup.html.util.setClass(this.id,this.style.inactiveClass);GupShup.html.util.hideElement(this.cid);}}
GupShup.html.util.tab.prototype.attachHandler=function(eventName,handler,param){var tabElement=document.getElementById(this.id);switch(eventName)
{case'onclick':tabElement.onclick=function(){handler(param)};break;}}
GupShup.html.util.tab.prototype.setTabActive=function(){if(!this.isActive)
{var thisObj=this;if(typeof(this.handler.beforeTabActivate)=='function')
this.handler.beforeTabActivate(thisObj,this.handler.arg);GupShup.html.util.setClass(this.id,this.style.activeClass);GupShup.html.util.showElement(this.cid);this.isActive=true;if(typeof(this.handler.afterTabActivate)=='function')
this.handler.afterTabActivate(thisObj,this.handler.arg);}}
GupShup.html.util.tab.prototype.setTabInactive=function(){if(this.isActive)
{var thisObj=this;if(typeof(this.handler.beforeTabInactivate)=='function')
this.handler.beforeTabInactivate(thisObj,this.handler.arg);GupShup.html.util.setClass(this.id,this.style.inactiveClass);GupShup.html.util.hideElement(this.cid);this.isActive=false;if(typeof(this.handler.afterTabInactivate)=='function')
this.handler.afterTabInactivate(thisObj,this.handler.arg);}}
GupShup.html.util.tab.prototype.refreshTab=function(){if(this.isActive&&this.enableRefresh)
{var thisObj=this;if(typeof(this.handler.beforeTabRefresh)=='function')
this.handler.beforeTabRefresh(thisObj,this.handler.arg);GupShup.html.util.setClass(this.id,this.style.activeClass);GupShup.html.util.showElement(this.cid);this.isActive=true;if(typeof(this.handler.afterTabRefresh)=='function')
this.handler.afterTabRefresh(thisObj,this.handler.arg);}}
GupShup.html.util.tab.prototype.isTabActive=function(){return this.isActive;}})();(function(){GupShup.html.util.tabView=function(tabInfoArr){this.tabs=new Array();for(var i=0;i<tabInfoArr.length;i++)
{if(document.getElementById(tabInfoArr[i].id)==null)
continue;this.tabs.push(new GupShup.html.util.tab(tabInfoArr[i]));}
this.activeTabIndex=-1;this.isInitialized=false;}
GupShup.html.util.tabView.prototype.init=function(){var tabViewObj=this;for(var i=0;i<this.tabs.length;i++){this.tabs[i].attachHandler('onclick',tabViewObj.activateTab,{'tabView':tabViewObj,'tabIndex':i});this.tabs[i].init();if(this.tabs[i].isTabActive())
this.activeTabIndex=i;}
this.isInitialized=true;};GupShup.html.util.tabView.prototype.activateTab=function(params){var tabViewObj=params.tabView;var tabIndex=params.tabIndex;var activeTabIndex=tabViewObj.activeTabIndex;if(tabIndex==activeTabIndex)
{tabViewObj.tabs[tabIndex].refreshTab();}
else
{if(activeTabIndex>=0)
tabViewObj.tabs[activeTabIndex].setTabInactive();tabViewObj.activeTabIndex=tabIndex;tabViewObj.tabs[tabIndex].setTabActive();}};GupShup.html.util.tabView.prototype.closeActiveTab=function(params){var tabViewObj=params.tabView;var activeTabIndex=tabViewObj.activeTabIndex;if(activeTabIndex>=0)
{tabViewObj.tabs[activeTabIndex].setTabInactive();tabViewObj.activeTabIndex=-1;}};GupShup.html.util.tabView.prototype.getActiveTab=function(params){var tabViewObj=params.tabView;var activeTabIndex=tabViewObj.activeTabIndex;return(activeTabIndex>=0)?tabViewObj.tabs[activeTabIndex]:null;};})();GupShup.html.cookies=GupShup.html.cookies||{get:function(cookieName){if(GupShup.util.isInitialized(cookieName))
return jaaulde.utils.cookies.get(cookieName);else
return jaaulde.utils.cookies.get();},set:function(cookieName,value,options){jaaulde.utils.cookies.set(cookieName,value,options);},del:function(cookieName){jaaulde.utils.cookies.del(cookieName);},update:function(cookieName,newValue,newOptions){GupShup.html.cookies.del(cookieName);GupShup.html.cookies.set(cookieName,newValue,newOptions);}};function showToolTip(refName,msg)
{var tipBox=GupShup.html.util.createToolTipElement();tipBox.style.width="350px";var refEle=document.getElementById(refName);GupShup.html.util.overlay(refEle,tipBox,"right",0,10);var closeBox='<p style="margin:0px;padding:0px" align="right"><a href="#" onclick="GupShup.html.util.destroyElement(\'toolTip\');return false;">[x]</a></P>';tipBox.innerHTML=closeBox+msg;GupShup.html.util.adjustPopupTop(tipBox,false,10);}
function hideToolTip()
{document.getElementById("tipBox").style.display="none";}
var toolTipList=new Array();toolTipList[1]='<b class="big">GREETING</b> - Set a description for your group. \
     <p>Format: GREETING followed by the new welcome message.</p> \
     <p>Example: <b class="example"> \
     GREETING Hi this is Ria. This group is for foodies who want to taste all that Bombay has to offer.</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[2]='<b class="big">PUBLIC / PRIVATE</b> - Privacy settings. \
     <p><b class="big">PRIVATE</b> - Hide your group on the web and circulate messages to only those users whom you have invited to the group.</p> \
     <p>Example: <b class="example"> PRIVATE </b></p> \
     <p><b class="big">PUBLIC</b> - Let everyone view, join and receive messages that you send to the group. (This is the default setting)</p>\
     <p>Example: <b class="example"> PUBLIC</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[3]='<b class="big">BLOCK / UNBLOCK</b> - Subscription settings. \
     <p><b class="big">BLOCK</b> - Unsubscribe a member from your group and unsubscribe from his or her group.</p> \
     <p>Format: BLOCK groupname or BLOCK phone-no.</p>\
     <p>Example: <b class="example">  BLOCK 9876543210 or BLOCK djbox </b>\
     <p><b class="big">UNBLOCK</b> - Undo the BLOCK command. </p> \
     <p>Format: UNBLOCK groupname or UNBLOCK phone-no.</p>\
     <p>Example: <b class="example"> UNBLOCK 9876543210 or UNBLOCK djbox </b>\
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[4]='<b class="big">SHARE</b> - Recommend a group you like to your friends\
     <p>Format: SHARE group-to-recommend  friend\'s-phone-number</p> \
     <p>Example: <b class="example"> SHARE djbox 9876543210</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/> \
     (To invite more than one friend, separate multiple phone numbers by spaces.)</p>';toolTipList[5]='<b class="big">MSG</b> - Send a personal message to a GupShup group owner\
     <p>Format: MSG group-name-to-buzz  your-message</p> \
     <p>Example: <b class="example"> MSG djbox Hi Ria, I love ur GupShup. the last message was really nice.</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[6]='<b class="big">MUTE</b> - Temporarily stop receiving messages from a group.\
     <p>Format: MUTE group-name duration</p>\
     <p>Example: <b class="example">  MUTE djbox 6h </b>\
     <p>Send to: <b>'+GupShup.conf.reqNumber+'</b> <br/> \
     (Duration can be indicated in hours or days. For example 6h would mean 6 hours and 2d would mean 2 days. \
     If you do not enter group name or duration you won\'t receive messages from GupShup for 6 hours.) </p>';toolTipList[7]='<b class="big">UNMUTE</b> - Undo the MUTE command.\
     <p>Example: <b class="example"> UNMUTE </b>\
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[8]='<b class="big">HELP CREATE</b> - Get help for creating a group.\
     <p>Example: <b class="example"> HELP CREATE</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[9]='<b class="big">HELP INVITE</b> - Get help for inviting friends to your group.\
     <p>Example: <b class="example"> HELP INVITE</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[10]='<b class="big">HELP JOIN</b> - Get help for joining a group.\
     <p>Example: <b class="example"> HELP JOIN</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[11]='<b class="big">HELP LEAVE</b> - Get help to unsubscribe from a group.\
     <p>Example: <b class="example"> HELP LEAVE</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[12]='<b class="big">POLL</b> - Take a poll from members of your group.\
     <p>Format: POLL Question *choice1 *choice2 *choice3 </p> \
     <p>Example: <b class="example"> POLL Best all time band? *Doors *Pink Floyd *Deep Purple *Led Zepp</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     (Each option should be preceded by an asterisk.)</p> \
     <p> More lingo for Polls:<br/> \
     To list all open polls: <b class="example">LIST POLL</b><br/> \
     To close a poll: <b class="example">CLOSE poll-name</b><br/> \
     To get Poll status: <b class="example">STATUS poll-name</b><br/> \
     To get poll details: <b class="example">WHAT poll-name</b><br/> \
     (Poll names are sent by us after you create a poll. Polls automatically close at the end of the day.)\
      </p>';toolTipList[13]='<b class="big">QUIZ</b> - Riddle your friends with a quiz.\
     <p>Format: QUIZ Question *answer-choice1 *answer-choice2 *answer-choice3</p> \
     <p>Example: <b class="example"> QUIZ Who is Calvin\'s baby sitter? *Ann #Roselyn *Lucy *Luann</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     (Correct answer should be preceded by a hash # and wrong answers by an asterisk.)</p> \
     <p> More lingo for Quizzes:<br/> \
     To list all open quizzes:<b class="example"> LIST QUIZ</b><br/> \
     To close a quiz: <b class="example">CLOSE quiz-name</b><br/> \
     To get quiz status: <b class="example">STATUS quiz-name</b><br/> \
     To get quiz details: <b class="example">WHAT quiz-name</b><br/> \
     (Quiz names are sent by us after you create a quiz. Quizes automatically close at the end of the day.) \
     </p>';toolTipList[14]='<b class="big">RATING</b> - Get ratings for books, movies, or anything else.\
     <p>Format: RATING question </p> \
     <p>Example: <b class="example"> RATING Rate the movie Dhoom 2</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     </p> \
     <p> More lingo for Ratings:<br/> \
     To list all open ratings: <b class="example">LIST RATING</b><br/> \
     To close a rating: <b class="example">CLOSE rating-name</b><br/> \
     To get rating status: <b class="example">STATUS rating-name</b><br/> \
     To get rating details: <b class="example">WHAT rating-name</b><br/> \
     (Rating names are sent by us after you create a rating. Ratings automatically close at the end of the day.) \
     </p>';toolTipList[15]='<b class="big">REMOVE</b> - Remove a user subscription from your group.\
     <p>Format: REMOVE phone-no </p> \
     <p>Example: <b class="example"> REMOVE 9876543210</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     </p>';toolTipList[16]='<b class="big">DND</b> - Do Not Disturb, Temporarily stop receiving messages from GupShup.\
     <p>Example: <b class="example"> DND</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     </p> \
     <p>(The do not disturb command will prevent you receiving messages on your mobile phone. This command is undone when you send a message to your group, join a group, or invite members to your group.)\
     </p>';toolTipList[17]='<b class="big">DND OFF</b> - Undo the DND command.\
     <p>Example: <b class="example"> DND OFF</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     </p>';toolTipList[18]='<b class="big">RENAME</b> - Change the name of your group.\
     <p>Format: RENAME by the new group name. </p> \
     <p>Example: <b class="example"> RENAME mynewgroup</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     </p>';toolTipList[19]='<b class="big">HELP PIC</b> - Get help for sending pictures.\
     <p>Example: <b class="example"> HELP PIC</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\
     </p>';toolTipList[20]='<b class="big">GETPIC</b> - Request an SMS picture on your phone.\
     <p>Format: GETPIC code</p> \
     <p>Example: <b class="example"> GETPIC PI2</b></p> \
     <p>Where: <b>PIC2</b> is the code of the pic.</p>\
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>\
     <p>Some pictures & Codes:</p>\
     <table width="100%"> \
     <tr align="center"> \
     <td><img src="'+GupShup.conf.dynamicImageUrl+'/picimages/WEB2.png" /><br/><b>PI2</b></td> \
     <td><img src="'+GupShup.conf.dynamicImageUrl+'/picimages/WEB3.png" /><br/><b>PI3</b></td> \
     <td><img src="'+GupShup.conf.dynamicImageUrl+'/picimages/WEB4.png" /><br/><b>PI4</b></td></tr> \
     <tr align="center"> \
     <td><img src="'+GupShup.conf.dynamicImageUrl+'/picimages/WEB5.png" /><br/><b>PI5</b></td>\
     <td><img src="'+GupShup.conf.dynamicImageUrl+'/picimages/WEB6.png" /><br/><b>PI6</b></td>\
     <td><img src="'+GupShup.conf.dynamicImageUrl+'/picimages/WEB7.png" /><br/><b>PI7</b></td></tr>\
     </table>';toolTipList[21]='<b class="big">SENDPIC</b> - Send an SMS picture to your friend or group.\
     <p>Format: SENDPIC &lt;code&gt; &lt;phone no./group name&gt; &lt;text&gt;</p> \
     <p>Example: <b class="example"> SENDPIC &lt;code&gt; &lt;phone no./group name&gt; &lt;text&gt;</b></p> \
     <p>(Note: The text part is optional and you can avoid it, if you type a text message, we recommend you keep it short.)</p>\
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[22]='<b class="big">SWITCH</b> - Change default group to new group which can be posted to from mobile phone, using SMS\
     <p>Format: SWITCH newgroupname.</p> \
     <p>Example: <b class="example"> \
     SWITCH djbox.</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b></p>';toolTipList[23]='<b class="big">LIMIT</b> - Allows user to inform SMS GupShup that they wish to receive more SMS messages after they hit the limit of allowed incoming messages\
     <p>Format: LIMIT</p> \
     <p>Example: <b class="example">LIMIT</b></p> \
     <p>Send message to: <b>'+GupShup.conf.reqNumber+'</b><br/>\</p>';(function(){GupShup.html.importContactsPage=GupShup.html.importContactsPage||{emailControl:null,passwordControl:null,domainControl:null,submitImLogin:function()
{var pwd=this.passwordControl.get('value');var email=this.emailControl.get('value');var domain=this.domainControl.get('value');if(domain=="0")
{this.domainControl.showNotification(GupShup.html.errorMessages.invalidDomain,{failure:true,position:'right'});return false;}
if(email.length<1)
{this.emailControl.showNotification(GupShup.html.errorMessages.invalidEmail,{failure:true,position:'right'});return false;}
email=email+'@'+domain;if(!GupShup.util.isValidEmail(email))
{this.emailControl.showNotification(GupShup.html.errorMessages.invalidEmail,{failure:true,position:'right'});return false;}
if(pwd.length<1)
{this.passwordControl.showNotification(GupShup.html.errorMessages.invalidPassword,{failure:true,position:'right'});return false}
document.importForm.emailId.value=email;document.importForm.submit();},selectAll:function()
{if(document.getElementById("Allfriends").checked==true)
{for(i=0;i<contactsSize;i++)
{document.getElementById("friend"+i).checked=true;}}
else
{for(i=0;i<contactsSize;i++)
{document.getElementById("friend"+i).checked=false;}}},inviteFriends:function()
{var val="";if(document.getElementById("Allfriends").checked==true)
{for(i=0;i<contactsSize;i++)
{if(val.length>0)
val+=", ";val+=document.getElementById("friend"+i).value;}}
else
{for(i=0;i<contactsSize;i++)
{if(document.getElementById("friend"+i).checked==true)
{if(val.length>0)
val+=", ";val+=document.getElementById("friend"+i).value;}}}
if(val.indexOf('@')<0)
{GupShup.forms.showNotification(GupShup.html.errorMessages.importSelectFreiend,{failure:true});return false;}
GupShup.html.util.disableBtn('importInviteBtn');var currList=opener.document.forms["inviteForm"].emailGuest.value;if((currList==null)||(GupShup.util.trim(currList).length==0))
opener.document.forms["inviteForm"].emailGuest.value=val;else
opener.document.forms["inviteForm"].emailGuest.value=currList+", "+val;self.close();return false;},initPage:function(){this.emailControl=new GupShup.forms.controls({name:'importForm.email',toolTip:''});this.passwordControl=new GupShup.forms.controls({name:'importForm.passwd',toolTip:''});this.domainControl=new GupShup.forms.controls({name:'importForm.domain',toolTip:''});}}})();(function(){GupShup.html.signupPageRaj=GupShup.html.signupPageRaj||{nameControl:null,phoneControl:null,locationControl:null,pictureControl:null,dobControl:null,captchaControl:null,countryCodeControl:null,blankPicture:"Please upload a picture.",successNotify:"Your entry has been accepted. You will be informed about the results.",nameNotify:"Please enter your name",invalidImage:"Image must be in JPG or GIF format and smaller than 5MB.",register:function(){GupShup.html.util.disableBtn('cancelBtnId');GupShup.html.util.disableBtn('signupId');if(this.validateSignupForm())
{document.signupForm.submit();}
else
{GupShup.html.util.enableBtn('cancelBtnId');GupShup.html.util.enableBtn('signupId');}},enableSignup:function(){if(document.getElementById('termsId').checked)
GupShup.html.util.enableBtn("signupId");else
GupShup.html.util.disableBtn("signupId");},validateSignupForm:function(){var name=this.nameControl.getValue();var phn=this.phoneControl.getValue();var location=this.locationControl.getValue();var picture=this.pictureControl.getValue();var dob=this.dobControl.getValue();var cap=this.captchaControl.getValue();var code=this.countryCodeControl.getValue();if(name.length<1)
{this.nameControl.showNotification(this.nameNotify,{failure:true,position:'right'});return false;}
if(phn.length<1)
{this.phoneControl.showNotification(GupShup.html.errorMessages.blankPhone,{failure:true,position:'right'});return false;}
var err=false;if(code!="91")
{if(!GupShup.util.validatePhoneNumber(phn,true))
err=true;}
else
{if(!GupShup.util.validatePhoneNumber(phn,false))
err=true;}
if(err)
{this.phoneControl.showNotification(GupShup.html.errorMessages.invalidPhone,{failure:true,position:'right'});return false;}
if(location.length<1)
{this.locationControl.showNotification(GupShup.html.errorMessages.blankLocation,{failure:true,position:'right'});return false;}
if((picture.length>0)&&GupShup.util.isValidImage(picture))
{document.signupForm.pictureExt.value=GupShup.util.getFileExtension(picture);}
else
{this.pictureControl.showNotification(this.invalidImage,{failure:true,position:'right'});return false;}
if(document.getElementById('dayId').value=="DD"&&document.getElementById('monthId').value=="MM"&&document.getElementById('yearId').value=="YYYY")
{this.dobControl.showNotification(GupShup.html.errorMessages.blankDOB,{failure:true,position:'right'});return false;}
else
{if(GupShup.util.checkDate('dayId','monthId','yearId'))
{document.signupForm.month.value=parseInt(document.getElementById('monthId').value)+1;}
else
{this.dobControl.showNotification(GupShup.html.errorMessages.invalidDOB,{failure:true,position:'right'});return false;}}
if(cap==""||cap.length<6)
{this.captchaControl.showNotification(GupShup.html.errorMessages.blankCaptcha,{failure:true,position:'right'});return false;}
return true;},initPage:function(){this.nameControl=new GupShup.forms.controls({name:'signupForm.username',toolTip:'',limit:50});this.nameControl.init();this.phoneControl=new GupShup.forms.controls({name:'signupForm.phone',toolTip:'',limit:18});this.phoneControl.init();this.locationControl=new GupShup.forms.controls({name:'signupForm.location',toolTip:'',limit:18});this.locationControl.init();this.pictureControl=new GupShup.forms.controls({name:'signupForm.picture',toolTip:'',limit:50});this.pictureControl.init();this.dobControl=new GupShup.forms.controls({id:'yearId',toolTip:''});this.dobControl.init();this.captchaControl=new GupShup.forms.controls({name:'signupForm.captcha',limit:6});this.captchaControl.init();this.countryCodeControl=new GupShup.forms.controls({name:'signupForm.countryCode'});this.countryCodeControl.init();},setUpCalender:function()
{var container=GupShup.html.signupPageRaj.dateContainer;var calObj=new YAHOO.widget.Calendar(container);calObj.cfg.setProperty('close',true);GupShup.html.signupPageRaj.calender=calObj;calObj.selectEvent.subscribe(GupShup.html.signupPageRaj.dobChange);},showCalender:function(){GupShup.html.util.showElement(GupShup.html.signupPageRaj.dateContainer);},hideCalender:function(){GupShup.html.util.hideElement(GupShup.html.signupPageRaj.dateContainer);},dobChange:function()
{var selCalDate=GupShup.html.signupPageRaj.calender.getSelectedDates()[0];var dateStr=(selCalDate.getMonth()+1)+"/"+selCalDate.getDate()+"/"+selCalDate.getFullYear();GupShup.html.signupPageRaj.dobControl.value=dateStr;GupShup.html.signupPageRaj.hideCalender();},reloadCapcha:function()
{var dt=new Date();var tableCell=document.getElementById('capchaImageId');var captchaImgElementsArr=tableCell.getElementsByTagName('img');captchaImgElementsArr[0].src=GupShup.conf.contextPath+"/captcha?capReqType=0&sId="+dt.getMilliseconds();}}})();GupShup.html.indexPage={};GupShup.html.indexPage.tabHeaderHolder='tabHeader';GupShup.html.indexPage.changeTabHeader=function(newLabel){document.getElementById(GupShup.html.indexPage.tabHeaderHolder).innerHTML=newLabel;}
GupShup.html.indexPage.handleActiveTabChange=function(e){var oldTab=e.prevValue;var newTab=e.newValue;GupShup.connectionManager.addTransaction({obj:newTab.dataConnection,type:'TABSWITCH',onAbort:function(){newTab._loading=false;}});if(oldTab==newTab)
return;else
{oldTab.set('content',"");GupShup.html.dynamicBar.update(oldTab.gupshupConf.tabType,newTab.gupshupConf.tabType,'right');}
GupShup.html.indexPage.changeTabHeader(newTab.get('label'));}
GupShup.html.indexPage.processIndexTabCustomResponse=function(text){var xhr=new Object();xhr.responseText=text;xhr.argument={tab:GupShup.conf.indexTabView.yahooTabView.get('activeTab')}
GupShup.callback.processIndexTabResponse(xhr);}
GupShup.callback.processIndexTabResponse=function(xhr){var tab=xhr.argument.tab;var indexPageContent=GupShup.util.getJsonFromResponse(xhr.responseText);if(indexPageContent.status=='SUCCESS')
{var ele=new Array();var paginationObj={start:indexPageContent.params.start,total:'',returned:indexPageContent.entities.length,windowSize:1};var reqObj={url:GupShup.conf.readUrl,queryStr:'type='+tab.gupshupConf.tabType,callBack:{success:GupShup.callback.processIndexTabResponse,failure:GupShup.callback.processIndexTabError,argument:{tab:tab}}};switch(tab.gupshupConf.tabType)
{case'GLOBAL_POPULAR':case'GLOBAL_MOST_JOINED':case'GLOBAL_FEATURED':case'GLOBAL_RECENTLY_CREATED':paginationObj.total=indexPageContent.totalForPg,paginationObj.windowSize=GupShup.conf.windowSize;break;case'GLOBAL_PICTURE_TIMELINE':case'GLOBAL_TIMELINE':reqObj.queryStr+="&needTotalForPg=false";break;}
var paginationContent=GupShup.util.expandPaginationTemplate(reqObj,paginationObj,tab.gupshupConf.tabType);if(paginationObj.windowSize==1)
ele=indexPageContent.entities.slice(0,GupShup.conf.ITEMS_PER_PAGE);else
ele=indexPageContent.entities;var content=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('entityMsgTemplate'),GupShup.msgTemplates.entityMsgMap,ele);tab.set('content',content+paginationContent);}};GupShup.callback.processIndexTabError=function(xhr,tab,args){};(function(){GupShup.html.premiumPlan={};GupShup.html.premiumPlan.vars={entityId:-1,type:'PREMIUM_ENTITY_PLAN',planContainer:'premiumPlanPopUp',premiumJoinContainer:'premiumJoinPopUp',planCostContainer:'premiumPlanCosts_',premiumJoinStatus:null};GupShup.html.premiumPlan.methods={getButtonName:function(allowTrial,details){if(details.hasLeft==true)
return"Pay & Join";else if(allowTrial==true)
return"Get Trial";else
return"Pay & Join";},getHeader:function(allowTrial,details){if(allowTrial==true||details.hasLeft==true)
return"Join";else
return"Renew";},onSuccess:function(xhr){var planDetails=GupShup.util.getJsonFromResponse(xhr.responseText);if(planDetails.status=="SUCCESS")
{planDetails.argument=xhr.argument;if(planDetails.errorCode=="NO_ERROR"&&planDetails.entityPlan.length>0)
GupShup.html.premiumPlan.methods.showPlanPopUp(planDetails);else
GupShup.forms.showNotification(planDetails.message,{failure:true});}
else
GupShup.forms.showNotification(planDetails.message,{failure:true});},closePlanPopUp:function(){GupShup.html.util.hideElement(GupShup.html.premiumPlan.vars.planContainer);},getTemplate:function(id){var retStr='<tr>'+document.getElementById(id).rows[0].innerHTML+'</tr>';return retStr;},showPlanPopUp:function(planDetails){var plans=planDetails.entityPlan;var entity=planDetails.entityDetails;var argument=planDetails.argument;var planDetailsHtml=GupShup.util.expandTemplate(GupShup.html.premiumPlan.methods.getTemplate('premiumPlanTemplate'),GupShup.html.premiumPlan.maps.premiumPlanTemplate,plans);var html='<table><tbody>'+planDetailsHtml+'</tbody></table>';var container=GupShup.html.util.createElement('DIV',GupShup.html.premiumPlan.vars.planContainer);GupShup.html.util.setClass(container,"absPopUp");var dataObj=[{planInfo:html,name:entity.name,entityId:entity.id,allowTrial:argument.allowTrial,hasLeft:argument.hasLeft}];GupShup.util.expandTemplateInDiv(GupShup.html.premiumPlan.vars.planContainer,'premiumPlanSelectionTemplate',GupShup.html.premiumPlan.maps.premiumPlanSelectionTemplate,dataObj);GupShup.html.util.overlay(document.getElementById('renew_'+entity.id),container,"top right",0,0);},onFailure:function(o){},getPremiumPlan:function(entity_Id,allow_Trial,has_Left){var getTrial=false;GupShup.forms.hideNotification();if(typeof allow_Trial=="boolean")
getTrial=allow_Trial;var queryUrl=GupShup.conf.readUrl+"&type="+GupShup.html.premiumPlan.vars.type+"&entityId="+entity_Id+"&needTotalForPg=false";var callBack={success:GupShup.html.premiumPlan.methods.onSuccess,failure:GupShup.html.premiumPlan.methods.onFailure,argument:{entityId:entity_Id,allowTrial:getTrial,hasLeft:has_Left}};GupShup.html.premiumPlan.vars.entityId=entity_Id;GupShup.ajax.send('POST',queryUrl,callBack,'USER_INTIATED_READ');},checkUserAccountBalance:function(allowTrial,hasLeft){if(allowTrial&&(hasLeft!=true))
{var renewForm='renewSubscriptionOf_'+GupShup.html.premiumPlan.vars.entityId;GupShup.html.premiumPlan.methods.selectPremiumPlan();GupShup.html.actions.requestSubscription(renewForm);return;}
var callBack={success:GupShup.html.premiumPlan.methods.renewUserPremiumSubscription,failure:GupShup.html.premiumPlan.methods.onFailure};GupShup.html.actions.requestAccountBalance(callBack);},selectPremiumPlan:function(){var plansForm=GupShup.html.premiumPlan.vars.planCostContainer+GupShup.html.premiumPlan.vars.entityId;var renewForm='renewSubscriptionOf_'+GupShup.html.premiumPlan.vars.entityId;var joinCost=-1;var joinCostArr=document.forms[plansForm].planId;var selectedPlan=-1;for(var i=0;i<joinCostArr.length;i++)
if(joinCostArr[i].checked)
selectedPlan=joinCostArr[i].value;if(selectedPlan==-1)
{selectedPlan=joinCostArr.value;}
var costHolderName="cost_"+selectedPlan;var planFormEle=document.forms[plansForm];joinCost=planFormEle[costHolderName].value;document.forms[renewForm].plan.value=selectedPlan;document.forms[renewForm].isRenew.value="true";return joinCost;},renewUserPremiumSubscription:function(xhr){var acctDetails=GupShup.util.getJsonFromResponse(xhr.responseText);var renewForm='renewSubscriptionOf_'+GupShup.html.premiumPlan.vars.entityId;var joinCost=GupShup.html.premiumPlan.methods.selectPremiumPlan();if(acctDetails.status=="SUCCESS")
{if(acctDetails.errorCode=="NO_ERROR")
{var bal=acctDetails.info[0].actualBalance;if(parseFloat(bal)>=parseFloat(joinCost))
{GupShup.html.actions.renewSubscription(renewForm);GupShup.html.premiumPlan.methods.closePlanPopUp();}
else
{if(joinCost<GupShup.conf.minimumPay)
joinCost=GupShup.conf.minimumPay;GupShup.html.actions.forwardToPaymentSystem(joinCost,GupShup.conf.phoneNumber,GupShup.conf.fromUrl+"/manageSubscriptions");}}
else
{if(acctDetails.errorCode=="INVALID_PARAM")
GupShup.forms.showNotification(GupShup.html.errorMessages.sessionExpired,{failure:true});else
GupShup.forms.showNotification(GupShup.html.errorMessages.paySysDownError,{failure:true});}}
else
{if(acctDetails.errorCode=="INVALID_PARAM")
GupShup.forms.showNotification(GupShup.html.errorMessages.sessionExpired,{failure:true});else
GupShup.forms.showNotification(GupShup.html.errorMessages.paySysDownError,{failure:true});}},defaultPlanDataGenerator:function(plan){if(plan.isDefault)
return[{isDefault:"checked"}];else
return[{}];},premiumGroupStatusStringGenerator:function(status){if(status=="TRIAL"||status=="NOTIFICATION")
return"Trial";else if(status=="BLOCKED"||status=="DEFAULTER")
return"Inactive";else return"Active";},premiumGroupStatusTemplateGenerator:function(subDetails){if(typeof subDetails.premiumSubscriptionDetails=="undefined")
return 2;else if(subDetails.isPremium&&subDetails.premiumSubscriptionDetails.tobeRenewed)
return 0;else if(subDetails.isPremium&&!subDetails.premiumSubscriptionDetails.tobeRenewed)
return 1;else
return 2;},processSubscribeResp:function(xhr){GupShup.html.premiumPlan.vars.premiumJoinStatus=null;var status=GupShup.util.getJsonFromResponse(xhr.responseText);switch(status.status)
{case'SUCCESS':{switch(status.errorCode)
{case'SUCCESS':case'NO_ERROR':case'TRIAL':case'JOIN':GupShup.html.premiumPlan.vars.premiumJoinStatus=status;GupShup.html.premiumPlan.methods.showPremiumJoinPopUp();break;}}
break;case'FAILURE':{GupShup.forms.showNotification(status.message,{failure:true});}}},closePremiumJoinPopUp:function(){GupShup.html.util.hideElement(GupShup.html.premiumPlan.vars.premiumJoinContainer);var status=GupShup.html.premiumPlan.vars.premiumJoinStatus;GupShup.util.postData(GupShup.conf.contextPath+'/subscribedGroupMessages?entityName='+status.entityDetails.orgName,'status','joined','message',status.message);},showPremiumJoinPopUp:function(){var status=GupShup.html.premiumPlan.vars.premiumJoinStatus;var container=GupShup.html.util.createElement('DIV',GupShup.html.premiumPlan.vars.premiumJoinContainer);GupShup.html.util.setClass(container,"absPopUp");var dataObj=[{entityDetails:status.entityDetails,accountDetails:status.params.accountDetails}];GupShup.util.expandTemplateInDiv(GupShup.html.premiumPlan.vars.premiumJoinContainer,'premiumJoinedTemplate',GupShup.html.premiumPlan.maps.greetingSentTemplateMap,dataObj);GupShup.html.util.alignBoxAtCenter(GupShup.html.premiumPlan.vars.premiumJoinContainer);}};GupShup.html.premiumPlan.maps={};GupShup.html.premiumPlan.maps.manageSubscriptionActiveMap=[{key:'$ENTITY_ID$',dataMember:'id'},{key:'$STATUS$',dataMember:'premiumSubscriptionDetails.status',dataProcessor:GupShup.html.premiumPlan.methods.premiumGroupStatusStringGenerator}];GupShup.html.premiumPlan.maps.defaultPlanTemplate=[{key:'$ISDEFAULT$',dataMember:'isDefault'}];GupShup.html.premiumPlan.maps.premiumPlanTemplate=[{key:'$ENTITY_ID$',dataMember:'entityId'},{key:'$DAYS$',dataMember:'billingPeriod'},{key:'$PLAN_ID$',dataMember:'id'},{key:'$COST$',dataMember:'cost'},{key:'$selected$',templateMember:{tmplDivId:'defaultPlanTemplate',tmplMap:GupShup.html.premiumPlan.maps.defaultPlanTemplate,templateDataGenerator:GupShup.html.premiumPlan.methods.defaultPlanDataGenerator}}];GupShup.html.premiumPlan.maps.premiumPlanSelectionTemplate=[{key:'$ENTITY_ID$',dataMember:'entityId'},{key:'$PREMIUM_PLAN_INFO$',dataMember:'planInfo'},{key:'$TYPE$',dataMember:'allowTrial',dataProcessor:GupShup.html.premiumPlan.methods.getHeader},{key:'$ENTITY_NAME$',dataMember:'name'},{key:'$ALLOW_TRIAL$',dataMember:'allowTrial'},{key:'$HAS_LEFT$',dataMember:'hasLeft'},{key:'$BUTTON_NAME$',dataMember:'allowTrial',dataProcessor:GupShup.html.premiumPlan.methods.getButtonName}];GupShup.html.premiumPlan.maps.greetingSentTemplateMap=[{key:'$ENTITY_NAME$',dataMember:'entityDetails.name'},{key:'$BALANCE$',dataMember:'accountDetails.actualBalanceFormatted'}];})();(function(){GupShup.html.mySubscribers={};var formName='invited-subscribers';var subChkBoxName='subscriberId';var allSubChkBoxName='allSubSelect';var startHolder=null;var subTypeHolder=null;GupShup.html.mySubscribers.processMySubscribersCustomResp=function(text){var xhr=new Object();xhr.responseText=text;xhr.argument={tab:GupShup.html.subTabView.yahooTabView.get('activeTab')}
GupShup.callback.processMySubscribers(xhr);}
GupShup.html.mySubscribers.changeTabHeader=function(newLabel){}
GupShup.html.mySubscribers.init=function(){startHolder=new GupShup.forms.controls({name:'invited-subscribers.start'});subTypeHolder=new GupShup.forms.controls({name:'invited-subscribers.subscriberType'});};GupShup.html.mySubscribers.handleActiveTabChange=function(e){var oldTab=e.prevValue;var newTab=e.newValue;if(oldTab==newTab)
return;else
oldTab.set('content',"");GupShup.html.mySubscribers.changeTabHeader(newTab.get('label'));subTypeHolder.set(newTab.gupshupConf.tabType);}
GupShup.html.mySubscribers.unSelectAllBtn=function(ele){if(ele.checked==false)
document.getElementsByName(allSubChkBoxName)[0].checked=false;}
GupShup.html.mySubscribers.selectSubs=function(ele){GupShup.html.mySubscribers.unSelectSubs();var subList=document.getElementsByName(subChkBoxName);if(ele.checked==true)
{for(var i=0;i<subList.length;i++)
subList[i].checked=true;}}
GupShup.html.mySubscribers.unSelectSubs=function(){var subList=document.getElementsByName(subChkBoxName);for(var i=0;i<subList.length;i++)
subList[i].checked=false;}
GupShup.html.mySubscribers.deleteSubs=function(subId){var subList=document.getElementsByName(subChkBoxName);var sendReq=false;if(subId==-1)
{for(var i=0;i<subList.length;i++)
if(subList[i].checked==true)
sendReq=true;}
else
{GupShup.html.mySubscribers.unSelectSubs();for(var i=0;i<subList.length;i++)
if(subList[i].value==subId)
{subList[i].checked=true;sendReq=true;}}
if(sendReq==true)
GupShup.html.actions.removeSubscribers(formName);else
GupShup.forms.showNotification(GupShup.html.errorMessages.noSubsriberSelected,{failure:true});}
GupShup.callback.processMySubscribers=function(xhr){var mySubContent=GupShup.util.getJsonFromResponse(xhr.responseText);var tab=GupShup.html.subTabView.yahooTabView.get('activeTab');if(mySubContent.status=="SUCCESS")
{if(mySubContent.errorCode=="SUBSCRIBER")
GupShup.forms.showNotification(mySubContent.message,{success:true});var entity=mySubContent.entityDetails;GupShup.contactsTemplates.vars.isPremium=entity.isPremium;GupShup.contactsTemplates.vars.isOptinTab=(mySubContent.params.subType=="OPTIN");var noRemoveAction=(GupShup.contactsTemplates.vars.isOptinTab||GupShup.contactsTemplates.vars.isPremium);GupShup.util.expandTemplateInDiv('group-desc','myGroupDescTemplate',GupShup.templates.myGroupDescMap,[entity]);var headContent="";var paginationContent="";var subContent="";var tableHead="";if(mySubContent.subscribers.length<1)
{headContent=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('myEmptySubDetailsHeadTemplate'),GupShup.contactsTemplates.mySubDetailsHeadTemplateMap,[mySubContent]);GupShup.util.setInnerHTML('headContent',headContent+"<br/>");GupShup.util.setInnerHTML('paginationContent',"");tab.set('content',"");if(mySubContent.params.subType=="INVITED_OPTIN")
GupShup.html.util.hideElement('SUB_TYPE_TABS');return;}
else
{headContent=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('mySubDetailsHeadTemplate'),GupShup.contactsTemplates.mySubDetailsHeadTemplateMap,[mySubContent]);var ele=new Array();var paginationObj={start:mySubContent.params.start,total:mySubContent.totalForPg,returned:mySubContent.subscribers.length,windowSize:GupShup.conf.windowSize,listType:"subscribers"};var reqObj={url:GupShup.conf.readUrl,queryStr:"type=MY_SUBSCRIBERS&entityId="+GupShup.html.mySubscribers.vars.entityId+'&subType='+tab.gupshupConf.tabType,callBack:{success:GupShup.callback.processMySubscribers,failure:GupShup.callback.processMySubscribersErr}};startHolder.set(mySubContent.params.start);paginationContent=GupShup.util.expandPaginationTemplate(reqObj,paginationObj,'MYSUBSRIBERS');subContent=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('mySubDetailsTableTemplate'),GupShup.contactsTemplates.mySubDetailsTableTemplateMap,[mySubContent]);tableHead=(noRemoveAction)?GupShup.util.getInnerHTML('myPremiumSubDetailsTableHeadTemplate'):GupShup.util.getInnerHTML('mySubDetailsTableHeadTemplate');var theContent='<table class="contacts-table" summary="" id="contacts-table">'+tableHead+'<tbody>'+subContent+'</tbody>'+'</table>';if(!noRemoveAction)
theContent=theContent+'<br/>'+'<input type="button" class="mbtn" value="Remove Selected" onclick="GupShup.html.mySubscribers.deleteSubs(-1);" />';tab.set('content',theContent);GupShup.util.setInnerHTML('paginationContent',paginationContent);GupShup.util.setInnerHTML('headContent',headContent+"<br/>");}}
else if(mySubContent.errorCode=="INVALID_PAGE")
{headContent=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('mySubDetailsHeadTemplate'),GupShup.contactsTemplates.mySubDetailsHeadTemplateMap,[mySubContent]);headContent+=GupShup.util.getInnerHTML('invalidPageTemplate');GupShup.util.setInnerHTML('headContent',headContent+"<br/>");tab.set('content',"");GupShup.util.setInnerHTML('paginationContent',"");GupShup.html.util.hideElement('SUB_TYPE_TABS');}
else
{GupShup.forms.showNotification(mySubContent.message,{failure:true});}}})();GupShup.html.searchPage={};GupShup.html.searchPage.vars={searchTSStates:{}};GupShup.html.searchPage.vars.isViewerAdult=false;GupShup.html.searchPage.handleActiveTabChange=function(e){var oldTab=e.prevValue;var newTab=e.newValue;GupShup.connectionManager.addTransaction({obj:newTab.dataConnection,type:'TABSWITCH',onAbort:function(){newTab._loading=false;}});if(oldTab==newTab)
return;else
GupShup.html.dynamicBar.update(oldTab.gupshupConf.tabType,newTab.gupshupConf.tabType,'right');}
GupShup.html.searchPage.processSearchTabCustomResponse=function(text){var xhr=new Object();xhr.responseText=text;xhr.argument={tab:GupShup.conf.searchTabView.yahooTabView.get('activeTab')}
GupShup.callback.processSearchResponse(xhr);}
GupShup.html.searchPage.showAdultResultsOnConsent=function(){GupShup.html.searchPage.vars.isViewerAdult=true;GupShup.html.util.hideElement('adultWarningContainer');GupShup.html.util.showElement('searchResultsContainer');}
GupShup.html.searchPage.getResults=function(req){var start=req.start;req.queryStr=req.queryStr+"&searchOlder=true&searchFromTimeStamp=";if(req.start==0)
req.queryStr+="-1";else
req.queryStr+=((start>GupShup.html.searchPage.vars.currPageStart)?GupShup.html.searchPage.vars.nextPageStartTimeStamp:GupShup.html.searchPage.vars.searchTSStates[req.start]);GupShup.util.getJsonItems(req);}
GupShup.callback.processSearchResponse=function(xhr,tab,args){var tab=xhr.argument.tab;var searchContent=GupShup.util.getJsonFromResponse(xhr.responseText);var showError=false;if(searchContent.status=="SUCCESS")
{if(searchContent.entities.length==0)
{showError=true;}
else
{var paginationObj={start:searchContent.params.start,total:'',returned:searchContent.entities.length,windowSize:1,listType:"groups"};var reqObj={url:GupShup.conf.contextPath+'/getJsonItems',queryStr:tab.gupshupConf.queryStr+'&adult='+GupShup.html.searchPage.vars.isViewerAdult,navOnClickFunction:"javascript:GupShup.html.searchPage.getResults",callBack:{success:GupShup.callback.processSearchResponse,failure:GupShup.callback.processSearchError,argument:{tab:tab}}};var paginationContent=GupShup.util.expandPaginationTemplate(reqObj,paginationObj,tab.gupshupConf.tabType);var ele=null;if(paginationObj.windowSize==1)
ele=searchContent.entities.slice(0,GupShup.conf.ITEMS_PER_PAGE);else
ele=searchContent.entities;GupShup.html.searchPage.vars.currPageStart=searchContent.params.start;var len=ele.length;if(len>0)
{GupShup.html.searchPage.vars.searchTSStates[searchContent.params.start]=ele[0].latestMessage.creationTime;GupShup.html.searchPage.vars.nextPageStartTimeStamp=ele[len-1].latestMessage.creationTime;}
var content=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('entityMsgTemplate'),GupShup.msgTemplates.entityMsgMap,ele);tab.set('content',content+paginationContent);}}
else
{showError=true;}
if(showError)
{var type='';var query=''
if(typeof searchContent.params!='object')
{type='MATCHING_ENTITIES';query='your query';}
else
{type=searchContent.params.searchFor;query=searchContent.params.query;}
switch(type)
{case'MATCHING_POSTS':var content='<h2>No Matching Posts Found.</h2>';break;case'MATCHING_ENTITIES':var content='<h2>No Matching Groups Found.</h2>';break;}
content+="<p>Please check the spelling or search with a different query.</p>"
tab.set('content',content);GupShup.html.util.showElement('searchResultsContainer');}
else
{var isResultsAdult=(GupShup.util.isInitialized(searchContent.params.isAdult)&&searchContent.params.isAdult);if((!GupShup.html.searchPage.vars.isViewerAdult)&&isResultsAdult)
{GupShup.html.util.hideElement('searchResultsContainer');GupShup.html.util.showElement('adultWarningContainer');}
else
{GupShup.html.util.hideElement('adultWarningContainer');GupShup.html.util.showElement('searchResultsContainer');}}}
GupShup.callback.processSearchError=function(xhr,tab,args){};var hexcase=0;var b64pad="=";var chrsz=8;function hex_md5(s){return binl2hex(core_md5(str2binl(s),s.length*chrsz));}
function b64_md5(s){return binl2b64(core_md5(str2binl(s),s.length*chrsz));}
function str_md5(s){return binl2str(core_md5(str2binl(s),s.length*chrsz));}
function hex_hmac_md5(key,data){return binl2hex(core_hmac_md5(key,data));}
function b64_hmac_md5(key,data){return binl2b64(core_hmac_md5(key,data));}
function str_hmac_md5(key,data){return binl2str(core_hmac_md5(key,data));}
function md5_vm_test()
{return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72";}
function core_md5(x,len)
{x[len>>5]|=0x80<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16)
{var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);}
return Array(a,b,c,d);}
function md5_cmn(q,a,b,x,s,t)
{return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b);}
function md5_ff(a,b,c,d,x,s,t)
{return md5_cmn((b&c)|((~b)&d),a,b,x,s,t);}
function md5_gg(a,b,c,d,x,s,t)
{return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t);}
function md5_hh(a,b,c,d,x,s,t)
{return md5_cmn(b^c^d,a,b,x,s,t);}
function md5_ii(a,b,c,d,x,s,t)
{return md5_cmn(c^(b|(~d)),a,b,x,s,t);}
function core_hmac_md5(key,data)
{var bkey=str2binl(key);if(bkey.length>16)bkey=core_md5(bkey,key.length*chrsz);var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++)
{ipad[i]=bkey[i]^0x36363636;opad[i]=bkey[i]^0x5C5C5C5C;}
var hash=core_md5(ipad.concat(str2binl(data)),512+data.length*chrsz);return core_md5(opad.concat(hash),512+128);}
function safe_add(x,y)
{var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);}
function bit_rol(num,cnt)
{return(num<<cnt)|(num>>>(32-cnt));}
function str2binl(str)
{var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz)
bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32);return bin;}
function binl2str(bin)
{var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz)
str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask);return str;}
function binl2hex(binarray)
{var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++)
{str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+
hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF);}
return str;}
function binl2b64(binarray)
{var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(var i=0;i<binarray.length*4;i+=3)
{var triplet=(((binarray[i>>2]>>8*(i%4))&0xFF)<<16)|(((binarray[i+1>>2]>>8*((i+1)%4))&0xFF)<<8)|((binarray[i+2>>2]>>8*((i+2)%4))&0xFF);for(var j=0;j<4;j++)
{if(i*8+j*6>binarray.length*32)str+=b64pad;else str+=tab.charAt((triplet>>6*(3-j))&0x3F);}}
return str;};var totalDiv=12;function setBaseUrl(url)
{addr=url;}
function test11()
{hideErrorBox();boxesId=document.form1.cat;html="";for(i=0;i<boxesId.length;i++)
{if(boxesId[i].checked)
{if(html.length>0)
html+=",&nbsp;&nbsp;";html+=boxesId[i].value;}}
document.getElementById('fillme').innerHTML="&nbsp;"+html;}
function test12()
{hideErrorBox();boxesId=document.form1.cities;html="";for(i=0;i<boxesId.length;i++)
{if(boxesId[i].checked)
{if(html.length>0)
html+=",&nbsp;&nbsp;";html+=boxesId[i].value;}}
document.getElementById('killme').innerHTML="&nbsp;"+html;}
function uncheckAll(field)
{for(i=0;i<field.length;i++)
field[i].checked=false;}
function trim(str)
{return((""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1'));}
function submitSearch()
{var filter=/\w+/;if(!filter.test(trim(document.search.searchQuery.value)))
{document.search.searchQuery.focus();return false;}
else
document.search.submit();}
function isValidEmail(value)
{var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(filter.test(trim(value)))
return true;else
return false;}
var errorMsgList=new Array();errorMsgList[0]="Please select a Category";errorMsgList[1]="Please select a Location";errorMsgList[2]="Your ad message should not be more than 60 characters";errorMsgList[3]="Please enter your name";errorMsgList[4]="Please enter your email Id";errorMsgList[5]="Please enter a valid email id";function isChecked(boxesId)
{var found=false;for(i=0;i<boxesId.length;i++)
{if(boxesId[i].checked)
{found=true;break;}}
return found;}
function sendFeedback()
{var name=document.getElementById("name");var email=document.getElementById("email");var boxesId=document.form1.cat;var creative=document.getElementById("creative")
if(!isChecked(boxesId))
{showError('catError',errorMsgList[0]);return;}
boxesId=document.form1.cities;if(!isChecked(boxesId))
{showError('locError',errorMsgList[1]);return;}
if(trim(creative.value).length>60)
{showError('creative',errorMsgList[2]);return false;}
if(trim(name.value).length==0)
{showError('name',errorMsgList[3]);return false;}
if(!isValidEmail(trim(email.value)))
{showError('email',errorMsgList[5]);return false;}
document.form1.submit();}
function loadColor()
{var grpName=document.getElementById("groupName").value
var v=document.getElementById("color").value;document.getElementById("widget").innerHTML="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"200\" height=\"220\" id=\"GupShupSwf\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"flashvars\" value=\"group="+grpName+"&bg="+v+"&fg=333333\" /><param name=\"movie\" value=\""+GupShup.util.getSwfPath("GupShup.swf")+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\""+GupShup.util.getSwfPath("GupShup.swf")+"\" quality=\"high\" bgcolor=\"#ffffff\" width=\"200\" height=\"220\" flashvars=\"group="+grpName+"&bg="+v+"&fg=333333\" name=\"GupShupSwf\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ></embed></object>";document.getElementById("embedCode").value="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"200\" height=\"220\" id=\"GupShupSwf\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"flashvars\" value=\"group="+grpName+"&bg="+v+"&fg=333333\" /><param name=\"movie\" value=\""+GupShup.util.getSwfPath("GupShup.swf")+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\""+GupShup.util.getSwfPath("GupShup.swf")+"\" quality=\"high\" bgcolor=\"#ffffff\" width=\"200\" height=\"220\" flashvars=\"group="+grpName+"&bg="+v+"&fg=333333\" name=\"GupShupSwf\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ></embed></object>";}
function loadDefault()
{document.getElementById("widget").innerHTML="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"200\" height=\"220\" id=\"GupShupSwf\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"flashvars\" value=\"group=gupshup&bg=FFF5A2&fg=333333\" /><param name=\"movie\" value=\""+GupShup.util.getSwfPath("GupShup.swf")+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\""+GupShup.util.getSwfPath("GupShup.swf")+"\" quality=\"high\" bgcolor=\"#ffffff\" width=\"200\" height=\"220\" flashvars=\"group=gupshup&bg=FFF5A2&fg=333333\" name=\"GupShupSwf\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ></embed></object>";}
function chckName()
{if((document.getElementById("groupName").value.length!=0))
{loadColor();}
else{document.getElementById("popUp").style.display="none";}}
function init()
{document.getElementById("groupName").value="";};(function(){GupShup.html.supportForm={formDoc:null,countryCodeControl:null,phoneControl:null,emailControl:null,groupControl:null,msgControl:null,subControl:null,capControl:null,nameControl:null,profControl:null,locControl:null,initAll:false,init:function(doc){if(this.initAll)
return;this.formDoc=doc;this.countryCodeControl=new GupShup.forms.controls({name:'paidSupport.countryCode',toolTip:'',doc:doc});this.phoneControl=new GupShup.forms.controls({name:'paidSupport.phone',toolTip:'',doc:doc});this.emailControl=new GupShup.forms.controls({name:'paidSupport.from',toolTip:'',doc:doc});this.groupControl=new GupShup.forms.controls({name:'paidSupport.group',toolTip:'',doc:doc});this.msgControl=new GupShup.forms.controls({name:'paidSupport.content',toolTip:'',doc:doc});this.subControl=new GupShup.forms.controls({name:'paidSupport.subject',toolTip:'',doc:doc});this.capControl=new GupShup.forms.controls({name:'paidSupport.captcha',toolTip:'',doc:doc});this.nameControl=new GupShup.forms.controls({name:'paidSupport.Name',toolTip:'',doc:doc});this.profControl=new GupShup.forms.controls({name:'paidSupport.Profession',toolTip:'',doc:doc});this.locControl=new GupShup.forms.controls({name:'paidSupport.Location',toolTip:'',doc:doc});this.initAll=true;},clearInputs:function(){this.phoneControl.set("");this.emailControl.set("");if(this.groupControl.isValid())
this.groupControl.set("");if(this.msgControl.isValid())
this.msgControl.set("");this.capControl.set("");if(this.nameControl.isValid())
this.nameControl.set("");if(this.profControl.isValid())
this.profControl.set("");if(this.locControl.isValid())
this.locControl.set("");if(this.formDoc.forms['paidSupport'].subject)
this.formDoc.forms['paidSupport'].subject.selectedIndex=0;},reloadCapcha:function()
{var dt=new Date();var tableCell=this.formDoc.getElementById('capchaImageId');var captchaImgElementsArr=tableCell.getElementsByTagName('img');captchaImgElementsArr[0].src=GupShup.conf.contextPath+"/captcha?capReqType=0&sId="+dt.getMilliseconds();},validateLoginForm:function(){phone=this.phoneControl.get('value');cCode=this.countryCodeControl.get('value');email=this.emailControl.get('value');cap=this.capControl.get('value');if(phone.length==0)
{alert(GupShup.html.errorMessages.blankPhone);return false;}
if(!GupShup.util.isValidEmail(email))
{alert(GupShup.html.errorMessages.invalidEmailId);return false;}
if(!GupShup.util.isValidPhone(cCode,phone))
{alert(GupShup.html.errorMessages.invalidPhone);return false;}
if(this.subControl.isValid()&&this.subControl.getValue()=='NONE')
{alert(GupShup.html.errorMessages.noSubSelected);return false;}
if(this.msgControl.isValid())
{if(this.msgControl.get('length')<1)
{alert(GupShup.html.errorMessages.noComment);return false;}
if(this.msgControl.get('length')>200)
{alert(GupShup.html.errorMessages.bigComment);return false;}
if(!GupShup.util.isAscii(this.msgControl.getValue()))
{alert(GupShup.html.errorMessages.nonAsciiChar);return false;}
if(!GupShup.util.isValidContent(this.msgControl.getValue(),stopWords))
{alert(GupShup.html.errorMessages.stopWordsInComment);return false;}}
if(this.capControl.get('length')<1)
{alert(GupShup.html.errorMessages.blankCaptchaAlert);return false;}
return true;},submitForm:function(pDoc){this.init(pDoc);if(this.validateLoginForm())
{var callback={success:function(o){GupShup.html.supportForm.supportSuccess(o)},failure:function(o){GupShup.html.supportForm.supportFailure(o)},scope:GupShup.html.supportForm,argument:{}};GupShup.html.util.submitFormUsingAjax('POST',GupShup.conf.writeUrl+"&type=SEND_EMAIL",callback,this.formDoc.forms['paidSupport']);GupShup.html.util.disableBtn('sendBtnId',this.formDoc);}
else
{GupShup.html.util.enableBtn('sendBtnId',this.formDoc);}
return false;},supportSuccess:function(o){var response=GupShup.util.getJsonFromResponse(o.responseText);if(response.status=="SUCCESS")
{alert(response.message);this.clearInputs();}
else
{alert(response.message);}
this.reloadCapcha();GupShup.html.util.enableBtn('sendBtnId',this.formDoc);return;},supportFailure:function(o){GupShup.html.util.enableBtn('sendBtnId',this.formDoc);}}})();var allIndiaStates=new Array("Andhra Pradesh","Arunachal Pradesh","Assam","Bihar","Chhattisgarh","Goa","Gujarat","Haryana","Himachal Pradesh","Jammu and Kashmir","Jharkhand","Karnataka","Kerala","Madhya Pradesh","Maharashtra","Manipur","Meghalaya","Mizoram","Nagaland","Orissa","Punjab","Rajasthan","Sikkim","Tamil Nadu","Tripura","Uttar Pradesh","Uttarakhand","West Bengal");var allIndiaCities=new Array("Abu","Achalpur","Agartala","Agra","Ahmedabad","Ahmednagar","Aizwal","Ajmer","Akola","Aligarh","Allahabad","Alwar","Ambala","Ammakandakara","Amravati","Amreli","Amritsar","Anand","Anantapur","Anklesvar","Anuppur","Araria","Arcot","Arrah","Aruppukkottai","Asansol","Ashok Nagar","Ashtamichira","Aurangabad, Bihar","Aurangabad, Maharashtra","Asurbandh, Jharkhand","Azamgarh","Ballabhgarh","Baharampur","Bahadurgarh","Bahraich","Bolangir","Balaghat","Balasore","Balia","Balrampur","Banda","Bangalore","Banganapalle","Banswara","Banur","Bapatla","Barachakia","Baramati","Baran","Bardhaman","Bareilly","Bargarh","Barnala","Baripada","Barmer","Barrackpur","Barwani","Banswara","Beawar","Belgaum","Bellary","Betul","Bhagalpur","Bhavani","Bhandara","Bharatpur","Bharuch","Bhavnagar","Bhilai Nagar","Bhimavaram","Bhiwandi","Bhiwani","Bhopal","Bhubaneswar","Bhuj","Bidar","Bihar Sharif","Bijnaur, UP","Bikaner","Bilaspur, Chhattisgarh","Bilaspur, Himachal Pradesh","Bilgha, Punjab","Bodh Gaya","Bokaro Steel City","Bongaigaon","Buldana","Burhanpur","Buxar","Bulandshahr","Barh","Balpur","Calicut","Cambay","Chamoli Gopeshwar","Champawat","Chamrajnagar","Chandannagar","Chandigarh","Chapirevula","Chapra","Charkhari","Charkhi Dadri","Chandrapur","Chengalpattu","Chennai","Cherunniyoor","Chhatarpur","Chhindwara","Chikmagalur","Chiplun","Chirala","Chitradurga","Chitrakoot Dham Karwi","Chittoor","Cochin","Coimbatore","Contai","Balangir Orissa","Balurghat West Bengal","Brahmapur Orissa","Bramhapuri Maharashtra","Caryobys","Coonoor","Cuddalore","Cuddapah","Cuttack","chappaiya","Dabra","Dadra","Dahod","Daksh","Daltonganj","Daman","Damoh","Darbhanga","Darjeeling","Datia","Davanagere","Dehgam","Dehradun","Deoghar","Dewas","Delhi","Dhanbad","Dhar","Dharampur","Dharamsala","Dharwad","Dholka","Dhule","Dhulian","Dibrugarh","Dispur","Dindigul","Diu","Dombivli","Duhbai","Dumdum","Durg","Durgapur","Dwarka","Ernakulam","Erode","Etah","Etawah","Eluru","Faizabad","Faridabad","Faridkot","Farrukhabad","Fatehgarh","Fatehpur Sikri","Ferozepur Cantt.","Ferozepur City","Firozabad","Fatehpur,Near Kanpur","Gadag","Gadchiroli","Gandhinagar","Gangtok","Ganjam","Garcha, Punjab","Gaya","Ghaziabad","Ghazipur","Goa Velha","Godhra","Gondiya","Gorakhpur","Greater Noida","Gulbarga","Gumla","Guna","Gundlupet","Guntur","Gurgaon","Guruharsahai","Guwahati","Gulbarga","Gudalur","Gudivada","Gwalior","Hoshiarpur","Haldia","Haldwani","Hamirpur, Himachal Pradesh","Hamir, Uttar Pradesh","Hanumangarh","Howrah","Harda","Hardoi","Harsawa","Haridwar","Hubli","Hassan","Hastinapur","Hathras","Himatnagar","Hisar","Hansi","Hyderabad, Andhra Pradesh","Hatigudda, Karnataka","Halisahar","Indore","Imphal","Jabalpur","Jaipur","Jais","Jaisalmer","Jalalabad,_Punjab","Jalandhar","Jalgaon","Jagraon","Jagtial","Jammu","Jamnagar","Jamshedpur","Jaunpur","Jhabua","Jhalawar","Jhansi","Jhunjhunu","Jodhpur","Jorhat","Junagadh","Karur","Karwar","Karimnagar","Kochi","Kanpur","Kharagpur","Kolkata","kakinada","kapurthala","Kolhapur","Kashiramnagar","Lalitpur","Leh","Lucknow","Ludhiana","Lamka","latur","Lonavla","Lajpat","Madanapalle","Madgaon","Madikeri","Madurai","Mahabaleswar","Mahabubnagar","Mahe","Mahoba","Mahwa","Mahuva","Malout","Malegaon","Mancherial","Mandsaur","Manesar","Mangalagiri","Mangalore","Mapusa","Marmagao","Mathura","Machilipatnam","Mahad","Meerut","Mehsana","Melattor","Mira-Bhayandar","Miraj","Mirzapur","Moga","Mohali","Mokama","Moradabad","Motihari","Mount Abu","Mukatsar","Mullanpur","Mumbai","Mussoorie","Murwara","Murshidabad","Muzaffarnagar","Muzaffarpur","Mysore","Nadiad","Nagapattinam","Nagarkurnool","Nagercoil","Nagina, UP","Nagpur","Nainital","Nalgonda","Namakkal","Nanded","Nandyal","Nandurbar","Nangal","Narasaraopet","Narsimhapur","Narsinghgarh","Nashik","Navi Mumbai","Navsari","Nawalgarh","Neemuch","Nellore","New Delhi or Delhi","New Guntur","NOIDA","Nizamabad","Nirmal, Andhra Pradesh","Nurmahal, Punjab","Nurpur, Himachal Pradesh","Ongole","Palai","Palwal","Panaji","Panchkula","Pandharpur","Panipat","Panna","Panvel","Paratwada","Pasla, Punjab","Patan","Pathankot","Patiala","Patna","Patratu,Jharkhand","Pilibhit","Pimpri Chinchwad","Ponda","Puducherry","Puttaparthy","Porbandar","Port Blair","Pratapgarh","Pune","Puri","Purnea, Bihar","Pushkar","Punalur","Quilon (now Kollam)","Ranchi","Raichur","Raigarh","Raisen","Raipur","Rajahmundry","Rajampet","Rajgarh","Rajkot","Rajnandgaon","Ramanathapuram","Rameshwaram","Rampur","Ranikhet","Rasheed","Ratangarh","Ratlam","Ratnagiri","Raurkela","Rae Bareli","Ravulapalem","Renukoot","Rewa","Ringawa","Rishikesh","Roorkee","Rourkela","Salem","Samastipur","Sanawad","Sangli","Sangamner","Sathyamangalam","Satara","Satna","Saharanpur","Sehore","Seoni","Shajapur","Shegaon","Sheopur","Shevgaon","Shillong","Shrivardhan","Shivani","Sholapur","shrirampur","shrigonda","Siddipet","Sikar","Silchar","Silvassa","Sindhanur","Sinnar","Shimla","Sihor","Shimoga","Shirala","Siliguri","Singrauli","Sirohi","Sironj","Sitamarhi","Siwan","Sonipat","Sriganganagar","Srikakulam","Srinagar","Surat","Suratgarh","Surendranagar","Suryapet","Sitapur","Sambalpur","[edit] T","Tanuku","Talwara","Tamluk","Tandur","Tezpur,Assam","Tenali","Thane","Thanjavur","Thathawata","Thiruvallur","Thrikkannamangal","Thrissur (formerly Trichur)","Thodupuzha","Thoothukudi","Tindivanam","Tinsukia","Tirupattur","Tiruchirappalli","Tirunelveli","Tirupathi","Tirupur","Tiruvarur","Tikamgarh","Thirthahalli","Thiruvananthapuram","Tzudikong","tumkur","Udaipur in Rajasthan","Udaipur in Tripura","Udhampur in Jammu & Kashmir","Udupi","Udhagamandalam","Ujjain","Ulhasnagar","Unnao","Utter Pradesh","Uttarpara in West Bengal","Vadodara","Vatakara","Vallabh Vidhyanagar","Valsad","Vandavasi","Vapi","Varanasi","Vasai","Vasco da Gama, Goa","Vellore","Vidisha","Vijayawada","Viluppuram","Virar","Visakhapatnam","Vizianagaram","Virudhachalam","Vyara","Warangal");GupShup.html.premiumPage={};GupShup.html.premiumPage.vars={catId:-1};GupShup.html.premiumPage.processCustomResponse=function(text){var xhr=new Object();xhr.responseText=text;GupShup.callback.processPremiumResponse(xhr);}
GupShup.callback.processPremiumResponse=function(xhr){var premiumPageContent=GupShup.util.getJsonFromResponse(xhr.responseText);if(premiumPageContent.status=='SUCCESS')
{var ele=new Array();var paginationObj={start:premiumPageContent.params.start,total:premiumPageContent.totalForPg,returned:premiumPageContent.entities.length,windowSize:GupShup.conf.windowSize,listType:"Premium Groups"};var reqObj={url:GupShup.conf.readUrl,queryStr:'type=PREMIUM_ENTITIES&showCategory=false&withAdult=true&catId='+GupShup.html.premiumPage.vars.catId,callBack:{success:GupShup.callback.processPremiumResponse,failure:GupShup.callback.processPremiumError}};var paginationContent=GupShup.util.expandPaginationTemplate(reqObj,paginationObj,'PREMIUM');ele=premiumPageContent.entities;var content=GupShup.util.expandTemplate(GupShup.util.getInnerHTML('premiumGroupDetailsTemplate'),GupShup.templates.premiumGroupDetailsMap,ele);GupShup.util.setInnerHTML('premiumGroupsList',content+paginationContent);}}
GupShup.callback.processPremiumError=function(xhr,tab,args){};var uniquepageid=window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,"")
function animatedcollapse(divId,animatetime,persistexpand,initstate){this.divId=divId;this.divObj=document.getElementById(divId)
this.divObj.style.overflow="hidden";this.timelength=animatetime;this.initstate=(typeof initstate!="undefined"&&initstate=="block")?"block":"contract";this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId);this.contentheight=parseInt(this.divObj.style.height);var thisobj=this;if(isNaN(this.contentheight)){animatedcollapse.dotask(window,function(){thisobj._getheight(persistexpand)},"load");if(!persistexpand&&this.initstate=="contract"||persistexpand&&this.isExpanded!="yes"&&this.isExpanded!="")
this.divObj.style.visibility="hidden";}
else if(!persistexpand&&this.initstate=="contract"||persistexpand&&this.isExpanded!="yes"&&this.isExpanded!="")
this.divObj.style.height=0;if(persistexpand)
animatedcollapse.dotask(window,function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId,thisobj.isExpanded)},"unload");};animatedcollapse.prototype._getheight=function(persistexpand){this.contentheight=this.divObj.offsetHeight;if(!persistexpand&&this.initstate=="contract"||persistexpand&&this.isExpanded!="yes"){this.divObj.style.height=0;this.divObj.style.visibility="visible";}
else
this.divObj.style.height=this.contentheight+"px";};animatedcollapse.prototype._slideengine=function(direction){var elapsed=new Date().getTime()-this.startTime;var thisobj=this;if(elapsed<this.timelength){var distancepercent=(direction=="down")?animatedcollapse.curveincrement(elapsed/this.timelength):1-animatedcollapse.curveincrement(elapsed/this.timelength);this.divObj.style.height=distancepercent*this.contentheight+"px";this.runtimer=setTimeout(function(){thisobj._slideengine(direction)},10);}
else{this.divObj.style.height=(direction=="down")?this.contentheight+"px":0;this.isExpanded=(direction=="down")?"yes":"no";this.runtimer=null;};};animatedcollapse.prototype.slidedown=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==0){this.startTime=new Date().getTime();this._slideengine("down");};};};animatedcollapse.prototype.slideup=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==this.contentheight){this.startTime=new Date().getTime();this._slideengine("up");};};};animatedcollapse.prototype.slideit=function(){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==0)
this.slidedown();else if(parseInt(this.divObj.style.height)==this.contentheight)
this.slideup();};animatedcollapse.curveincrement=function(percent){return(1-Math.cos(percent*Math.PI))/2;};animatedcollapse.dotask=function(target,functionref,tasktype){var tasktype=(window.addEventListener)?tasktype:"on"+tasktype;if(target.addEventListener)
target.addEventListener(tasktype,functionref,false);else if(target.attachEvent)
target.attachEvent(tasktype,functionref);};animatedcollapse.getCookie=function(Name){;var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1];return"";};animatedcollapse.setCookie=function(name,value){document.cookie=name+"="+value;};
