$(document.ready=function(){$(".dcutilityl .li:has(.dcsubmenu)").hover(function(){$(this).children(".dcsubmenu").show(0)},function(){$(this).children(".dcsubmenu").delay(200).hide(0)});$(".dcutilityr .sub:has(.dcsubmenu)").hover(function(){$(this).children(".dcsubmenu").show(0)},function(){$(this).children(".dcsubmenu").delay(200).hide(0)});$(".dcmenu .magli:has(.dcsubmenu)").hover(function(){$(this).children(".dcsubmenu").show(0)},function(){$(this).children(".dcsubmenu").delay(200).hide(0)});$(".featuredl dt").hover(function(){$(this).children("span").animate({height:"38px"},200)},function(){$(this).children("span").animate({height:"0px"},100)});$(".bloglisting .img").hover(function(){$(this).children("h4").animate({bottom:"0px"},200)},function(){$(this).children("h4").animate({bottom:"-45px"},100)});$(".sortingul .sortli").hover(function(){$(this).children(".sortsubul").slideDown(100)},function(){$(this).children(".sortsubul").delay(500).hide(0)});$(".selectrow ul li").filter(":has(.sortsubul)").hover(function(){$(this).children(".sortsubul").slideDown(100)},function(){$(this).children(".sortsubul").delay(500).hide(0)});$(".inbtn").hover(function(){$(this).animate({backgroundPosition:"0px -25px"},199)},function(){$(this).animate({backgroundPosition:"0px 0px"},199)});$(".inbtn").click(function(){$(this).animate({opacity:"0.7"})});$("Back to Top").appendTo(document.body);$("#back2top").click(function(){$("html,body").animate({scrollTop:0},499)});$(document).scroll(function(){if($(document).scrollTop()>0){$("#back2top").fadeIn(200)}else{$("#back2top").fadeOut(200)}});if($(".tweetbrdul").length){$(".tweetbrdul").each(function(){var d=parseInt(($(this).height()-$(this).children(".tweet").height())/2,10);$(this).children(".tweet").css("padding-top",d)})}if($(".dcshareparent").length){var a=$(".dcshareparent").width();var c=$(".dcshareparent .dshare").height();var b=$(".dcshareparent").offset();$(window).scroll(function(){if($(this).scrollTop()+c>$(".dcshareparent").height()){$(".dcshareparent .dshare").css("position","absolute");$(".dcshareparent .dshare").css("top",$(".dcshareparent").height()-c+"px");$(".dcshareparent .dshare").css("left",a+10+"px")}else{$(".dcshareparent .dshare").css("position","fixed");$(".dcshareparent .dshare").css("top",b.top+"px");$(".dcshareparent .dshare").css("left",b.left+a+10+"px")}})}});var objbodytooltip;var objChildDiv0;function shwtooltip(a,b){objbodytooltip=document.getElementsByTagName("body")[0];objChildDiv0=document.createElement("div");objChildDiv0.className="tooltip0 subx";var g=document.createElement("div");g.className="suby";var f=document.createElement("div");f.className="subz";var e=document.createElement("div");e.className="tooltipcont";var c=document.createElement("div");c.className="tooltiparwdwn";e.innerHTML=b;f.appendChild(e);g.appendChild(f);objChildDiv0.appendChild(g);objChildDiv0.appendChild(c);objbodytooltip.appendChild(objChildDiv0);var i=$(a).offset();var d=i.top-$(objChildDiv0).height()-4;var h=i.left+($(a).width())/2+5-($(objChildDiv0).width())/2;objChildDiv0.style.top=d+"px";objChildDiv0.style.left=h+"px"}function remtooltip(){objbodytooltip.removeChild(objChildDiv0)}var W3CDOM=(document.createElement&&document.getElementsByTagName);function initFileUploads(){if(!W3CDOM){return}var d=document.createElement("div");d.className="fakefile";var c=document.createElement("input");c.className="intxt";d.appendChild(c);var e=document.createElement("img");e.src=gBase_url+"public/images/btn_browse.png";d.appendChild(e);var a=document.getElementsByTagName("input");for(var b=0;bFollowing
');obj.removeClass("inbtn3");obj.addClass("uflw");obj.html("Unfollow")}}}}obj.attr("operation",0)}else{if(isbutton==1){obj.removeClass("flw").addClass("fol")}else{if(isbutton==0){obj.html("Follow")}else{if(isbutton==3){$("#quickedit"+friend_id).slideUp("slow",function(){$(this).remove()})}else{if(isbutton==4){obj.parent().find("span").remove();obj.parent().find("br").remove();obj.addClass("inbtn3");obj.removeClass("uflw");obj.html("Follow")}}}}obj.attr("operation",1)}}else{showModalMessage(this,"Error!",ret.msg)}})}function deleteActivityAfterconnectionAcceptOrReject(a){$.post(gBaseUrl+"/ajaxhandler/deteteNotification",{notifyId:a},function(b){$("#row"+a).slideUp("slow",function(){$(this).remove()})})}function deleteNotification(a){$("#confirmDiv").children("h2").html("Hold on a Second!");$("#confirmDiv").children("h3").html("Are you sure you want to delete this notification ?");openmodalpopup(this,"confirmDiv");$("#conifrmYes").click(function(){$("#conifrmYes").unbind("click");$.post(gBaseUrl+"/ajaxhandler/deteteNotification",{notifyId:a},function(b){$("#row"+a).slideUp("slow",function(){$(this).remove()})})});$("#conifrmNo").click(function(){$(this).parents(".infopopup").hide(0);$("#conifrmYes").unbind("click")})}function deleteAllNotifications(){$("#confirmDiv").children("h2").html("Hold on a Second!");$("#confirmDiv").children("h3").html("Are you sure you want to delete all notifications ?");openmodalpopup(this,"confirmDiv");$("#conifrmYes").click(function(){$("#conifrmYes").unbind("click");$.post(gBaseUrl+"/ajaxhandler/deteteAllNotifications",{},function(a){window.location.reload()})});$("#conifrmNo").click(function(){$(this).parents(".infopopup").hide(0);$("#conifrmYes").unbind("click")})}function submitAccountReply(){var e=$(this);var id=$(this).parent().attr("id");var textareaobject=e.parent().siblings().children("textarea");var details=$("#replyBox"+id).children("input");var accountReplyContentId=$(details[0]).val();var accountReplyActivityCategory=$(details[1]).val();var accountReplyEventId=$(details[2]).val();var Content=textareaobject.val();if(Content==""){showModalMessage(this,"Alert!","Please enter the reply.");$(".inbtn").animate({opacity:"1"});textareaobject.focus();return}$(".submitAccountReply").unbind("click");switch(accountReplyActivityCategory){case"12":case"23":$.post(gBaseUrl+"/comment/saveReply.html",{ContentId:accountReplyContentId,CommentId:accountReplyEventId,Content:Content,postToType:5,name:"",email:"",website:"",isLoggedIn:1,fromprofile:0},function(data){textareaobject.val("");$("#replyBox"+id).hide();setTimeout(function(){e.parent().css("opacity",1)},300);$(".submitAccountReply").click(submitAccountReply)});break;case"29":case"30":$.post(gBaseUrl+"/comment/saveReply.html",{ContentId:accountReplyContentId,CommentId:accountReplyEventId,Content:Content,postToType:8,name:"",email:"",website:"",isLoggedIn:1,fromprofile:0},function(data){textareaobject.val("");$("#replyBox"+id).hide();setTimeout(function(){e.parent().css("opacity",1)},300);$(".submitAccountReply").click(submitAccountReply)});break;case"11":case"22":$.post(gBaseUrl+"/comment/saveReply.html",{ContentId:accountReplyContentId,CommentId:accountReplyEventId,Content:Content,postToType:4,name:"",email:"",website:"",isLoggedIn:1,fromprofile:0},function(data){textareaobject.val("");$("#replyBox"+id).hide();setTimeout(function(){e.parent().css("opacity",1)},300);$(".submitAccountReply").click(submitAccountReply)});break;case"13":case"24":$.post(gBaseUrl+"/comment/saveReply.html",{ContentId:accountReplyContentId,CommentId:accountReplyEventId,Content:Content,postToType:4,name:"",email:"",website:"",isLoggedIn:1,fromprofile:0},function(data){textareaobject.val("");$("#replyBox"+id).hide();setTimeout(function(){e.parent().css("opacity",1)},300);$(".submitAccountReply").click(submitAccountReply)});break;case"4":case"25":$.post(gBaseUrl+"/comment/saveReply.html",{ContentId:accountReplyContentId,CommentId:accountReplyEventId,Content:Content,postToType:0,name:"",email:"",website:"",isLoggedIn:1,fromprofile:0},function(data){$("#replyBox"+id).hide();setTimeout(function(){e.parent().css("opacity",1)},300);$(".submitAccountReply").click(submitAccountReply);eval("commentData = "+data);if(commentData.success==1){showModalMessage(this,"Error!","Unable to save reply.");$(".inbtn").animate({opacity:"1"});textareaobject.val(commentData.content);return}textareaobject.val("");$("#count"+accountReplyEventId).html(parseInt($("#count"+accountReplyEventId).html())+1);$("#count"+accountReplyEventId).parent().parent().show();$("#replyBox"+accountReplyEventId).hide();$("#replyList"+accountReplyEventId).prepend(commentData.html);$(".links").click(showReplies);$(".options li").click(optionHandler);if($(".replyCancel").length){$(".replyCancel").click(replyCancel)}if($(".replySubmit").length){$(".replySubmit").click(submitReply)}if($(".critiquePageReply").length){$(".critiquePageReply").click(critiquePageReply)}if($(".cancelAccountReply").length){$(".cancelAccountReply").click(cancelAccountReply)}if($(".submitAccountReply").length){$(".submitAccountReply").click(submitAccountReply)}});break;case"15":$.post(gBaseUrl+"/ajaxhandler/addMessageReply.html",{message:Content,MessageId:accountReplyContentId},function(data){eval(" data = "+data);if(data!="[]"){textareaobject.val("");$("#replyBox"+id).hide();setTimeout(function(){e.parent().css("opacity",1)},300)}$(".submitAccountReply").click(submitAccountReply)});break}}function showReplies(){var b=$(this);var a=b.parent().parent().attr("id");if($("#replyList"+a).css("display")=="none"){$("#replyList"+a).show()}else{$("#replyList"+a).hide()}};jQuery.ui||(function(p){var j=p.fn.remove,o=p.browser.mozilla&&(parseFloat(p.browser.version)<1.9);p.ui={version:"1.7.1",plugin:{add:function(e,d,b){var c=p.ui[e].prototype;for(var a in b){c.plugins[a]=c.plugins[a]||[];c.plugins[a].push([d,b[a]])}},call:function(a,d,e){var b=a.plugins[d];if(!b||!a.element[0].parentNode){return}for(var c=0;c0){return true}c[b]=1;d=(c[b]>0);c[b]=0;return d},isOverAxis:function(c,a,b){return(c>a)&&(c<(a+b))},isOver:function(a,e,b,c,f,d){return p.ui.isOverAxis(a,b,f)&&p.ui.isOverAxis(e,c,d)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(o){var m=p.attr,n=p.fn.removeAttr,k="/2005/07/aaa",r=/^aria-/,q=/^wairole:/;p.attr=function(a,b,d){var c=d!==undefined;return(b=="role"?(c?m.call(this,a,b,"wairole:"+d):(m.apply(this,arguments)||"").replace(q,"")):(r.test(b)?(c?a.setAttributeNS(k,b.replace(r,"aaa:"),d):m.call(this,a,b.replace(r,"aaa:"))):m.apply(this,arguments)))};p.fn.removeAttr=function(a){return(r.test(a)?this.each(function(){this.removeAttributeNS(k,a.replace(r,""))}):n.call(this,a))}}p.fn.extend({remove:function(){p("*",this).add(this).each(function(){p(this).triggerHandler("remove")});return j.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var a;if((p.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){a=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(p.curCSS(this,"position",1))&&(/(auto|scroll)/).test(p.curCSS(this,"overflow",1)+p.curCSS(this,"overflow-y",1)+p.curCSS(this,"overflow-x",1))}).eq(0)}else{a=this.parents().filter(function(){return(/(auto|scroll)/).test(p.curCSS(this,"overflow",1)+p.curCSS(this,"overflow-y",1)+p.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!a.length?p(document):a}});p.extend(p.expr[":"],{data:function(b,c,a){return !!p.data(b,a[3])},focusable:function(c){var b=c.nodeName.toLowerCase(),a=p.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(b)?!c.disabled:"a"==b||"area"==b?c.href||!isNaN(a):!isNaN(a))&&!p(c)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=p.attr(a,"tabindex");return(isNaN(b)||b>=0)&&p(a).is(":focusable")}});function l(c,b,a,d){function e(g){var h=p[c][b][g]||[];return(typeof h=="string"?h.split(/,?\s+/):h)}var f=e("getter");if(d.length==1&&typeof d[0]=="string"){f=f.concat(e("getterSetter"))}return(p.inArray(a,f)!=-1)}p.widget=function(c,a){var b=c.split(".")[0];c=c.split(".")[1];p.fn[c]=function(f){var d=(typeof f=="string"),g=Array.prototype.slice.call(arguments,1);if(d&&f.substring(0,1)=="_"){return this}if(d&&l(b,c,f,g)){var e=p.data(this[0],c);return(e?e[f].apply(e,g):undefined)}return this.each(function(){var h=p.data(this,c);(!h&&!d&&p.data(this,c,new p[b][c](this,f))._init());(h&&d&&p.isFunction(h[f])&&h[f].apply(h,g))})};p[b]=p[b]||{};p[b][c]=function(f,d){var e=this;this.namespace=b;this.widgetName=c;this.widgetEventPrefix=p[b][c].eventPrefix||c;this.widgetBaseClass=b+"-"+c;this.options=p.extend({},p.widget.defaults,p[b][c].defaults,p.metadata&&p.metadata.get(f)[c],d);this.element=p(f).bind("setData."+c,function(h,i,g){if(h.target==f){return e._setData(i,g)}}).bind("getData."+c,function(g,h){if(g.target==f){return e._getData(h)}}).bind("remove",function(){return e.destroy()})};p[b][c].prototype=p.extend({},p.widget.prototype,a);p[b][c].getterSetter="option"};p.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(d,c){var a=d,b=this;if(typeof d=="string"){if(c===undefined){return this._getData(d)}a={};a[d]=c}p.each(a,function(f,e){b._setData(f,e)})},_getData:function(a){return this.options[a]},_setData:function(b,a){this.options[b]=a;if(b=="disabled"){this.element[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",a)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(d,c,b){var g=this.options[d],f=(d==this.widgetEventPrefix?d:this.widgetEventPrefix+d);c=p.Event(c);c.type=f;if(c.originalEvent){for(var e=p.event.props.length,a;e;){a=p.event.props[--e];c[a]=c.originalEvent[a]}}this.element.trigger(c,b);return !(p.isFunction(g)&&g.call(this.element[0],c,b)===false||c.isDefaultPrevented())}};p.widget.defaults={disabled:false};p.ui.mouse={_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});if(p.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(p.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};if(d.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(d));this._mouseDownEvent=d;var a=this,c=(d.which==1),b=(typeof this.options.cancel=="string"?p(d.target).parents().add(d.target).filter(this.options.cancel).length:false);if(!c||b||!this._mouseCapture(d)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){a.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(d)!==false);if(!this._mouseStarted){d.preventDefault();return true}}this._mouseMoveDelegate=function(e){return a._mouseMove(e)};this._mouseUpDelegate=function(e){return a._mouseUp(e)};p(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(p.browser.safari||d.preventDefault());d.originalEvent.mouseHandled=true;return true},_mouseMove:function(a){if(p.browser.msie&&!a.button){return this._mouseUp(a)}if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,a)!==false);(this._mouseStarted?this._mouseDrag(a):this._mouseUp(a))}return !this._mouseStarted},_mouseUp:function(a){p(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(a.target==this._mouseDownEvent.target);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return(Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance)},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return true}};p.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(b){b.widget("ui.slider",b.extend({},b.ui.mouse,{_init:function(){var a=this,d=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=b([]);if(d.range){if(d.range===true){this.range=b("
");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!=2){d.values=[d.values[0],d.values[0]]}}else{this.range=b("
")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range=="min"||d.range=="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}if(b(".ui-slider-handle",this.element).length==0){b('').appendTo(this.element).addClass("ui-slider-handle")}if(d.values&&d.values.length){while(b(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(c){b(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var m=true;var n=b(this).data("index.ui-slider-handle");if(a.options.disabled){return}switch(c.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:m=false;if(!a._keySliding){a._keySliding=true;b(this).addClass("ui-state-active");a._start(c,n)}break}var l,j,k=a._step();if(a.options.values&&a.options.values.length){l=j=a.values(n)}else{l=j=a.value()}switch(c.keyCode){case b.ui.keyCode.HOME:j=a._valueMin();break;case b.ui.keyCode.END:j=a._valueMax();break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(l==a._valueMax()){return}j=l+k;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(l==a._valueMin()){return}j=l-k;break}a._slide(c,n,j);return m}).keyup(function(c){var f=b(this).data("index.ui-slider-handle");if(a._keySliding){a._stop(c,f);a._change(c,f);a._keySliding=false;b(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(t){var s=this.options;if(s.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var p={x:t.pageX,y:t.pageY};var n=this._normValueFromMouse(p);var a=this._valueMax()-this._valueMin()+1,r;var m=this,o;this.handles.each(function(d){var c=Math.abs(n-m.values(d));if(a>c){a=c;r=b(this);o=d}});if(s.range==true&&this.values(1)==s.min){r=b(this.handles[++o])}this._start(t,o);m._handleIndex=o;r.addClass("ui-state-active").focus();var q=r.offset();var l=!b(t.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=l?{left:0,top:0}:{left:t.pageX-q.left-(r.width()/2),top:t.pageY-q.top-(r.height()/2)-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)};n=this._normValueFromMouse(p);this._slide(t,o,n);return true},_mouseStart:function(a){return true},_mouseDrag:function(e){var a={x:e.pageX,y:e.pageY};var f=this._normValueFromMouse(a);this._slide(e,this._handleIndex,f);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(k){var l,n;if("horizontal"==this.orientation){l=this.elementSize.width;n=k.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{l=this.elementSize.height;n=k.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var a=(n/l);if(a>1){a=1}if(a<0){a=0}if("vertical"==this.orientation){a=1-a}var j=this._valueMax()-this._valueMin(),m=a*j,o=m%this.options.step,p=this._valueMin()+m-o;if(o>(this.options.step/2)){p+=this.options.step}return parseFloat(p.toFixed(5))},_start:function(e,f){var a={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){a.value=this.values(f);a.values=this.values()}this._trigger("start",e,a)},_slide:function(l,m,a){var k=this.handles[m];if(this.options.values&&this.options.values.length){var n=this.values(m?0:1);if((m==0&&a>=n)||(m==1&&a<=n)){a=n}if(a!=this.values(m)){var i=this.values();i[m]=a;var j=this._trigger("slide",l,{handle:this.handles[m],value:a,values:i});var n=this.values(m?0:1);if(j!==false){this.values(m,a,(l.type=="mousedown"&&this.options.animate),true)}}}else{if(a!=this.value()){var j=this._trigger("slide",l,{handle:this.handles[m],value:a});if(j!==false){this._setData("value",a,(l.type=="mousedown"&&this.options.animate))}}}},_stop:function(e,f){var a={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){a.value=this.values(f);a.values=this.values()}this._trigger("stop",e,a)},_change:function(e,f){var a={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){a.value=this.values(f);a.values=this.values()}this._trigger("change",e,a)},value:function(a){if(arguments.length){this._setData("value",a);this._change(null,0)}return this._value()},values:function(a,f,h,g){if(arguments.length>1){this.options.values[a]=f;this._refreshValue(h);if(!g){this._change(null,a)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(a)}else{return this.value()}}else{return this._values()}},_setData:function(a,e,f){b.widget.prototype._setData.apply(this,arguments);switch(a){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(f);break;case"value":this._refreshValue(f);break}},_step:function(){var a=this.options.step;return a},_value:function(){var a=this.options.value;if(athis._valueMax()){a=this._valueMax()}return a},_values:function(a){if(arguments.length){var d=this.options.values[a];if(dthis._valueMax()){d=this._valueMax()}return d}else{return this.options.values}},_valueMin:function(){var a=this.options.min;return a},_valueMax:function(){var a=this.options.max;return a},_refreshValue:function(n){var v=this.options.range,m=this.options,p=this;if(this.options.values&&this.options.values.length){var s,t;this.handles.each(function(e,c){var f=(p.values(e)-p._valueMin())/(p._valueMax()-p._valueMin())*100;var d={};d[p.orientation=="horizontal"?"left":"bottom"]=f+"%";b(this).stop(1,1)[n?"animate":"css"](d,m.animate);if(p.options.range===true){if(p.orientation=="horizontal"){(e==0)&&p.range.stop(1,1)[n?"animate":"css"]({left:f+"%"},m.animate);(e==1)&&p.range[n?"animate":"css"]({width:(f-lastValPercent)+"%"},{queue:false,duration:m.animate})}else{(e==0)&&p.range.stop(1,1)[n?"animate":"css"]({bottom:(f)+"%"},m.animate);(e==1)&&p.range[n?"animate":"css"]({height:(f-lastValPercent)+"%"},{queue:false,duration:m.animate})}}lastValPercent=f})}else{var r=this.value(),u=this._valueMin(),q=this._valueMax(),a=q!=u?(r-u)/(q-u)*100:0;var o={};o[p.orientation=="horizontal"?"left":"bottom"]=a+"%";this.handle.stop(1,1)[n?"animate":"css"](o,m.animate);(v=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[n?"animate":"css"]({width:a+"%"},m.animate);(v=="max")&&(this.orientation=="horizontal")&&this.range[n?"animate":"css"]({width:(100-a)+"%"},{queue:false,duration:m.animate});(v=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[n?"animate":"css"]({height:a+"%"},m.animate);(v=="max")&&(this.orientation=="vertical")&&this.range[n?"animate":"css"]({height:(100-a)+"%"},{queue:false,duration:m.animate})}}}));b.extend(b.ui.slider,{getter:"value values",version:"1.7.1",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);$(document.ready=function(){$(".gallerydetailcontc img").lazyload({placeholder:gBaseUrl+"public/images/loader2.gif",threshold:100});starRating.create(".starating");$(".rat").hover(function(){starRating.showUserRating(".starating")},function(){starRating.showAvarageRating(".starating")});starRating.showAvarageRating(".starating");if($("#direction").length){$("#direction").autogrow({lineHeight:15})}$("[act='delete_design']").click(delete_design);$('[act="feature_design"]').click(feature_design);$('[act="publish_design"]').click(publish_design);$('[act="critique_design"]').click(critique_design);$('[act="favourite"]').click(favourite);$('[act="move_to_collection"]').click(move_to_collection);$('[act="move_to_design"]').click(move_to_design);$(".morelink").click(function(){$(this).hide();var a=$(this).parent().find(".cont").html();var b=$(this).parent().find(".cont-extnded").html();$(this).parent().find(".cont").html(b);$(this).parent().find(".cont-extnded").html(a);$(".lesslink").show()});$(".lesslink").click(function(){var b=$(this).parent().find(".cont").html();var a=$(this).parent().find(".cont-extnded").html();$(this).parent().find(".cont-extnded").html(b);$(this).parent().find(".cont").html(a);$(this).parent().find(".morelink").show();$(this).hide();$(".morelink").show()})});var starRating={create:function(a){$(a).each(function(){$(".starating").find("a").each(function(b){var d=$("#userRating").val();var c=$("#avgRating").val();var e=$(this).attr("title");if(d==0){$(this).click(rateClickHandler);$(this).hover(function(){$(this).prevAll().andSelf().removeClass("unrated");$(this).prevAll().andSelf().addClass("ratingdone")},function(){$(this).siblings().andSelf().removeClass("ratingdone");$(this).siblings().andSelf().addClass("unrated")})}})})},showAvarageRating:function(a){var b=$("#totalVotes").val();$("#ratingText").html("Average Rating ( "+b+" Votes)");var c=$("#avgRating").val();$(a).each(function(){$(".starating").find("a").each(function(d){if($(this).attr("title")==c){$(this).prevAll().andSelf().removeClass("unrated");$(this).prevAll().andSelf().addClass("ratingdone")}else{$(this).nextAll().andSelf().removeClass("ratingdone");$(this).nextAll().andSelf().addClass("unrated")}})})},showUserRating:function(a){var b=$("#userRating").val();if(b!=0){$("#ratingText").html("You Rated")}else{$("#ratingText").html("Add Your Rating")}$(a).each(function(){$(".starating").find("a").each(function(c){if($(this).attr("title")==b){$(this).prevAll().andSelf().removeClass("unrated");$(this).prevAll().andSelf().addClass("ratingdone")}else{$(this).nextAll().andSelf().removeClass("ratingdone");$(this).nextAll().andSelf().addClass("unrated")}})})}};function rateClickHandler(b){var a=$(this).parent();submitrating($(this));a.children().removeClass("ratingdone");$(this).prevAll().andSelf().addClass("ratingdone");$(".starating").find("a").each(function(){$(this).unbind("click");$(this).unbind("mouseenter mouseleave")});b.preventDefault()}function submitrating(obj){var rating=obj.attr("title");var obj_id=$("#contentId").val();var objType=$("#contentType").val();var name="";var website="";var profile_pic="";var thirdPartyLogin=$(".thirdPartyLogin").val();if(thirdPartyLogin==1){name=$("#txtVName").val();website=$("#txtVWebsite").val();profile_pic=$("#txtVAvatar").val()}$.post(gBaseUrl+"ajaxhandler/ratethecontent.html",{obj_id:obj_id,obj_type:objType,rating:rating,thirdPartyLogin:thirdPartyLogin,name:name,website:website,profile_pic:profile_pic},function(data){eval("var ret = "+data);if(ret.ret==0){$("#userRating").val(rating);$("#avgRating").val(ret.avgrating);$("#totalVotes").val(ret.totalVotes);$("#ratingText").removeClass("ar").addClass("ara");$("#ratingText").html("You rated")}else{showModalMessage(this,"Alert!",ret.msg)}})}function counterUpdate(d,h,g){var a=d?d:"direction";var i=h?h:"charcounter";var f=g?g:1024;var e=document.getElementById(a);var b=document.getElementById(i);var c=e.value.length;if(b){b.innerHTML=c}if(c>140){$("#charcounter").css("color","#007700")}else{$("#charcounter").css("color","#AFA093")}}function delete_design(){$("#confirmDiv").children("h2").html("Hold on a Second!");$("#confirmDiv").children("h3").html("Are you sure you want to delete this design ?");openmodalpopup(this,"confirmDiv");$("#conifrmYes").click(function(){$("#conifrmYes").unbind("click");$("[act='delete_design']").unbind("click");var a=$("#contentId").val();var c=$("#contentType").val();var b="";if($("#nextDesignUrl").length){b=$("#nextDesignUrl").val()}$.post(gBaseUrl+"ajaxhandler/deleteContent.html",{objId:a,objType:c},function(d){if(b!=""){window.location.href=b}else{if(c==1){window.location.href=gBaseUrl+"gallery.html"}else{if(c==9){window.location.href=gBaseUrl+"collections.html"}}}})});$("#conifrmNo").click(function(){$(this).parents(".infopopup").hide(0);$("#conifrmYes").unbind("click")})}function feature_design(){$("[act='feature_design']").unbind("click");var designId=$("#contentId").val();var operation=$(this).attr("operation");var type=$(this).attr("type");$.post(gBaseUrl+"ajaxhandler/designFeature.html",{designId:designId,operation:operation,type:type},function(data){eval("ret = "+data);if(ret.ret==0){var e=$("[act='feature_design']");if(operation==1){e.find("a").html("unFeature This");e.attr("operation",0)}else{e.find("a").html("Feature This");e.attr("operation",1)}}else{if(ret.ret==1){$("#messageDiv").children("h2").html("Alert");$("#messageDiv").children("h3").html(ret.msg);openmodalpopup(this,"messageDiv")}else{if(ret.ret==2){$("#confirmDiv").children("h2").html("Hold on a Second!");$("#confirmDiv").children("h3").html(ret.msg);openmodalpopup(this,"confirmDiv");$("#conifrmYes").attr("operation",operation);$("#conifrmYes").attr("type",0);$("#conifrmYes").click(feature_design);$("#conifrmNo").click(function(){$(this).parents(".infopopup").hide(0);$("#conifrmYes").unbind("click");$("#conifrmYes").attr("cid",0)})}}}$('[act="feature_design"]').click(feature_design)})}function publish_design(){$("[act='publish_design']").unbind("click");var e=$(this);var objId=$("#contentId").val();var operation=e.attr("operation");var objType=$("#contentType").val();$.post(gBaseUrl+"ajaxhandler/designPublish.html",{objId:objId,operation:operation,objType:objType,},function(data){eval("ret = "+data);if(ret.ret==0){if(operation==1){$('a[act="publish_design"]').html("Unpublish");e.attr("operation",0)}else{$('a[act="publish_design"]').html("Publish this");e.attr("operation",1)}}else{$("#messageDiv").children("h2").html("Alert");$("#messageDiv").children("h3").html(ret.msg);openmodalpopup(this,"messageDiv")}$('[act="publish_design"]').click(publish_design)})}function critique_design(){$("[act='critique_design']").unbind("click");var e=$(this);var designId=$("#contentId").val();var operation=e.attr("operation");$.post(gBaseUrl+"ajaxhandler/addcritiquethis.html",{designId:designId,operation:operation},function(data){eval("ret = "+data);if(ret.ret==0){if(operation==1){e.find("a").html("Remove from DCCP");e.attr("operation",0)}else{e.find("a").html("Add to DCCP");e.attr("operation",1)}}else{$("#messageDiv").children("h2").html("Alert");$("#messageDiv").children("h3").html(ret.msg);openmodalpopup(this,"messageDiv")}$('[act="critique_design"]').click(critique_design)})}function favourite(){if(!isLoggedIn){showModalMessage(this,"Whoa, Please Sign in!","Please Sign in to perform this activity.");return}$("[act='favourite']").unbind("click");var e=$(this);var objId=e.attr("oid");var objType=e.attr("otype");var operation=e.attr("operation");var touser_id=e.attr("touserid");$.post(gBaseUrl+"ajaxhandler/addtofavorite.html",{objId:objId,objType:objType,operation:operation,touser_id:touser_id},function(data){eval("ret = "+data);if(ret.ret==0){if(objType==9){e.parent().find("span").html(ret.newNum+" Collected")}else{e.parent().find("span").html(ret.newNum+" Faves")}if(operation==1){if(objType==9){e.html("You collected")}else{e.html("You faved")}e.removeClass("af").addClass("afa");e.attr("operation",0)}else{if(objType==9){e.html("Collect this")}else{e.html("Fave this")}e.removeClass("afa").addClass("af");e.attr("operation",1)}}else{$("#messageDiv").children("h2").html("Alert");$("#messageDiv").children("h3").html(ret.msg);openmodalpopup(this,"messageDiv")}$('[act="favourite"]').click(favourite)})}function move_to_collection(){var isAdminUser=$("#isAdminUser").val();if(!isAdminUser){showModalMessage(this,"Whoa","You are not authorized to perform this operation.");return}$("[act='move_to_collection']").unbind("click");var objId=$("#contentId").val();openmodalpopup(this,"loaderpopup","opaquediv");$.post(gBaseUrl+"ajaxhandler/move_to_collection",{objId:objId},function(data){eval("ret = "+data);if(ret.ret==0){window.location=ret.href}})}function move_to_design(){var isAdminUser=$("#isAdminUser").val();if(!isAdminUser){showModalMessage(this,"Whoa","You are not authorized to perform this operation.");return}$("[act='move_to_design']").unbind("click");var objId=$("#contentId").val();openmodalpopup(this,"loaderpopup","opaquediv");$.post(gBaseUrl+"ajaxhandler/move_to_design",{objId:objId},function(data){eval("ret = "+data);if(ret.ret==0){window.location=ret.href}})};(function(b){b.fn.lazyload=function(a){var f={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(a){b.extend(f,a)}var e=this;if("scroll"==f.event){b(f.container).bind("scroll",function(c){var h=0;e.each(function(){if(b.abovethetop(this,f)||b.leftofbegin(this,f)){}else{if(!b.belowthefold(this,f)&&!b.rightoffold(this,f)){b(this).trigger("appear")}else{if(h++>f.failurelimit){return false}}}});var d=b.grep(e,function(g){return !g.loaded});e=b(d)})}this.each(function(){var c=this;if(undefined==b(c).attr("original")){b(c).attr("original",b(c).attr("src"))}if("scroll"!=f.event||undefined==b(c).attr("src")||f.placeholder==b(c).attr("src")||(b.abovethetop(c,f)||b.leftofbegin(c,f)||b.belowthefold(c,f)||b.rightoffold(c,f))){if(f.placeholder){b(c).attr("src",f.placeholder)}else{b(c).removeAttr("src")}c.loaded=false}else{c.loaded=true}b(c).one("appear",function(){if(!this.loaded){b("").bind("load",function(){b(c).hide().attr("src",b(c).attr("original"))[f.effect](f.effectspeed);c.loaded=true}).attr("src",b(c).attr("original"))}});if("scroll"!=f.event){b(c).bind(f.event,function(d){if(!c.loaded){b(c).trigger("appear")}})}});b(f.container).trigger(f.event);return this};b.belowthefold=function(f,e){if(e.container===undefined||e.container===window){var a=b(window).height()+b(window).scrollTop()}else{var a=b(e.container).offset().top+b(e.container).height()}return a<=b(f).offset().top-e.threshold};b.rightoffold=function(f,e){if(e.container===undefined||e.container===window){var a=b(window).width()+b(window).scrollLeft()}else{var a=b(e.container).offset().left+b(e.container).width()}return a<=b(f).offset().left-e.threshold};b.abovethetop=function(f,e){if(e.container===undefined||e.container===window){var a=b(window).scrollTop()}else{var a=b(e.container).offset().top}return a>=b(f).offset().top+e.threshold+b(f).height()};b.leftofbegin=function(f,e){if(e.container===undefined||e.container===window){var a=b(window).scrollLeft()}else{var a=b(e.container).offset().left}return a>=b(f).offset().left+e.threshold+b(f).width()};b.extend(b.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);$(document.ready=function(){ if($("#direction").length) $("#direction").autogrow({'lineHeight':15}); $(".pagingul>li>a").unbind("href"); $(".pagingul>li>a").click(function(e){get_commentPage($(this));e.preventDefault(); e.stopPropagation();}); $("#btnSubmit").click(submitComment); $(".options li").click(optionHandler); $(".links").click(showReplies); $(".replyCancel").click(replyCancel); $(".replySubmit").click(submitReply); $("#showExpertPopup").click(function(){ showModalMessage(this, "What is an Expert?", "An expert is a community-chosen creative who continually provides great critiques. Each time you post a great critique and someone marks it as a Best Critique, you move up the ladder in expertdom!"); }); }) function checkcritique(content) { var newword = new Array(); var words = content.split(" "); var index = 0; if(words.length == 0) return 0; for(var j=0; j < words.length; j++) { var word = words[j]; var char,prevchar="",repeated=0; for(var i=0; i < word.length; i++) { char = word.substring(i,i+1); if(prevchar != char){ repeated = 0; prevchar = char; }else{ repeated++; } if(repeated > 3){ showModalMessage(this, "Whoops!", "Sorry, excessively repeated characters are not allowed."); return 0; } } if(word.length != 0){ newword[index] = word; index++; } newword[index] = " "; index++; } var returnW = newword.join(""); return returnW; } function submitComment(){ var thirdPartyLogin = $("#thirdPartyLogin").val(); if(isLoggedIn != 1 && thirdPartyLogin != 1){ showModalMessage(this, "Whoops!", "You are required to login to comment."); $(".inbtn").animate({opacity:'1'}); return; } var e = $(this); var content = $.trim($("#direction").val()); var type = $("#postToType").val(); if(content == ""){ showModalMessage(this, "Whoops!", "Please enter comment."); $(".inbtn").animate({opacity:'1'}); $("#direction").focus(); return false; } if( type == 0 ){ var alreadyCommented = $("#alreadyCommented").val(); if(alreadyCommented == 0 && content.length < 140){ showModalMessage(this, "Please be Insightful & Constructive", "To encourage constructive and insightful critiques, we'd ask that your critique be no less than 140 characters. Thanks!"); $(".inbtn").animate({opacity:'1'}); $("#direction").focus(); return false; }else if(alreadyCommented == 0){ content = checkcritique(content); if(content == 0 || content.length < 140){ showModalMessage(this, "Please be Insightful & Constructive", "To encourage constructive and insightful critiques, we'd ask that your critique be no less than 140 characters. Thanks!"); $(".inbtn").animate({opacity:'1'}); $("#direction").focus(); return false; } } } $("#btnSubmit").unbind("click"); var contentId = $("#contentId").val(); var name = ""; var email = ""; var website = ""; var profile_pic = ""; if(thirdPartyLogin == 1){ name = $("#txtVName").val(); website = $("#txtVWebsite").val(); profile_pic = $("#txtVAvatar").val(); } $.post(gBaseUrl+'/comment/saveComment.html', { "ContentId": contentId, "Content": content, "postToType": type, "name": name, "email": email, "website": website, "profile_pic": profile_pic, "isLoggedIn": isLoggedIn }, function(data){ eval("commentData = "+data); $("#btnSubmit").click(submitComment); if(commentData.success == 1){ showModalMessage(this, "Error!", "Unable to save comment."); $(".inbtn").animate({opacity:'1'}); return; } if( type != 9){ var totalComments = parseInt($("#totalComments").html()); $("#totalComments").html(totalComments+1); } if( type == 0){ var txtField=document.getElementById("charcounter"); if(txtField) txtField.innerHTML=0; } if($("#nocommentmsg").length != 0) $("#nocommentmsg").hide(); $("#direction").val(""); $("#commentList").prepend(commentData.html); $(".links").click(showReplies); $(".options li").click(optionHandler); $(".replyCancel").click(replyCancel); $(".replySubmit").click(submitReply); }); return; } function submitReply() { var e = $(this); var thirdPartyLogin = $("#thirdPartyLogin").val(); var textareaobject = e.parent().siblings().children("textarea"); if(isLoggedIn != 1 && thirdPartyLogin != 1){ showModalMessage(this, "Whoops!", "You are required to login to reply to a comment."); $(".inbtn").animate({opacity:'1'}); textareaobject.focus(); return; } var content = $.trim(textareaobject.val()); var type = $("#postToType").val(); if(content == ""){ showModalMessage(this, "Whoops!", "Please enter reply."); $(".inbtn").animate({opacity:'1'}); textareaobject.focus(); return false; } $(".replySubmit").unbind("click"); var contentId = $("#contentId").val(); var commentId = textareaobject.attr("id"); var name = ""; var email = ""; var website = ""; var profile_pic = ""; if(thirdPartyLogin == 1){ name = $("#txtVName").val(); website = $("#txtVWebsite").val(); profile_pic = $("#txtVAvatar").val(); } $.post(gBaseUrl+'/comment/saveReply.html', { "ContentId": contentId, "CommentId": commentId, "Content": content, "postToType": type, "name": name, "email": email, "website": website, "profile_pic": profile_pic, "isLoggedIn": isLoggedIn, "fromprofile":0 }, function(data){ eval("commentData = "+data); $(".replySubmit").click(submitReply); if(commentData.success == 1){ showModalMessage(this, "Error!", "Unable to save reply."); $(".inbtn").animate({opacity:'1'}); textareaobject.val(commentData.content) ; return; } textareaobject.val(""); $("#count"+commentId).html(parseInt($("#count"+commentId).html())+1); $("#count"+commentId).parent().parent().show(); $("#replyBox"+commentId).hide(); $("#replyList"+commentId).prepend(commentData.html); $(".links").click(showReplies); $(".options li").click(optionHandler); $(".replyCancel").click(replyCancel); $(".replySubmit").click(submitReply); }); return; } function showReplies() { var e = $(this); var commentId = e.parent().parent().attr("id"); if($("#replyList"+commentId).css("display") == "none"){ $("#replyList"+commentId).show(); } else $("#replyList"+commentId).hide(); } function replyCancel(){ //var commentId = $(this).parent().siblings().children("textarea").attr("id"); var commentId=$(this).parent().attr("id"); if($("#replyBox"+commentId).css("display") == "none") $("#replyBox"+commentId).show(); else $("#replyBox"+commentId).hide(); } function optionHandler() { var e = $(this); var commentId = e.parent().parent().attr("id"); switch($(this).attr("name")) { case "reply": { if($("#replyBox"+commentId).css("display") == "none"){ $("#replyBox"+commentId).show(); var scrollto = $("#replyBox"+commentId).offset(); document.documentElement.scrollTop = scrollto.top - 300; document.body.scrollTop = scrollto.top - 300;; } else $("#replyBox"+commentId).hide(); } break; case "delete": { if($("#isAdminUser").val() == 1){ $("#confirmDiv").children("h2").html("Hold on a Second!"); $("#confirmDiv").children("h3").html("Are you sure you want to delete this comment ?"); openmodalpopup(this, "confirmDiv"); $("#conifrmYes").click(function(){ $("#conifrmYes").unbind("click"); $.post(gBaseUrl+'/comment/deleteComment.html',{"CommentId":commentId},function(data){ var type = $("#postToType").val(); if(data == "1"){ $("#wrapper"+commentId).slideUp("slow",function(){$(this).remove()}); if(type != 9){ var totalComments = parseInt($("#totalComments").html()); $("#totalComments").html(totalComments-1); } } }); }); $("#conifrmNo").click(function(){ $(this).parents('.infopopup').hide(0); $("#conifrmYes").unbind("click"); }); } } break; case "spam": { if($("#isAdminUser").val() == 1){ $("#confirmDiv").children("h2").html("Hold on a Second!"); $("#confirmDiv").children("h3").html("Are you sure you want to merk this comment as spam ?"); openmodalpopup(this, "confirmDiv"); $("#conifrmYes").click(function(){ $("#conifrmYes").unbind("click"); $.post(gBaseUrl+'/comment/spamComment',{"CommentId":commentId},function(data){ if(data == "1"){ $("#wrapper"+commentId).slideUp("slow",function(){$(this).remove()}); } }); }); $("#conifrmNo").click(function(){ $(this).parents('.infopopup').hide(0); $("#conifrmYes").unbind("click"); }); } } break; case "expertCritique": { var objId = e.attr("oid"); var objType = e.attr("commentType"); var operation = e.attr("operation"); var touser_id = e.attr("touser_id"); $.post(gBaseUrl+"ajaxhandler/addtofavorite.html", {"objId":objId,"objType":objType,"operation":operation,"touser_id":touser_id}, function(data){ eval("ret = "+data); if(ret.ret == 0){ if(operation == 1){ e.attr("operation",0); e.find("a").removeClass("commfav").addClass("commfavd"); }else{ e.attr("operation",1); e.find("a").removeClass("commfavd").addClass("commfav"); } e.find("span").html(ret.newNum); }else{ showModalMessage(this, "Alert!", ret.msg); } }); } break; case "approve": { $.post(gBaseUrl+"ajaxhandler/approverecommendation.html", {"commentId":commentId}, function(data){ eval("ret = "+data); if(ret.ret == 0){ showModalMessage(this, "Success!", "Approved the recommendation."); e.hide(); }else{ showModalMessage(this, "Alert!", ret.msg); } }); } break; } } function get_commentPage(object) { if(object.attr("href") == "#") return ; var newpage = object.attr("href"); var contentId = $("#contentId").val(); var contentType = ""; if($("#contentType").length) contentType = $("#contentType").val(); var postToType = $("#postToType").val(); var contentOwnerId = $("#contentOwnerId").val() $.post(gBaseUrl+"/comment/getCommentPage.html", {"page":newpage, "contentId" : contentId, "postToType" : postToType, "contentType" : contentType, "contentOwnerId" : contentOwnerId}, function(data){ eval("var ret="+data); $("#commentMainDiv").html(ret.html); $("#commentPagination").html(ret.pageurl); $(".pagingul>li>a").unbind("href"); $(".pagingul>li>a").click(function(e){get_commentPage($(this));e.preventDefault(); e.stopPropagation();}); if($("#direction").length) $("#direction").autogrow({'lineHeight':15}); $("#btnSubmit").click(submitComment); $(".options li").click(optionHandler); $(".links").click(showReplies); $(".replyCancel").click(replyCancel); $(".replySubmit").click(submitReply); }); }(function(c){var d=null;c.fn.autogrow=function(a){return this.each(function(){new c.autogrow(this,a)})};c.autogrow=function(b,a){this.options=a||{};this.dummy=null;this.interval=null;this.line_height=this.options.lineHeight||parseInt(c(b).css("line-height"));this.min_height=this.options.minHeight||parseInt(c(b).css("min-height"));this.max_height=this.options.maxHeight||parseInt(c(b).css("max-height"));this.textarea=c(b);this.expand_tolerance=(!isNaN(this.options.expandTolerance)&&this.options.expandTolerance>0)?this.options.expandTolerance:4;if(isNaN(this.line_height)){this.line_height=0}this.init()};c.autogrow.fn=c.autogrow.prototype={autogrow:"1.2.3"};c.autogrow.fn.extend=c.autogrow.extend=c.extend;c.autogrow.fn.extend({init:function(){var a=this;this.textarea.css({overflow:"hidden",display:"block"});this.textarea.bind("focus",function(){a.startExpand()}).bind("blur",function(){a.stopExpand()});this.checkExpand()},startExpand:function(){var a=this;this.interval=window.setInterval(function(){a.checkExpand()},400)},stopExpand:function(){clearInterval(this.interval)},checkExpand:function(){if(this.dummy==null){this.dummy=c("
");this.dummy.css({"font-size":this.textarea.css("font-size"),"font-family":this.textarea.css("font-family"),width:this.textarea.css("width"),padding:this.textarea.css("padding"),"line-height":this.line_height+"px","overflow-x":"hidden",position:"absolute",top:0,left:-9999}).appendTo("body")}else{this.dummy.show()}var a=this.textarea.val().replace(/(<|>)/g,"");if(c.browser.msie){a=a.replace(/\n/g,"
new")}else{a=a.replace(/\n/g,"
new")}if(this.dummy.html()!=a){this.dummy.html(a);if(this.max_height>0&&(this.dummy.height()+(this.expand_tolerance*this.line_height)>this.max_height)){this.textarea.css("overflow-y","auto");if(this.textarea.height()