0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeTypNZDb.isWindow(j))return false;if(j.constructor&& !F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;Ha ";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML=" ";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= 1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= "none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===truNZDa.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h
t -1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h =0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeTypNZD(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=NZD0;h =0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== 8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNodNZDd.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== "click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespacNZDd.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f -1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== 0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h 0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p 0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===truNZDy[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= l;g.sort(w);if(h)for(var i=1;i 0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p ":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.typNZDg.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- 0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n =0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== i},CLASS:function(g,i){return(" "+(g.classNamNZDg.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, g);else if(typeof g.length==="number")for(var p=g.length;n ";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML=" ";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=/function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& function(){var g=k,i=t.createElement("div");i.innerHTML="
";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= t.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassNamNZDg.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n 0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e -1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e -1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNodNZDd[0].parentNode.nodeType===11||!e[0]||!e[0].parentNodNZDe[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, 2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/ \s]+\/)>/g,P={option:[1, " "],legend:[1," "],thead:[1," "," "],tr:[2," ","
"],td:[3," ","
"],col:[2," ","
"],area:[1," "],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
",""];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespacNZD!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1> ");try{for(var b=0,d=this.length;b0||e.cacheablNZDthis.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClonNZD!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f 0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1> ");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===" "&&!x?r.childNodes:[];for(o=k.length- 1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].typNZDf[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/ ';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="
=5?' class="ui-datepicker-week-end"':"")+'> '+dayNamesMin[day]+" "}calender+=thead+" ";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate ";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="maxDate);tbody+=' "+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?' '+printDate.getDate()+" ":' =currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+" "))+" ':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?' ':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+=' "}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=' '+drawYear+" "}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+=' "}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRangNZD!inst.rangeStart?date:(!datNZDinst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart =minDate)&&(!maxDatNZDdate<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.titlNZDthis.originalTitlNZD" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c(" ")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c(' ').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c(" ")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c(" ").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c(' ').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=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=a([]);if(c.range){if(c.range===true){this.range=a(" ");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a(' ').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".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(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(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(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d 1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookiNZD(this.cookie=this.options.cookie.namNZD"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=/q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)NZD.hasClass("ui-state-disabled")NZD.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=/c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1 =b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:" ",spinner:" Loading… ",tabTemplate:'#{label} '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotatNZD(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i"); } if ($.fn.on === undefined) { $.fn.on = function (event, selector, foksiyon) { if (typeof selector === 'string') { this.find(selector).live(event, foksiyon); } else if (typeof selector === 'function') { this.live(event, selector); } }; } if ($.fn.draggable === undefined) { $.getScript('/theme/standart/js/jquery-ui-1.7.2.custom.min.js'); } if ($.fn.checkboxStyle === undefined) { $.fn.checkboxStyle = function (arr) { var aktif = 'AKTİF'; var pasif = 'PASİF'; if (arr != undefined) { if (arr.yes != undefined) { aktif = arr.yes; } if (arr.no != undefined) { pasif = arr.no; } } var html = ' '; this.each(function () { var name = $(this).attr('name'); var id = $(this).attr('id'); var val = $(this).is(':checked') ? 1 : 0; $(this).after(html); $(this).parent().find('.iphoneStyle:last input').attr('name', name); $(this).parent().find('.iphoneStyle:last input').attr('id', id); $(this).parent().find('.iphoneStyle:last input').val(val); $(this).remove(); if (name !== undefined) $(this).parent().find('.iphoneStyle:last .iChecked span').text(aktif); if (id !== undefined) $(this).parent().find('.iphoneStyle:last .iUnChecked span').text(pasif); }); $('.iphoneStyle').unbind('click').click(function () { var ml = parseInt($(this).find('.iphoneBoruHat').css('margin-left')); if (ml == 0) { ml = -40; $('.sliderLeft').css('visibility', 'hidden'); $(this).find('input').val(0); } else { ml = 0; $('.sliderRight').css('visibility', 'visible'); $(this).find('input').val(1); } $(this).parent().find('.iphoneStyle:last input').trigger('change'); $(this).find('.iphoneBoruHat').animate({ marginLeft: ml }, 300); }); }; } function merge_options(obj1, obj2) { var obj3 = {}; for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } return obj3; } function Message(options) { Message.counter = Message.counter || 0; var opt = { id: 'myDialog', title: '', html: '', timeout: 3500, width: 300, height: 'auto', buttons: [], openingEffect: 'drop', openingEffectTime: 600, openingEasing: 'easeOutBack', closingEffect: 'ckBottom', closingEffectTime: 600, closingEasing: 'swing', selector: '.ckDialog:last' }; var allowedEffects = ['tsoftTop', 'tsoftLeft', 'tsoftBottom', 'tsoftRight', 'blind', 'bounce', 'clip', 'drop', 'explode', 'fade', 'fold', 'highlight', 'puff', 'pulsate', 'scale', 'shake', 'size', 'slide', 'transfer']; var allowedEasing = ["linear", "swing", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInSine", "easeOutSine", "easeInOutSine", "easeInCirc", "easeOutCirc", "easeInOutCirc", "easeInElastic", "easeOutElastic", "easeInOutElastic", "easeInBack", "easeOutBack", "easeInOutBack", "easeInBounce", "easeOutBounce", "easeInOutBounce"]; for (var i in options) { opt[i] = options[i]; } this.get = function (key) { return opt[key]; }; this.set = function (key, val) { opt[key] = val; return true; }; var _this = this; Message.instance = Message.instance || {}; Message.instance['activeDialog'] = this; if (typeof Message.instance[_this.get('id')] !== 'undefined') { var selector = $(_this.get('selector')); var overlay = $('.ckOverlay:last'); selector.remove(); overlay.remove(); $('.ui-effects-wrapper').remove(); } Message.instance[_this.get('id')] = _this; Message.getInstance = function (id) { return Message.instance[id]; }; Message.showDialog = function (title, html, width, height) { var count = Object.keys(Message.instance).length + 1; var _setting = { id: 'myDialog_' + count, title: title, html: html, width: width > 100 ? width : 300, height: height > 0 ? height : 'auto', }; var _instance = new Message(_setting); _instance.show(); }; this.setDialogEvents = function () { $(_this.get('selector')).find('.ckClose').unbind('click').click(function () { _this.close(); }); }; this.close = function (selector) { var selector = $(_this.get('selector')); var overlay = $('.ckOverlay:last'); var top = $(document).scrollTop() + (($(window).height() - selector.height()) / 2) - 50; top = top > 0 ? top : 100; var left = ($(window).width() - selector.width()) / 2; var newTop = top; var newLeft = left; switch (_this.get('closingEffect')) { case "tsoftTop": newTop = -selector.height(); break; case "tsoftLeft": newLeft = -selector.width(); break; case "tsoftBottom": newTop = $(document).scrollTop() + $(window).height(); break; case "tsoftRight": newLeft = $(window).width(); break; } var fonk1 = function () { setTimeout(function () { overlay.remove(); $(_this.get('selector')).parents('.ckWrapper').remove(); $(_this.get('selector')).parent().remove(); }, 300); }; if ($.inArray(_this.get('closingEffect'), ['tsoftTop', 'tsoftLeft', 'tsoftBottom', 'tsoftRight']) > -1) { selector.animate({ left: newLeft, top: newTop }, _this.get('closingEffectTime'), _this.get('closingEasing'), fonk1); } else if ($.inArray(_this.get('closingEffect'), allowedEffects) > -1) { var options = { effect: _this.get('closingEffect'), easing: _this.get('closingEasing'), duration: _this.get('closingEffectTime'), complete: fonk1 }; if (_this.get('openingEffect') === "scale") { options.percent = 0; } else if (_this.get('openingEffect') === "transfer") { options.to = '.sepet:first'; //= {to: "#button", className: "ui-effects-transfer"}; options.className = 'ckDialog'; } else if (_this.get('openingEffect') === "size") { options.to = {width: 200, height: 60}; } var v = parseInt($.fn.jquery.replace(/\D/ig, '')); if (v > 170) { $(_this.get('selector')).hide(options); } else { $(_this.get('selector')).hide(options.effect, options, options.duration, options.complete); setTimeout(fonk1, _this.get('closingEffectTime')); } } else { fonk1(); } }; Message.debug = function (content, width, time_out) { if (time_out === undefined) time_out = 3000; if (width === undefined) width = 300; var mmm = new Message({html: content, width: width, id: 'debugDialog'}); mmm.set('openingEffect', 'none'); mmm.show(); $('.ckHeader:last').remove(); $('.ckContent:last').css('line-height', '20px'); $('.ckButtonArea:last').remove(); setTimeout(function () { mmm.close(); }, time_out); mmm.setDialogEvents(); }; this.callBack = function () {//Ajax isteÄŸinden sonra çalışır. return true; }; Message.notify = function (notice, success, timeout) { if (timeout === undefined) timeout = 3000; if (success === undefined) { success = 1; timeout = 2 * timeout; } $("body").append('AKTİFPASİF' + notice + ''); $(".ckNotify:last").css("top", $("body").height()); $(".ckNotify:last").animate({top: 20}, 1000, function () { }); var _this1 = $(".ckNotify:last"); setTimeout(function () { _this1.animate({opacity: 0}, 500, function () { $(this).remove(); }); }, timeout); }; this.refresh = function (key, value) { _this.set(key, value); switch (key) { case 'buttons' : _this.showButtons(); break; } return true; }; this.show = function () { var dialogId = _this.get('id'); _this.set('selector', '#' + dialogId); var height = _this.get('height'); var header = _this.get('title'); var content = _this.get('html'); var width = _this.get('width'); var z_index = Message.counter * 2 + 9980; Message.counter++; var maxHeight = Math.max($(window).height(), $('body').height(), $(document).height()); var html = '\n\\n\'; $('body').append(html); $('.ckContent:last button.tDialog').each(function () { var b = _this.get('buttons'); var myFn; if (typeof $(this).attr('onclick') === 'string') { var s = "function myFn(){ " + $(this).attr('onclick') + " }"; eval(s); } else { myFn = $(this).attr('onclick'); } b.push({text: $(this).text(), fn: myFn}); _this.set('buttons', b); $(this).remove(); }); _this.showButtons(); $(_this.get('selector')).find('.tDialog').remove(); if (height !== 'auto') { $('.ckContent').css({'max-height': height + 'px', 'overflow-y': 'auto'}); } var top = $(document).scrollTop() + (($(window).height() - $(_this.get('selector')).height()) / 2) - 10; top = top > 0 ? top : 100; var left = ($(window).width() - width) / 2; var newTop = top; var newLeft = left; switch (_this.get('openingEffect')) { case "tsoftTop": newTop = -$(_this.get('selector')).height(); break; case "tsoftLeft": newLeft = -$(_this.get('selector')).width(); break; case "tsoftBottom": newTop = $(document).scrollTop() + $(window).height(); break; case "tsoftRight": newLeft = $(window).width(); break; } $(_this.get('selector')).css({top: newTop, left: newLeft, width: width, 'z-index': z_index + 1}); if ($.inArray(_this.get('openingEffect'), ['tsoftTop', 'tsoftLeft', 'tsoftBottom', 'tsoftRight']) > -1) { var ef = typeof _this.get('openingEasing') === 'undefined' ? 'easeOutElastic' : _this.get('openingEasing'); $(_this.get('selector')).animate({ left: left, top: top }, _this.get('openingEffectTime'), _this.get('openingEasing'), function () { $(_this.get('selector')).draggable({handle: ".ckFooter:last"}); }); } else if ($.inArray(_this.get('openingEffect'), allowedEffects) > -1) { $(_this.get('selector')).css('min-height', $(_this.get('selector')).height()); $(_this.get('selector')).hide(); var options = { effect: _this.get('openingEffect'), easing: _this.get('openingEasing'), duration: _this.get('openingEffectTime'), complete: function () { $(_this.get('selector')).draggable({handle: ".ckFooter:last"}); } }; if (_this.get('openingEffect') === "scale") { options.percent = 0; } else if (_this.get('openingEffect') === "transfer") { options.to = '.sepet:first'; //= {to: "#button", className: "ui-effects-transfer"}; options.className = 'ckDialog'; } else if (_this.get('openingEffect') === "size") { options.to = {width: width}; } var v = parseInt($.fn.jquery.replace(/\D/ig, '')); if (v > 170) { $(_this.get('selector')).show(options); } else { $(_this.get('selector')).show(options.effect, options, options.duration, options.complete); } setTimeout(function () { $(_this.get('selector')).show('fast'); }, _this.get('openingEffectTime') + 100); } else { $(_this.get('selector')).show(); } _this.setDialogEvents(); return true; }; Message.addButtofn = function (name, func) { var b = _this.get('buttons'); if (typeof name !== 'undefined') { b.push({text: name, fn: func}); _this.set('buttons', b); } Message.instance.activeDialog.showButtons(name, func); }; this.showButtons = function () { var b = _this.get('buttons'); $(_this.get('selector')).find('.ckButtonArea button').remove(); var div = $(_this.get('selector')).find('.ckButtonArea'); for (var i = 0; i < b.length; i++) { var ad = b[i].text; var id = "button_" + (Message.counter * 100 + i); div.append(' '); $('#' + id).click(function () { var no = $(this).attr('data-number'); var func = _this.get('buttons')[no].fn || function (param) { return true; }; var selector = $(_this.get('selector')); if (func($('#' + id)) !== false) { _this.close(selector); } }); } $('.ckButtonArea button').css('position', 'relative'); return true; }; return this; } var Message1 = new Message({}); var TSOFT = { onEk: 'T_', btn_no: 0, dialogNumber: 0, callback: function () { }, settings: { openingEffect: 'clip', openingEffectTime: 600, openingEffectOptions: {easing: 'swing'}, closingEffect: 'clip', closingEffectTime: 600, closingEffectOptions: {easing: 'swing'} }, allowedEffects: ['none', 'tsoftTop', 'tsoftLeft', 'tsoftBottom', 'tsoftRight', 'blind', 'bounce', 'clip', 'drop', 'explode', 'fade', 'fold', 'highlight', 'puff', 'pulsate', 'scale', 'shake', 'size', 'slide', 'transfer'], allowedEasing: ["linear", "swing", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInSine", "easeOutSine", "easeInOutSine", "easeInCirc", "easeOutCirc", "easeInOutCirc", "easeInElastic", "easeOutElastic", "easeInOutElastic", "easeInBack", "easeOutBack", "easeInOutBack", "easeInBounce", "easeOutBounce", "easeInOutBounce"], counter: 0, buttons: new Array(), serialize: function (element) { var obj = {}; $(element).find('input,textarea,select').each(function () { if (typeof $(this).attr('name') !== 'undefined') { obj[$(this).attr('name')] = $(this).val(); if (typeof Ext !== 'undefined') { var el = Ext.getCmp($(this).attr('name')); if (typeof el !== 'undefined') { if (el.xtype === 'combobox') { obj[$(this).attr('name')] = el.getValue(); } else if (el.xtype === 'checkbox') { obj[$(this).attr('name')] = el.getSubmitValue(); } } } } }); return obj; }, setForm: function (arr) { for (var key in arr) { $('*[name=' + key + ']').val(arr[key]); if (typeof Ext !== 'undefined') { if (typeof Ext.getCmp(key) !== 'undefined' && Ext.getCmp(key).xtype === 'combobox') { var el = Ext.getCmp(key); el.setValue(arr[key].toString()); } } } }, replaceDiv: function (element) { var onEk = TSOFT.onEk; var d = $('body').find(element); var dizi2 = d.attr('class').split(/\s+/ig); for (var i = 0; i < dizi2.length; i++) { d.addClass(onEk + dizi2[i]); } d.find('div, span, a, button').each(function () { var cls = $(this).attr('class'); var dizi = cls.split(/\s+/ig); for (var i = 0; i < dizi.length; i++) { $(this).addClass(onEk + dizi[i]); } }); }, showUrl: function (url, header, width, callback) { if (header === undefined) header = "Sayfa"; if (width === undefined) width = 500; $.ajax({ url: url, success: function (msg) { TSOFT.showDialog(header, msg, width); callback(); } }); }, showDialog: function (header, content, width, height, recursive) { var count = Object.keys(Message.instance).length + 1; var _setting = { id: 'myDialog_' + count, title: header, html: content, width: width > 100 ? width : 300, height: height > 0 ? height : 'auto', openingEffect: TSOFT.settings.openingEffect, openingEffectTime: TSOFT.settings.openingEffectTime, openingEasing: TSOFT.settings.openingEffectOptions.easing, closingEffect: TSOFT.settings.closingEffect, closingEffectTime: TSOFT.settings.closingEffectTime, closingEasing: TSOFT.settings.closingEffectOptions.easing }; var _instance = new Message(_setting); _instance.show(); TSOFT.callback(); TSOFT.callback = function () { }; var cssVar = false; $('link').each(function () { if (/(compressed|acilir_pencere)\.css/ig.test($(this).attr('href'))) { cssVar = true; } }); var ckPos = $('.ckDialog').css('position'); if (typeof recursive === 'undefined' && (cssVar === false || (ckPos !== 'absolute' && ckPos !== 'relative'))) { var css = '/theme/standart/sub_theme/genel/astana/mavi/acilir_pencere.css?id=007'; $("head").append(" "); $("#pencereCss").load(function () { setTimeout(function () { cLog('acilir_pencere.css yok'); }, 300); }); return false; } }, addButton: function (name, func) { Message.addButtofn(name, func); }, debug: function (content, time_out, width) { if (typeof time_out === 'undefined') time_out = 3000; if (typeof width === 'undefined') width = 300; var count = Object.keys(Message.instance).length + 1; var _setting = { id: 'myDialog_' + count, title: '', html: content, width: width > 100 ? width : 300, openingEffect: 'none', closingEffect: 'none', closingEffectTime: 0, openingEffectTime: 0 }; var _instance = new Message(_setting); _instance.show(); $('#' + _setting.id).find('.ckContent').css('border', 'none').addClass('br6'); $('#' + _setting.id).find('.ckFooter').remove(); $('#' + _setting.id).find('.ckClose').remove(); $('#' + _setting.id).css('min-height', '20px'); $('#' + _setting.id).parent().click(function (e) { if ($(e.target).attr('class') !== 'ckDistance') { _instance.close(); } }); setTimeout(function () { _instance.close(); }, time_out); }, callBack: function () {//Ajax isteğinden sonra çalışır. return true; }, notify: function (notice, success, timeout) { if (timeout === undefined) timeout = 3000; if (success === undefined) { success = 1; timeout = 2 * timeout; } $("body").append('\n\\n\\n\\n\\n\ \n\\n\\n\' + content + '\n\' + notice + ''); $(".tNotify:last").css("top", $("body").height()); $(".tNotify:last").animate({top: 20}, 1000, function () { }); var _this = $(".tNotify:last"); setTimeout(function () { _this.animate({opacity: 0}, 500, function () { $(this).remove(); }); }, timeout); }, focusText: function (element) { $(element).each(function () { var deger = $(this).val(); $(this).focus(function () { if ($(this).val() === deger) $(this).val(''); }).focusout(function () { if ($(this).val() === '') $(this).val(deger); }); }); }, tableRender: function (element, cls) { if (cls == undefined) cls = "Tlist"; $(element).addClass(cls); $("table." + cls + " tbody tr:odd").addClass("odd"); $("table." + cls + " tbody tr:even").addClass("even"); }, pager: function (element, total, perpage, fonksiyon) { $(element).html(""); $(element).addClass("Tpager"); $(element).append(''); if (total <= perpage) return false; $(element).find("ul").append('
' + 1 + ' '); var totalWidth = $(element).width() > 150 ? $(element).width() : 150; var li = $(element).find('ul li'); var liWidth = li.width() + (parseInt(li.css('padding-left')) + parseInt(li.css('margin-left'))) * 2 + 7; var liCnt = parseInt(totalWidth / liWidth); var pageCnt = parseInt((total / perpage) + 1); for (var i = 1; i < pageCnt; i++) { var currentPage = i + 1; $(element).find("ul").append(' '); } $(element).find(".sayfa_1").after('... '); $(element).find(".sayfa_" + pageCnt).before('... '); $(element + " ul li.myPager").unbind('click').click(function () { var indis = parseInt($(this).text()); $(element + " ul li.myPager").hide(); $(element).find('.dot3').show(); $(element + " ul li").removeClass('selected'); $(this).addClass('selected'); var showPage = []; if (pageCnt < 9) { $(element).find('.dot3').hide(); for (var i = 1; i < pageCnt + 1; i++) { showPage.push(i); } } else if (indis < 5) { $(element).find('.dot3:first').hide(); showPage = [1, 2, 3, 4, 5, 6, 7, pageCnt]; } else if (indis + 4 > pageCnt) { $(element).find('.dot3:last').hide(); showPage = [1, pageCnt - 6, pageCnt - 5, pageCnt - 4, pageCnt - 3, pageCnt - 2, pageCnt - 1, pageCnt]; } else { showPage = [1, indis - 2, indis - 1, indis, indis + 1, indis + 2, pageCnt]; } for (var i in showPage) { $(element).find(".sayfa_" + showPage[i]).show(); } fonksiyon(parseInt(indis)); }); $(element + " ul li.myPager:first").trigger('click'); return false; }, numberFormat: function (number, digitCount) { var r = "" + number; while (r.length < digitCount) { r = "0" + r; } return r; }, linker: function (element) { $(element).each(function () { var link = window.location.href.replace(window.location.origin, ''); if (link == $(this).attr('href')) $(this).addClass('selected'); }); }, telephoneControl: function (number) { number = number + ""; if (/^(\+|00)/ig.test(number + "") && number.replace(/\D/ig, '').length > 7) { return number.indexOf('_') > 0 ? false : true; } if ((number.length == 10 && number.substr(0, 1) != 0) || (number.length == 11 && number.substr(0, 1) == 0) || number == "") { return true; } else { return false; } }, loadCss: function (path) { var cacheTag = getCookie('cacheTag'); if (typeof cacheTag === 'undefined') { $.get('/Y/mod/Settings/Other/getMaskedRevision', function (data) { cacheTag = data; setCookie('cacheTag', cacheTag, 10); var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = path + '?cacheTag=' + cacheTag; link.media = 'all'; $("head").append(link); }); } else { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = path + '?cacheTag=' + cacheTag; link.media = 'all'; $("head").append(link); } return true; } }; var Cart = { settings: { showHeaderCart: false, showAddCartPopup: false }, showHeaderCart: function () { if (Cart.settings.showHeaderCart === false) { return false; } var AcilirSepetHeight = 0; $('#cart-soft-count').parent().css({position: 'relative'}); $('#cart-soft-count').parents('div').css({overflow: 'visible'}); $('#cart-soft-count').mouseover(function () { if ($('.AcilirSepet').length > 0) { if ($('.AcilirSepet').height() === 0 && $('.AcilirSepet ul:first li').length > 0) { $('.AcilirSepet').show(); $('.AcilirSepet').animate({height: AcilirSepetHeight}, 500); } return true; } $.get('/srv/shopping/shopping/show-header-cart', function (content) { $('.AcilirSepet').remove(); $('#cart-soft-count').parent().append(content); AcilirSepetHeight = $('.AcilirSepet').height(); $('.AcilirSepet').height(0); if ($('.AcilirSepet ul:first li').length > 0) $('.AcilirSepet').animate({height: AcilirSepetHeight}, 500); }); }); $('#cart-soft-count').parent().parent().parent().mouseleave(function () { $('.AcilirSepet').animate({height: 0}, 500, function () { $('.AcilirSepet').hide(); }); }); }, changeNumber: function () { var a = function () { var input = $(this).parent().find('input.adet'); var adet = parseFloat(input.val().replace(/[^0-9\.]/ig, '')); adet = isNaN(adet) ? 1 : adet; var birim = input.val().replace(/\s*\d+\.?\d*?\s*/ig, ''); birim = birim === '' ? '' : ' ' + birim; var varsayilanArtis = $(this).hasClass('arti') ? 1 : -1; var artis = parseFloat($(this).attr('alt')); //parseInt($(this).parent().find('.arti').attr('alt')); artis = isNaN(artis) ? varsayilanArtis : artis; var sayi = adet + parseFloat(artis); if (sayi.toString().indexOf('.') > 0) { sayi = sayi.toFixed(2); } else { sayi = sayi.toFixed(0); } if (sayi < 0) return false; var sayiText = sayi.toString(); var adetStr = sayi + birim; if (sayi > 0.0) { input.val(adetStr); Cart.updateProduct(this); } }; $('.SepetTable .arti,.SepetTable .eksi').unbind('click').click(a); $('.SepetTable input.adet').blur(a); }, removeProduct: function () { $('.SepetTable .remove').unbind('click').click(function () { var _this = this; var sepet_id = $(_this).parents('.adetDiv').attr('data-id'); $.ajax({ url: '/srv/service/cart/remove/' + sepet_id, success: function (response) { response = JSON.parse(response); var current = parseInt($("#cart-soft-count span").html()); current = current - response.quantity; if (current == 0) { $("#cart-soft-count label").html('0,00'); } Cart.refresh(function () { $("#cart-soft-count span").html(current); $("#cart-soft-count label").html($(".SepetTutarTablo .second").html().replace(" TL", "")); }); } }); }); }, updateProduct: function (_this) { var pr_id = $(_this).parents('.adetDiv').attr('data-product'); var sub_pr_id = $(_this).parents('.adetDiv').attr('data-subproduct') || 0; var sepet_id = $(_this).parents('.adetDiv').attr('data-id'); var total_count = $(_this).parent().find('input.adet').val(); var tr = '.' + $(_this).parents('tr').attr('class'); $.ajax({ url: '/srv/service/cart/update-item/' + sepet_id + '/' + total_count, success: function (msg) { Cart.refresh(function () { Cart.fireRow($(tr)); }); } }); }, addRelatedProduct: function () { $('.tamamlayiciUrun .GenelButon').unbind('click').click(function (e) { e.preventDefault(); var productType = $(this).parents('.tamamlayiciUrun').attr('data-type'); var mainPrId = $(this).attr('alt').split('-'); var prId = parseInt(mainPrId[0]); var prSubId = mainPrId[2] ? parseInt(mainPrId[2]) : ''; mainPrId = parseInt(mainPrId[1]); var mainPrSubId = c_altUrunId(); mainPrId = mainPrSubId > 0 ? mainPrId + ':' + mainPrSubId : mainPrId; if (productType !== '4') { sepeteEkle(prId, prSubId, 1, '', ''); } else { sepeteEkle(prId, prSubId, 1, '', '', mainPrId); } sepeteEkle.showCartWin = false; Cart.refresh(function () { Cart.fireRow($('.SepetTable tr:last')); }); }); }, fireRow: function (element) { if (element.length < 1) { return true; } element.css('background-color', '#96E296'); setTimeout(function () { if (element.length < 1) { return true; } element.css('background-color', ''); }, 1000); }, setEvents: function () { Cart.removeProduct(); Cart.changeNumber(); Cart.addRelatedProduct(); }, refresh: function (callback) { $.get('/srv/shopping/shopping/show-cart-win', function (html) { var d = document.createElement('div'); $('.SepetIcerik:last').html($(d).append(html).find('.SepetIcerik').html()); Cart.setEvents(); if (typeof callback === 'function') callback(); }); }, show: function (tamamlayici_ana_urun_id) { if (Cart.settings.showAddCartPopup === false) { return false; } var clientBrowser = ''; try { clientBrowser = navigator.userAgent; } catch (error) { clientBrowser = 'not-set'; } var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(clientBrowser) ? true : false; if (isMobile) { window.location.href = '/Sepet.php'; return false; } $.get('/srv/shopping/shopping/show-cart-win/' + tamamlayici_ana_urun_id, function (html) { TSOFT.showDialog('', html, 864); setTimeout(function () { Cart.setEvents(); }, TSOFT.settings.openingEffectTime + 100); if (typeof $.fn.yukseklikEsitle !== 'undefined') { $('.TamamlayiciUrunler ul li').yukseklikEsitle(); } }); } }; var LANG = { prefix: 'LANG_', selected_lang: '', cookie_name: 'lang', last_lang_arr: new Array(), lang: {}, run: function (selectedKey) { if (typeof selectedKey !== 'undefined') { LANG.insert([selectedKey]); return true; } $('span[class^=' + LANG.prefix + ']').css('color', 'inherit'); $('span[class^=' + LANG.prefix + ']').each(function () { var key = $(this).attr('class').trim(); key = key.replace(LANG.prefix, ''); var text = LANG.get(key) || ''; var replaceArr = text.match(/\|(.*?)\|/ig); $(this).addClass('reset'); if (null === replaceArr) { return false; } for (var i = 0; i < replaceArr.length; i++) { var replaceKey = replaceArr[i].replace(/\|/g, ''); if ($(this).attr('data-' + replaceKey)) { text = text.replace(replaceArr[i], $(this).attr('data-' + replaceKey)); } } $(this).text(text); $(this).removeClass(LANG.prefix + key); }); setTimeout(function () { $('span[class^=' + LANG.prefix + ']').css('color', 'inherit'); }, 3000); }, getLang: function (is_load, callback) { if (is_load === true && typeof getCookie(LANG.cookie_name) !== 'undefined' && getCookie(LANG.cookie_name).length === 2) { LANG.selected_lang = getCookie(LANG.cookie_name); if (typeof callback === 'function') { callback(); } } else { $.get('/Y/mod/Settings/Language/selectedLang', function (msg) { msg = msg.replace(/\W/ig, ''); if (msg.length > 1 && msg.length < 4) { LANG.selected_lang = msg; } else { LANG.selected_lang = 'tr'; } setCookie(LANG.cookie_name, LANG.selected_lang, 1); if (typeof callback === "function") callback(); }); } return LANG.selected_lang; }, load: function (lang_path, callback) { var path = lang_path.replace(/\.js.*$/g, ''); path += lang_path.replace(/^.*(\.js)?(\?.*)?$/g, '.js$2'); try { if (typeof getCookie('cacheTag') !== 'undefined') path += '?cacheTag=' + getCookie('cacheTag'); } catch (ex) { } LANG.selected_lang = LANG.selected_lang.replace(/\W/i, ''); if (LANG.selected_lang.length !== 2) { LANG.getLang(true, function () { var url = '/lang_content/' + LANG.selected_lang + '/' + path; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; $("head").append(script); setTimeout(function () { LANG.run(); if (typeof callback !== 'undefined') callback(); }, 1000); }); } else { var url = '/lang_content/' + LANG.selected_lang + '/' + path; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; $("head").append(script); setTimeout(function () { LANG.run(); if (typeof callback !== 'undefined') callback(); }, 1000); } return true; }, get: function (key, _default) { var _defaultValue = _default || ' ' + key + ' '; return typeof LANG.lang[key] !== 'undefined' ? LANG.lang[key] : _defaultValue; }, set: function (arr) { LANG.last_lang_arr = arr; for (var key in arr) { LANG.lang[key] = arr[key]; } LANG.run(); }, insert: function (arr, iframe) { for (var i = 0; i < arr.length; i++) { var val = typeof LANG.lang[arr[i]] !== 'undefined' ? LANG.lang[arr[i]] : ' ' + arr[i] + ' '; var element; if (typeof iframe === 'undefined') { element = $('.' + arr[i] + ', .' + LANG.prefix + arr[i]); } else { element = $(iframe).contents().find('.' + arr[i] + ', .' + LANG.prefix + arr[i]); } $(element).html(val); element.each(function () { val = typeof LANG.lang[arr[i]] !== 'undefined' ? LANG.lang[arr[i]] : ' ' + arr[i] + ' '; $.each(this.attributes, function () { if (this.specified) { var attrVal = decodNZDIComponent(this.value); attrVal = attrVal.replace(/\+/g, ' '); val = val.replace('{' + this.name + '}', attrVal); } }); $(this).html(val); }); } } }; function getLanguage() { function getCookie(c_name) { var i, x, y, ARRcookies = document.cookie.split(";"); for (i = 0; i < ARRcookies.length; i++) { x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); x = x.replace(/^\s+|\s+$/g, ""); if (x == c_name) { return unescape(y); } } } var allowedLang = ['tr', 'en', 'az', 'ru', 'de', 'bs']; var lang = 'tr'; if (typeof getCookie('lang') !== 'undefined') { lang = getCookie('lang'); } else { $.ajax({ url: '/conn/user/language/getLanguage', async: false, success: function (msg) { msg = msg.replace(/\W/ig, ''); if (msg.length > 1 || msg.length < 4) { lang = msg; setCookie('language', lang, 10); } } }); } if (allowedLang.indexOf(lang) < 0) { lang = 'tr'; } return lang; } function check_fb_tw_login() { if (window.location.href.indexOf('hata=mail_adresi_alinamadi') > 0) { LANG.selected_lang = getLanguage(); LANG.load('Web/social.js', function () { var type = window.location.href.indexOf('type=tw') > 0 ? 'twitter' : 'facebook'; var html = ' '; TSOFT.showDialog(LANG.get('dialog_' + type), html, 400); TSOFT.addButton(LANG.get('submit_button'), function () { setCookie('fb_tw_mail', $('#fb_tw_mail').val(), 1); window.location.href = '/memberConnector/' + type + '/login_' + type + '.php?mail=' + $('#fb_tw_mail').val(); }); }); } } function Upload(options) { Upload.counter = Upload.counter || 0; Upload.counter++; var opt = { instance: 'myUpload', url: '', //post edilecek url postParams: {}, //post edilecek parametreler buttons: { select: {text: 'Resim Seç', cls: 'selectButton', id: 'selectButton_' + Upload.counter}, upload: {text: 'Yükle', cls: 'uploadButton', id: 'uploadButton_' + Upload.counter} }, uploadButtonActive: false, progressWrapper: '.progressWrapper', //selector (Resimler seçildiğinde, resimlerin gözükeceği div) progress: function (event, __this) { var parent = $(__this).parents('li:first'); var percent = (event.loaded / event.total) * 100; var total = '' + event.total + ''; total = total.length > 6 ? total.replace(/(\w+)(\w{3})(\w{3})/ig, '$1.$2.$3') : total.replace(/(\w+)(\w{3})/ig, '$1.$2'); parent.find('.progressBar2').css('width', Math.round(percent) + '%'); parent.find('.progressInfo').html('%' + Math.round(percent) + ' (' + total + ' byte)'); }, load: function (response) { }, error: function () { }, abort: function () { }, callback: function (msg) { } }; Upload.instance = Upload.instance | {}; Upload.instance.activeUpload = this; Upload.instance[opt.instance] = this; this.get = function (key) { return opt[key]; }; this.set = function (key, val) { opt[key] = val; return true; }; function _get(key, obj, _default) { return typeof obj[key] !== 'undefined' ? obj[key] : _default; } for (var i in options) { opt[i] = options[i]; } Upload.handleFiles = function (__this) { var files = __this.files; var parent = $(__this).parents('li:first'); if (!files.length) { $(opt.progressWrapper).find('.imageList').html('Resim Seçilmedi !!!'); } else { parent.find('.imageList').html(''); for (var i = 0; i < files.length; i++) { var img = document.createElement("img"); img.src = window.URL.createObjectURL(files[i]); img.height = 60; img.onload = function (e) { window.URL.revokeObjectURL(this.src); }; parent.find('.imageList').append(''); parent.find('.imageList .imageArea:last div').append(img); } parent.find('.progressBar,.progressBar2').height(parent.find('.imageList').height()); if (opt.uploadButtonActive === false) { var progressCount = parent.find('.progressInfo').text().replace('%', '').trim(); if (parseInt(progressCount) === 100) { TSOFT.showDialog(LANG.get('error_dialog_header'), LANG.get('error_upload_again'), 300); TSOFT.addButton(LANG.get('close'), function () { }); } else { doUpload(files, __this); } } } }; function doUpload(files, __this) { var formdata = new FormData(); for (var i = 0; i < files.length; i++) { var file = files[i]; formdata.append("file" + i, file); } for (var key in opt.postParams) { formdata.append(key, opt.postParams[key]); } var ajax = new XMLHttpRequest(); ajax.upload.addEventListener("progress", function (event) { opt.progress(event, __this); }); ajax.addEventListener("load", function () { opt.load(this.responseText); opt.callback(this.responseText, __this); }); ajax.addEventListener("error", opt.error); ajax.addEventListener("abort", opt.abort); ajax.open("POST", opt.url); ajax.send(formdata); } this.getCreatedHtml = function () { var html = ' '; return html; }; } function PersonalizationForm(options) { var str = ''; var opt = { url: '/conn/product/Personalization/getPersonalizationForm/', selector: '#product-personalization', data: [], form_id: 0, // product_id: 0, cart_id: -1, sub_product_id: 0, myForm: [], instance: 'productDetail' }; this.get = function (key) { return opt[key]; }; this.set = function (key, value) { opt[key] = value; }; var _this = this; for (var i in options) { opt[i] = options[i]; } PersonalizationForm.data = PersonalizationForm.data || opt.data; PersonalizationForm.instance = PersonalizationForm.instance || {}; PersonalizationForm.instance['activeForm'] = this; PersonalizationForm.instance[opt.instance] = this; this.validate = function () { if ($('.CustomForm').length === 0) { return true; } var r = true; function showValidationError(_this, type, param) { r = false; var txt = LANG.get('error_' + type); $(_this).parent().parent().append(' ' + txt.replace('{' + type + '}', param) + ' '); $(_this).addClass('error'); } $(opt.selector).find('.personalizationFormElement').removeClass('error'); $(opt.selector).find('.CustomForm span.error').remove(); var values = []; var sayac = 0; var myForm = []; $(opt.selector).find('.personalizationFormElement').each(function () { var val = $(this).val(); var cls = $(this).attr('class') || ''; myForm[sayac] = { baslik: typeof opt.data[sayac] !== 'undefined' ? opt.data[sayac].baslik : '*', value: $(this).val() }; if ($(this).attr('disabled') === 'disabled') { myForm[sayac]['active'] = 0; } else { if (typeof $(this).attr('data-required') !== 'undefined') { if ($(this).is('input[type="checkbox"]')) { if (!$(this).is(':checked')) { showValidationError(this, 'required', ''); return false; } } else if ($(this).val() === '') { showValidationError(this, 'required', ''); return false; } } if ($(this).is('input') || $(this).is('textarea')) { if ($(this).attr('type') == 'checkbox') { myForm[sayac].value = $(this).is(':checked') ? 1 : 0; } var minsize = parseInt($(this).attr('data-minsize')); var maxsize = parseInt($(this).attr('data-maxsize')); if (minsize > 0 && val.length < minsize) { showValidationError(this, 'minsize', minsize); return false; } else if (maxsize > 0 && val.length > maxsize) { showValidationError(this, 'maxsize', maxsize); return false; } else if (typeof $(this).attr('data-regex') !== 'undefined') { var rgx = new RegExp($(this).attr('data-regex'), "ig"); if (rgx.test(val) === false) { showValidationError(this, 'regex', ''); return false; } } } myForm[sayac]['active'] = 1; } sayac++; }); _this.set('myForm', myForm); return r; }; this.saveForm = function (callbackFunc) { var form_id = _this.get('form_id'); var product_id = _this.get('product_id'); if (product_id < 1 || form_id < 0) { return false; } var data = _this.get('data'); var myForm = _this.get('myForm'); var sub_product_id = _this.get('sub_product_id'); $.ajax({ url: '/conn/product/Personalization/saveForm/' + _this.get('cart_id'), type: 'post', async: false, data: {form_id: form_id, data: JSON.stringify(myForm), product_id: product_id, sub_product_id: sub_product_id}, success: function (msg) { if (typeof callbackFunc === 'function') { callbackFunc(msg); } } }); }; function _get(key, obj, _default) { return obj[key] === 'undefined' ? _default : obj[key]; } function getElement(tip, name, varsayilan, zorunlu, min, max, regex, secenek, label) { var attr = []; if (zorunlu === '1') attr.push('data-required="1"'); if (varsayilan !== '') attr.push('data-default="' + encodNZDI(varsayilan) + '"'); attr.push('class="personalizationFormElement"'); if (min > 0) attr.push('data-minsize="' + min + '"'); if (max > 0) attr.push('data-maxsize="' + max + '"'); if (regex.length > 0) attr.push('data-regex="' + regex.replace(/"/ig, '\\"') + '"'); if (tip.indexOf('input') > -1) { return '<' + tip + ' name="' + name + '" ' + attr.join(' ') + ' />' } else if (tip.indexOf('select') > -1) { secenekler += ' '; for (var m = 0; m < secenek.length; m++) { secenekler += ' '; } return '<' + tip + ' name="' + name + '" ' + attr.join(' ') + ' >' + secenekler + ' ' } else if (tip.indexOf('imagebox') > -1) { var secenekler = ''; for (var m = 0; m < secenek.length; m++) { secenekler += '' + secenek[m].secenek + ' '; } return ''; } else if (tip.indexOf('textarea') > -1) { return '<' + tip + ' name="' + name + '" ' + attr.join(' ') + ' > '; } else if (tip.indexOf('image_upload') > -1) { var up = new Upload({ url: '/conn/product/Personalization/sendImage', postParams: {deneme: 'ceka'}, callback: function (response, __this) { var parent = $(__this).parents('li:first'); var arr = {status: 0, statusText: '1----'}; try { arr = JSON.parse(response); } catch (ex) { arr = {status: 0, statusText: '2----'}; } if (parseInt(arr.status) === 1) { parent.find('.personalizationFormElement').val(1); } else { TSOFT.showDialog(LANG.get('error_dialog_header'), LANG.get('error_upload' + arr.status), 300); TSOFT.addButton(LANG.get('close'), function () { }); parent.find('.progressInfo').text('%0'); parent.find('.progressBar2').width(0); } } }); return ' ' + up.getCreatedHtml(); } return tip; } this.createForm = function (data) { $(_this.get('selector')).css({overflow: 'visible', clear: 'both'}); $(_this.get('selector')).after('' + secenekler + '
'); PersonalizationForm.data = data; var selectedLang = getLanguage();//PersonalizationForm.getSelectedLang(); LANG.selected_lang = selectedLang; $(opt.selector).html(' '); for (var i = 0; i < data.length; i++) { var label = _get('baslik', data[i], '"'); var fiyat = parseInt(_get('fiyat', data[i], 0)); var fiyatAciklama = _get('fiyatAciklama', data[i], ''); var secenekler = _get('secenekler', data[i], []); var name = 'element_' + i;//_get('name', data[i], 'no_name'); var tip = _get('tip', data[i], 'input'); var zorunlu = _get('zorunlu', data[i], 0); var varsayilan = _get('varsayilan', data[i], ''); var min = _get('min', data[i], 0); var max = _get('max', data[i], 0); var regex = _get('regex', data[i], ''); var lang = _get('lang', data[i], []); var noteArr = []; if (fiyat > 0 && parseInt(zorunlu) === 0) { } if (zorunlu === '1') noteArr.push('*'); var li = ''; var element = getElement(tip, name, varsayilan, zorunlu, min, max, regex, secenekler, label); if (tip.indexOf('checkbox') > 0) { li = '' + element + ' ' + label + ' ' + noteArr.join('-') + ' '; } else { li = '' + element + ' ' + noteArr.join('-') + ' '; } if (fiyatAciklama.length > 2) { li += '(' + fiyatAciklama + ') '; } for (var m = 0; m < lang.length; m++) { var rgx = new RegExp("\{#" + lang[m].key + "#\}", "ig"); li = li.replace(rgx, lang[m][selectedLang]); } $(opt.selector).find('.CustomForm ul:first').append(li); } }; function processForm(data) { _this.set('data', data); _this.createForm(data); setPersonalizationEvents(); } function setPersonalizationEvents() { $(opt.selector).find('input.fieldActive').change(function () { if ($(this).is(':checked')) { $(this).parents('li').find('.personalizationFormElement').removeAttr('disabled'); } else { $(this).parents('li').find('.personalizationFormElement').val(''); $(this).parents('li').find('.personalizationFormElement').attr('disabled', 'disabled'); } }); $(opt.selector).find('input.fieldActive').trigger('change'); $(opt.selector).find('.personalizationFormElement').keyup(function () { var maxLen = parseInt($(this).attr('data-maxsize')); if (maxLen > 0) { $(this).parents('li').find('span.note u').remove(); var len = maxLen - $(this).val().length; $(this).parents('li').find('span.note').append(' ' + len + ' '); } }); $(opt.selector).find('.personalizationFormElement').trigger('keyup'); $(opt.selector).find('.tsoftCombo li').click(function () { var content = $(this).html(); $(this).parents('.comboWrapper').find('div.selected').html(content); $(opt.selector).find('.tsoftCombo').hide(); $(this).parents('.comboWrapper').find('input').val($(this).text().trim()); }); $(opt.selector).find('.comboWrapper div.selected').click(function () { $(this).parents('.comboWrapper').find('.tsoftCombo').toggle(); }); $(opt.selector).find('.tsoftCombo').toggle(); var data = _this.get('data'); var myForm = _this.get('myForm'); //güncellemede for (var i = 0; i < data.length; i++) { var element = $(opt.selector).find('.personalizationFormElement').eq(i); if (element.length > 0) { if (typeof element.attr('data-default') !== 'undefined') { if (data[i].tip === 'imagebox') { element.parents('li:first').find('.comboLabel').each(function () { if ($(this).text().trim() === element.attr('data-default').trim()) { $(this).parents('li:first').trigger('click'); } }); } else { element.val(decodNZDI(element.attr('data-default'))); } } if (typeof myForm[i] !== 'undefined') {//Güncelleme ise element.val(myForm[i]['value']); if (data[i].tip === 'image_upload') { element.parents('li:first').find('.progressInfo').text('%100'); element.parents('li:first').find('.progressBar2').css('width', '100%'); } else if (data[i].tip === 'imagebox') { element.parents('li:first').find('ul li').each(function () { if (myForm[i]['value'].trim() === $(this).find('.comboLabel').html().trim()) { $(this).trigger('click'); } }); } else if (data[i].tip.indexOf('checkbox') > -1) { element.val(1); if (myForm[i]['value'] === 1) { element.attr('checked', 'checked'); } } } } } } if (opt.data.length > 0) { if (typeof opt.data !== 'object') { cLog('PersonalizationForm Error: InCorrect Data'); } processForm(opt.data); } else if (opt.data.length === 0) { $.ajax({ url: opt.url + "" + opt.form_id, dataType: 'json', success: function (data) { if (typeof data !== 'object') { cLog('PersonalizationForm Error: InCorrect Data'); } else { processForm(data); } } }); } else { cLog('no parameter set'); } } $(document).ready(function () { Cart.showHeaderCart(); if (typeof $.fn.live !== 'undefined') { $(".Tbox").live("click", function (e) { e.preventDefault(); var title = ($(this).attr("title") === undefined) ? "Sayfa" : $(this).attr("title"); var link = $(this).attr("href"); var width = ($(this).attr("w") === undefined) ? 300 : parseInt($(this).attr("w")); if (link === undefined) return false; var callback = function () { }; var ccc = $(this).attr("callback"); if (ccc !== undefined) { callback = function () { eval(ccc); }; } TSOFT.showUrl(link, title, width, callback); }); } check_fb_tw_login(); var alert_old = window.alert; if( typeof mobile == "undefined"){ window.alert = function (str, btnText) { if (typeof btnText === "undefined") { btnText = 'Kapat'; } var count = Object.keys(Message.instance).length + 1; var _setting = { id: 'myDialog_' + count, title: 'Dikkat', html: str, width: 350, height: 'auto', buttons: [{ text: btnText, fn: function () { cLog('kapat'); } }] }; var _instance = new Message(_setting); _instance.show(); return true; }; } }); LANG.set({'ad_eposta_giriniz' : 'Lütfen adınızı ve e-posta giriniz.', 'ad_giriniz' : 'Lütfen adınızı giriniz.', 'alt_urun_seciniz' : 'Alt Ürün Seçiniz', 'dikkat' : 'dikkat', 'ebulten_kayit_tesekkur' : 'bültenimize kayıt olduğunuz için teşekkür ederiz.', 'eposta_giriniz' : 'Lütfen e-posta adresinizi giriniz.', 'eposta_kayitli' : 'Bu e-posta adresi ile daha önceden e-bültene kayıt olunmuş. Lütfen e-posta adresinizi kontrol ediniz.', 'eposta_kontrol_ediniz' : 'Lütfen e-posta adresinizi kontrol ediniz.', 'eposta_sifre_bos' : 'Eposta veya şifre bilgilerini kontrol ediniz', 'sepete_ekle' : 'Sepete Ekle', 'sepete_eklendi' : 'Eklendi', 'tamam' : 'Tamam', 'x' : '' }); var say = 0; function trim(s) { s = s.replace(/^\s*/, '').replace(/\s*$/, ''); return s; } (function($) { $.fn.extend({ ffvalen: function(callback) { return this.each(function() { if (this.length == 0) { return; } else if (this.length > 1) { var form = $(this); var field_id = null; var error = null; form.validationEngine('detach'); form.bind("submit", function() { form.children().find("*[class^='validate[']").each(function(index) { if ($(this).attr("id") === undefined) { $(this).attr("id", 'TSOFT_ENGINE_' + say++); } if ($(this).attr('disabled') == false && $(this).parent('li').css('display') != 'none') { field_id = "#" + $(this).attr("id"); if (form.validationEngine('validateField', field_id)) { $(field_id).focus(); error = true; return false; } } }); if (error == null) callback(); return false; }); form.children().find("*[class^='validate[']").bind("blur", function() { $(this).validationEngine('hidePrompt'); }); form.children().find("button[type='submit']").bind("click", function() { error = null; }); } }); } }); })(jQuery); (function($) { var methods = { init: function(options) { var form = this; if (!form.data('jqv') || form.data('jqv') == null) { options = methods._saveOptions(form, options); $("body").on("click", ".formError", function() { $(this).fadeOut(150, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); }); } return this; }, attach: function(userOptions) { var form = this; var options; if (userOptions) options = methods._saveOptions(form, userOptions); else options = form.data('jqv'); var validateAttribute = (form.find("[data-validation-engine*=validate]")) ? "data-validation-engine" : "class"; if (!options.binded) { if (options.bindMethod == "bind") { form.find("[class*=validate]").not("[type=checkbox]").not("[type=radio]").not(".datepicker").bind(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox],[class*=validate][type=radio]").bind("click", methods._onFieldEvent); form.find("[class*=validate][class*=datepicker]").bind(options.validationEventTrigger, { "delay": 300 }, methods._onFieldEvent); form.bind("submit", methods._onSubmitEvent); } else if (options.bindMethod == "live") { form.find("[class*=validate]").not("[type=checkbox]").not(".datepicker").live(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox]").live("click", methods._onFieldEvent); form.find("[class*=validate][class*=datepicker]").live(options.validationEventTrigger, { "delay": 300 }, methods._onFieldEvent); form.live("submit", methods._onSubmitEvent); } options.binded = true; if (options.autoPositionUpdate) { $(window).bind("resize", { "noAnimation": true, "formElem": form }, methods.updatePromptsPosition); } } return this; }, detach: function() { var form = this; var options = form.data('jqv'); if (options.binded) { form.find("[class*=validate]").not("[type=checkbox]").unbind(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox],[class*=validate][type=radio]").unbind("click", methods._onFieldEvent); form.unbind("submit", methods.onAjaxFormComplete); form.find("[class*=validate]").not("[type=checkbox]").die(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox]").die("click", methods._onFieldEvent); form.die("submit", methods.onAjaxFormComplete); form.removeData('jqv'); if (options.autoPositionUpdate) { $(window).unbind("resize", methods.updatePromptsPosition) } } return this; }, validate: function() { return methods._validateFields(this); }, validateField: function(el) { var options = $(this).data('jqv'); var r = methods._validateField($(el), options); if (options.onSuccess && options.InvalidFields.length == 0) options.onSuccess(); else if (options.onFailure && options.InvalidFields.length > 0) options.onFailure(); return r; }, validateform: function() { return methods._onSubmitEvent.call(this); }, updatePromptsPosition: function(event) { if (event && this == window) var form = event.data.formElem, noAnimation = event.data.noAnimation; else var form = $(this.closest('form')); var options = form.data('jqv'); form.find('[class*=validate]').not(':hidden').not(":disabled").each(function() { var field = $(this); var prompt = methods._getPrompt(field); var promptText = $(prompt).find(".formErrorContent").html(); if (prompt) methods._updatePrompt(field, $(prompt), promptText, undefined, false, options, noAnimation); }) return this; }, showPrompt: function(promptText, type, promptPosition, showArrow) { var form = this.closest('form'); var options = form.data('jqv'); if (!options) options = methods._saveOptions(this, options); if (promptPosition) options.promptPosition = promptPosition; options.showArrow = showArrow == true; methods._showPrompt(this, promptText, type, false, options); return this; }, hidePrompt: function() { var promptClass = "." + methods._getClassName($(this).attr("id")) + "formError"; $(promptClass).fadeTo("fast", 0.3, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); return this; }, hide: function() { var closingtag; if ($(this).is("form")) { closingtag = "parentForm" + methods._getClassName($(this).attr("id")); } else { closingtag = methods._getClassName($(this).attr("id")) + "formError"; } $('.' + closingtag).fadeTo("fast", 0.3, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); return this; }, hideAll: function() { $('.formError').fadeTo("fast", 0.3, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); return this; }, _onFieldEvent: function(event) { var field = $(this); var form = field.closest('form'); var options = form.data('jqv'); window.setTimeout(function() { methods._validateField(field, options); if (options.InvalidFields.length == 0 && options.onSuccess) { options.onSuccess(); } else if (options.InvalidFields.length > 0 && options.onFailure) { options.onFailure(); } }, (event.data) ? event.data.delay : 0); }, _onSubmitEvent: function() { var form = $(this); var options = form.data('jqv'); var r = methods._validateFields(form, true); if (r && options.ajaxFormValidation) { methods._validateFormWithAjax(form, options); return false; } if (options.onValidationComplete) { options.onValidationComplete(form, r); return false; } return r; }, _checkAjaxStatus: function(options) { var status = true; $.each(options.ajaxValidCache, function(key, value) { if (!value) { status = false; return false; } }); return status; }, _validateFields: function(form, skipAjaxValidation) { $(".formError").parent('.formErrorOuter').remove(); var options = form.data('jqv'); var errorFound = false; form.trigger("jqv.form.validating"); var first_err = null; form.find('[class*=validate]').not(':hidden').not(":disabled").each(function() { var field = $(this); if (field.attr("id") === undefined) field.attr("id", "TSOFT_ENGINE_" + say++); errorFound |= methods._validateField(field, options, skipAjaxValidation); field.focus(); if (options.doNotShowAllErrosOnSubmit) return false; if (errorFound && first_err === null) first_err = field; }); form.trigger("jqv.form.result", [errorFound]); if (errorFound) { if (options.scroll) { var destination = first_err.offset().top; var fixleft = first_err.offset().left; var positionType = options.promptPosition; if (typeof(positionType) == 'string') { if (positionType.indexOf(":") != -1) { positionType = positionType.substring(0, positionType.indexOf(":")); } } if (positionType != "bottomRight" && positionType != "bottomLeft") { var prompt_err = methods._getPrompt(first_err); destination = prompt_err.offset().top; } if (options.isOverflown) { var overflowDIV = $(options.overflownDIV); if (!overflowDIV.length) return false; var scrollContainerScroll = overflowDIV.scrollTop(); var scrollContainerPos = -parseInt(overflowDIV.offset().top); destination += scrollContainerScroll + scrollContainerPos - 5; var scrollContainer = $(options.overflownDIV + ":not(:animated)"); scrollContainer.animate({ scrollTop: destination }, 1100); } else { $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination, scrollLeft: fixleft }, 1100, function() { if (options.focusFirstField) first_err.focus(); }); } } else if (options.focusFirstField) first_err.focus(); return false; } return true; }, _validateFormWithAjax: function(form, options) { var data = form.serialize(); var url = (options.ajaxFormValidationURL) ? options.ajaxFormValidationURL : form.attr("action"); $.ajax({ type: "GET", url: url, cache: false, dataType: "json", data: data, form: form, methods: methods, options: options, beforeSend: function() { return options.onBeforeAjaxFormValidation(form, options); }, error: function(data, transport) { methods._ajaxError(data, transport); }, success: function(json) { if (json !== true) { var errorInForm = false; for (var i = 0; i < json.length; i++) { var value = json[i]; var errorFieldId = value[0]; var errorField = $($("#" + errorFieldId)[0]); if (errorField.length == 1) { var msg = value[2]; if (value[1] == true) { if (msg == "" || !msg) { methods._closePrompt(errorField); } else { if (options.allrules[msg]) { var txt = '\"' + errorField.prev("label").text() + '\"' + options.allrules[msg].alertTextOk; if (txt) msg = txt; } methods._showPrompt(errorField, msg, "pass", false, options, true); } } else { errorInForm |= true; if (options.allrules[msg]) { var txt = '\"' + errorField.prev("label").text() + '\"' + options.allrules[msg].alertText; if (txt) msg = txt; } methods._showPrompt(errorField, msg, "", false, options, true); } } } options.onAjaxFormComplete(!errorInForm, form, json, options); } else options.onAjaxFormComplete(true, form, "", options); } }); }, _validateField: function(field, options, skipAjaxValidation) { if (!field.attr("id")) { field.attr("id", 'TSOFT_ENGINE_' + say++) } var rulesParsing = field.attr('class'); var getRules = /validate\[(.*)\]/.exec(rulesParsing); if (!getRules) return false; var str = getRules[1]; var rules = str.split(/\[|,|\]/); var isAjaxValidator = false; var fieldName = field.attr("name"); var promptText = ""; var required = false; options.isError = false; options.showArrow = true; var form = $(field.closest("form")); var errorMsg = undefined; for (var i = 0; i < rules.length; i++) { rules[i] = rules[i].replace(" ", "") switch (rules[i]) { case "required": required = true; errorMsg = methods._required(field, rules, i, options); break; case "custom": if (errorMsg == undefined) errorMsg = methods._customRegex(field, rules, i, options); break; case "groupRequired": var classGroup = "[class*=" + rules[i + 1] + "]"; var firstOfGroup = form.find(classGroup).eq(0); if (firstOfGroup[0] != field[0]) { methods._validateField(firstOfGroup, options, skipAjaxValidation) options.showArrow = true; continue; } ; errorMsg = methods._groupRequired(field, rules, i, options); if (errorMsg) required = true; options.showArrow = false; break; case "ajax": if (!skipAjaxValidation) { methods._ajax(field, rules, i, options); isAjaxValidator = true; } break; case "minSize": if (errorMsg == undefined) errorMsg = methods._minSize(field, rules, i, options); break; case "maxSize": errorMsg = methods._maxSize(field, rules, i, options); break; case "min": errorMsg = methods._min(field, rules, i, options); break; case "max": errorMsg = methods._max(field, rules, i, options); break; case "past": errorMsg = methods._past(field, rules, i, options); break; case "future": errorMsg = methods._future(field, rules, i, options); break; case "dateRange": var classGroup = "[class*=" + rules[i + 1] + "]"; var firstOfGroup = form.find(classGroup).eq(0); var secondOfGroup = form.find(classGroup).eq(1); if (firstOfGroup[0].value || secondOfGroup[0].value) { errorMsg = methods._dateRange(firstOfGroup, secondOfGroup, rules, i, options); } if (errorMsg) required = true; options.showArrow = false; break; case "dateTimeRange": var classGroup = "[class*=" + rules[i + 1] + "]"; var firstOfGroup = form.find(classGroup).eq(0); var secondOfGroup = form.find(classGroup).eq(1); if (firstOfGroup[0].value || secondOfGroup[0].value) { errorMsg = methods._dateTimeRange(firstOfGroup, secondOfGroup, rules, i, options); } if (errorMsg) required = true; options.showArrow = false; break; case "maxCheckbox": errorMsg = methods._maxCheckbox(form, field, rules, i, options); field = $(form.find("input[name='" + fieldName + "']")); break; case "minCheckbox": errorMsg = methods._minCheckbox(form, field, rules, i, options); field = $(form.find("input[name='" + fieldName + "']")); break; case "equals": errorMsg = methods._equals(field, rules, i, options); break; case "funcCall": errorMsg = methods._funcCall(field, rules, i, options); break; case "creditCard": errorMsg = methods._creditCard(field, rules, i, options); break; default: } if (errorMsg !== undefined) { promptText = errorMsg + "
"; options.isError = true; } } if (!required && field.val() == "") options.isError = false; var fieldType = field.attr("type"); if ((fieldType == "radio" || fieldType == "checkbox") && form.find("input[name='" + fieldName + "']").size() > 1) { field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first")); options.showArrow = false; } if (fieldType == "text" && form.find("input[name='" + fieldName + "']").size() > 1) { field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first")); options.showArrow = false; } if (options.isError) { methods._showPrompt(field, promptText, "", false, options); } else { if (!isAjaxValidator) methods._closePrompt(field); } if (!isAjaxValidator) { field.trigger("jqv.field.result", [field, options.isError, promptText]); } var errindex = $.inArray(field[0], options.InvalidFields); if (errindex == -1) { if (options.isError) options.InvalidFields.push(field[0]); } else if (!options.isError) { options.InvalidFields.splice(errindex, 1); } return options.isError; }, getLabel: function(field) { var label_text = field.prev().text().replace(/[:;\*]/ig, ''); if (label_text.length < 2) { label_text = field.parent().prev().text().replace(/[:;\*]/ig, ''); } label_text = trim(label_text); if (label_text.length < 2 && field.parents('tr').length > 0) { label_text = field.parents('tr').find('td').eq(0).text().replace(/[:;\*]/ig, ''); } return label_text; }, _required: function(field, rules, i, options) { var label_text = methods.getLabel(field); switch (field.attr("type")) { case "text": case "password": case "textarea": case "file": default: if (!field.val()) { var a = options.allrules[rules[i]].alertText; return a.replace('{name}', label_text); } break; case "radio": case "checkbox": var form = field.closest("form"); var name = field.attr("name"); if (form.find("input[name='" + name + "']:checked").size() == 0) { if (form.find("input[name='" + name + "']").size() == 1) return field.next("label").attr('title').length ? field.next("label").attr('title') : options.allrules[rules[i]].alertTextCheckboxe; else return options.allrules[rules[i]].alertTextCheckboxMultiple; } break; case "select-one": if (!field.val()) { var a = options.allrules[rules[i]].alertTextSelect; return a.replace('{name}', label_text); } break; case "select-multiple": if (!field.find("option:selected").val()) { var a = options.allrules[rules[i]].alertTextSelect; return a.replace('{name}', label_text); } break; } }, _groupRequired: function(field, rules, i, options) { var classGroup = "[class*=" + rules[i + 1] + "]"; var isValid = false; field.closest("form").find(classGroup).each(function() { if (!methods._required($(this), rules, i, options)) { isValid = true; return false; } }) if (!isValid) return options.allrules[rules[i]].alertText; }, _customRegex: function(field, rules, i, options) { var label_text = field.prev("label").text().replace(/(\s\*)/i, ''); label_text = trim(label_text); var customRule = rules[i + 1]; var rule = options.allrules[customRule]; if (!rule) { return; } var ex = rule.regex; if (!ex) { alert("jqv:custom regex not found " + customRule); return; } var pattern = new RegExp(ex); if (!pattern.test(field.val())) return '\"' + label_text + '\"' + options.allrules[customRule].alertText; }, _funcCall: function(field, rules, i, options) { var functionName = rules[i + 1]; var fn = window[functionName] || options.customFunctions[functionName]; if (typeof(fn) == 'function') return fn(field, rules, i, options); }, _equals: function(field, rules, i, options) { var equalsField = $("#" + rules[i + 1]); var label_text_prev = equalsField.prev("label").text().replace(/(\s\*)/i, ''); label_text_prev = trim(label_text_prev); var label_text = field.prev("label").text().replace(/(\s\*)/i, ''); label_text = trim(label_text); if (field.val() != equalsField.val()) return '\"' + label_text_prev + '\" ile \"' + label_text + '\"' + options.allrules.equals.alertText; }, _maxSize: function(field, rules, i, options) { var label_text = methods.getLabel(field); var max = rules[i + 1]; var len = field.val().length; if (len > max) { var rule = options.allrules.maxSize; var a = rule.alertText.replace('{name}', label_text).replace('{max}', max); return a; } }, _minSize: function(field, rules, i, options) { var label_text = methods.getLabel(field); var min = rules[i + 1]; var len = field.val().length; if (len < min) { var rule = options.allrules.minSize; var a = rule.alertText.replace('{name}', label_text).replace('{min}', min); return a; } }, _min: function(field, rules, i, options) { var label_text = methods.getLabel(field); var min = parseFloat(rules[i + 1]); var len = parseFloat(field.val()); if (len < min) { var rule = options.allrules.min; if (rule.alertText2) { var a = rule.alertText.replace('{name}', label_text).replace('{min}', min); return a; } return '\"' + label_text + '\"' + rule.alertText + min; } }, _max: function(field, rules, i, options) { var label_text = methods.getLabel(field); var max = parseFloat(rules[i + 1]); var len = parseFloat(field.val()); if (len > max) { var rule = options.allrules.max; if (rule.alertText2) { var a = rule.alertText.replace('{name}', label_text).replace('{max}', max); return a; } return '\"' + label_text + '\"' + rule.alertText + max; } }, _past: function(field, rules, i, options) { var p = rules[i + 1]; var pdate = (p.toLowerCase() == "now") ? new Date() : methods._parseDate(p); var vdate = methods._parseDate(field.val()); if (vdate > pdate) { var rule = options.allrules.past; if (rule.alertText2) return rule.alertText + methods._dateToString(pdate) + rule.alertText2; return rule.alertText + methods._dateToString(pdate); } }, _future: function(field, rules, i, options) { var p = rules[i + 1]; var pdate = (p.toLowerCase() == "now") ? new Date() : methods._parseDate(p); var vdate = methods._parseDate(field.val()); if (vdate < pdate) { var rule = options.allrules.future; if (rule.alertText2) return rule.alertText + methods._dateToString(pdate) + rule.alertText2; return rule.alertText + methods._dateToString(pdate); } }, _isDate: function(value) { var dateRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/); if (dateRegEx.test(value)) { return true; } return false; }, _isDateTime: function(value) { var dateTimeRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/); if (dateTimeRegEx.test(value)) { return true; } return false; }, _dateCompare: function(start, end) { return (new Date(start.toString()) < new Date(end.toString())); }, _dateRange: function(first, second, rules, i, options) { if ((!first[0].value && second[0].value) || (first[0].value && !second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } if (!methods._isDate(first[0].value) || !methods._isDate(second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } if (!methods._dateCompare(first[0].value, second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } }, _dateTimeRange: function(first, second, rules, i, options) { if ((!first[0].value && second[0].value) || (first[0].value && !second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } if (!methods._isDateTime(first[0].value) || !methods._isDateTime(second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } if (!methods._dateCompare(first[0].value, second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } }, _maxCheckbox: function(form, field, rules, i, options) { var nbCheck = rules[i + 1]; var groupname = field.attr("name"); var groupSize = form.find("input[name='" + groupname + "']:checked").size(); if (groupSize > nbCheck) { options.showArrow = false; if (options.allrules.maxCheckbox.alertText2) return options.allrules.maxCheckbox.alertText + " " + nbCheck + " " + options.allrules.maxCheckbox.alertText2; return options.allrules.maxCheckbox.alertText; } }, _minCheckbox: function(form, field, rules, i, options) { var nbCheck = rules[i + 1]; var groupname = field.attr("name"); var groupSize = form.find("input[name='" + groupname + "']:checked").size(); if (groupSize < nbCheck) { options.showArrow = false; return options.allrules.minCheckbox.alertText + " " + nbCheck + " " + options.allrules.minCheckbox.alertText2; } }, _creditCard: function(field, rules, i, options) { var valid = false, cardNumber = field.val().replace(/ +/g, '').replace(/-+/g, ''); var numDigits = cardNumber.length; if (numDigits >= 14 && numDigits <= 16 && parseInt(cardNumber) > 0) { var sum = 0, i = numDigits - 1, pos = 1, digit, luhn = new String(); do { digit = parseInt(cardNumber.charAt(i)); luhn += (pos++ % 2 == 0) ? digit * 2 : digit; } while (--i >= 0) for (i = 0; i < luhn.length; i++) { sum += parseInt(luhn.charAt(i)); } valid = sum % 10 == 0; } if (!valid) return options.allrules.creditCard.alertText; }, _ajax: function(field, rules, i, options) { var errorSelector = rules[i + 1]; var rule = options.allrules[errorSelector]; var extraData = rule.extraData; var extraDataDynamic = rule.extraDataDynamic; if (!extraData) extraData = ""; if (extraDataDynamic) { var tmpData = []; var domIds = String(extraDataDynamic).split(","); for (var i = 0; i < domIds.length; i++) { var id = domIds[i]; if ($(id).length) { var inputValue = field.closest("form").find(id).val(); var keyValue = id.replace('#', '') + '=' + escape(inputValue); tmpData.push(keyValue); } } extraDataDynamic = tmpData.join("&"); } else { extraDataDynamic = ""; } if (!options.isError) { $.ajax({ type: "GET", url: rule.url, cache: false, dataType: "json", data: "fieldId=" + field.attr("id") + "&fieldValue=" + field.val() + "&extraData=" + extraData + "&" + extraDataDynamic, field: field, rule: rule, methods: methods, options: options, beforeSend: function() { var loadingText = rule.alertTextLoad; if (loadingText) methods._showPrompt(field, loadingText, "load", true, options); }, error: function(data, transport) { methods._ajaxError(data, transport); field.val(''); }, success: function(json) { var errorFieldId = json[0]; var errorField = $($("#" + errorFieldId)[0]); if (errorField.length == 1) { var status = json[1]; var msg = json[2]; if (!status) { options.ajaxValidCache[errorFieldId] = false; options.isError = true; if (msg) { if (options.allrules[msg]) { var txt = options.allrules[msg].alertText; if (txt) msg = txt; } } else msg = rule.alertText; methods._showPrompt(errorField, msg, "", true, options); } else { if (options.ajaxValidCache[errorFieldId] !== undefined) options.ajaxValidCache[errorFieldId] = true; if (msg) { if (options.allrules[msg]) { var txt = options.allrules[msg].alertTextOk; if (txt) msg = txt; } } else msg = rule.alertTextOk; if (msg) methods._showPrompt(errorField, msg, "pass", true, options); else methods._closePrompt(errorField); } } errorField.trigger("jqv.field.result", [errorField, !options.isError, msg]); } }); } }, _ajaxError: function(data, transport) { if (data.status == 0 && transport == null) alert("The page is not served from a server! ajax call failed"); }, _dateToString: function(date) { return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(); }, _parseDate: function(d) { var dateParts = d.split("-"); if (dateParts == d) dateParts = d.split("/"); return new Date(dateParts[0], (dateParts[1] - 1), dateParts[2]); }, _showPrompt: function(field, promptText, type, ajaxed, options, ajaxform) { var prompt = methods._getPrompt(field); if (ajaxform) prompt = false; if (prompt) methods._updatePrompt(field, prompt, promptText, type, ajaxed, options); else methods._buildPrompt(field, promptText, type, ajaxed, options); var form = field.closest("form"); form.find('span').css('overflow', 'visible'); }, _buildPrompt: function(field, promptText, type, ajaxed, options) { var prompt = $(''); prompt.addClass(methods._getClassName(field.attr("id")) + "formError"); if (field.is(":input")) prompt.addClass("parentForm" + methods._getClassName(field.parents('form').attr("id"))); prompt.addClass("formError"); switch (type) { case "pass": prompt.addClass("greenPopup"); break; case "load": prompt.addClass("blackPopup"); break; default: options.InvalidCount++; } if (ajaxed) prompt.addClass("ajaxed"); var promptContent = $('').addClass("formErrorContent").html(promptText).appendTo(prompt); if (options.showArrow) { var arrow = $('').addClass("formErrorArrow"); var positionType = field.data("promptPosition") || options.promptPosition; if (typeof(positionType) == 'string') { if (positionType.indexOf(":") != -1) { positionType = positionType.substring(0, positionType.indexOf(":")); } ; } ; switch (positionType) { case "bottomLeft": case "bottomRight": prompt.find(".formErrorContent").before(arrow); arrow.addClass("formErrorArrowBottom").html(''); break; case "topLeft": case "topRight": arrow.html(''); prompt.append(arrow); break; } } if (options.relative) { var outer = $(' ').css('position', 'relative').css('vertical-align', 'top').css('margin', '0px').css('overflow', 'visible').addClass('formErrorOuter').append(prompt.css('position', 'absolute')); field.before(outer); } else if (options.isOverflown) { field.before(prompt); } else { $("body").append(prompt); } var pos = methods._calculatePosition(field, prompt, options); prompt.css({ "top": pos.callerTopPosition, "left": pos.callerleftPosition, "marginTop": pos.marginTopSize, "opacity": 0 }).data("callerField", field); if (options.autoHidePrompt) { setTimeout(function() { prompt.animate({ "opacity": 0 }, function() { prompt.closest('.formErrorOuter').remove(); prompt.remove(); }) }, options.autoHideDelay) return prompt.animate({ "opacity": 0.87 }) } else { return prompt.animate({ "opacity": 0.87 }); } }, _updatePrompt: function(field, prompt, promptText, type, ajaxed, options, noAnimation) { if (prompt) { if (typeof type !== "undefined") { if (type == "pass") prompt.addClass("greenPopup"); else prompt.removeClass("greenPopup"); if (type == "load") prompt.addClass("blackPopup"); else prompt.removeClass("blackPopup"); } if (ajaxed) prompt.addClass("ajaxed"); else prompt.removeClass("ajaxed"); prompt.find(".formErrorContent").html(promptText); var pos = methods._calculatePosition(field, prompt, options); css = { "top": pos.callerTopPosition, "left": pos.callerleftPosition, "marginTop": pos.marginTopSize }; if (noAnimation) prompt.css(css); else prompt.animate(css) } }, _closePrompt: function(field) { var prompt = methods._getPrompt(field); if (prompt) prompt.fadeTo("fast", 0, function() { prompt.parent('.formErrorOuter').remove(); prompt.remove(); }); }, closePrompt: function(field) { return methods._closePrompt(field); }, _getPrompt: function(field) { var className = methods._getClassName(field.attr("id")) + "formError"; var match = $("." + methods._escapeExpression(className))[0]; if (match) return $(match); }, _escapeExpression: function(selector) { return selector.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g, "\\$1"); }, isRTL: function(field) { var $document = $(document); var $body = $('body'); var rtl = (field && field.hasClass('rtl')) || (field && (field.attr('dir') || '').toLowerCase() === 'rtl') || $document.hasClass('rtl') || ($document.attr('dir') || '').toLowerCase() === 'rtl' || $body.hasClass('rtl') || ($body.attr('dir') || '').toLowerCase() === 'rtl'; return Boolean(rtl); }, _calculatePosition: function(field, promptElmt, options) { var promptTopPosition, promptleftPosition, marginTopSize; var fieldWidth = field.width(); var promptHeight = promptElmt.height(); var overflow = options.isOverflown || options.relative; if (overflow) { promptTopPosition = promptleftPosition = 0; marginTopSize = -promptHeight; } else { var offset = field.offset(); promptTopPosition = offset.top; promptleftPosition = offset.left; marginTopSize = 0; } var positionType = field.data("promptPosition") || options.promptPosition; var shift1 = ""; var shift2 = ""; var shiftX = 0; var shiftY = 0; if (typeof(positionType) == 'string') { if (positionType.indexOf(":") != -1) { shift1 = positionType.substring(positionType.indexOf(":") + 1); positionType = positionType.substring(0, positionType.indexOf(":")); if (shift1.indexOf(",") != -1) { shift2 = shift1.substring(shift1.indexOf(",") + 1); shift1 = shift1.substring(0, shift1.indexOf(",")); shiftY = parseInt(shift2); if (isNaN(shiftY)) { shiftY = 0; } ; } ; shiftX = parseInt(shift1); if (isNaN(shift1)) { shift1 = 0; } ; } ; } ; if (!methods.isRTL(field)) { switch (positionType) { default: case "topRight": if (overflow) promptleftPosition += fieldWidth - 30; else { promptleftPosition += fieldWidth - 30; promptTopPosition += -promptHeight - 2; } break; case "topLeft": promptTopPosition += -promptHeight - 10; break; case "centerRight": if (overflow) { promptTopPosition = field.outerHeight(); promptleftPosition = field.outerWidth(1) + 5; } else { promptleftPosition += field.outerWidth() + 5; } break; case "centerLeft": promptleftPosition -= promptElmt.width() + 2; break; case "bottomLeft": promptTopPosition = promptTopPosition + field.height() + 15; break; case "bottomRight": promptleftPosition += fieldWidth - 30; promptTopPosition += field.height() + 5; } } else { switch (positionType) { default: case "topLeft": if (overflow) promptleftPosition -= promptElmt.width() - 30; else { promptleftPosition -= promptElmt.width() - 30; promptTopPosition += -promptHeight - 2; } break; case "topRight": if (overflow) promptleftPosition += fieldWidth - promptElmt.width(); else { promptleftPosition += fieldWidth - promptElmt.width(); promptTopPosition += -promptHeight - 2; } break; case "centerRight": if (overflow) { promptTopPosition = field.outerHeight(); promptleftPosition = field.outerWidth(1) + 5; } else { promptleftPosition += field.outerWidth() + 5; } break; case "centerLeft": promptleftPosition -= promptElmt.width() + 2; break; case "bottomLeft": promptleftPosition += -promptElmt.width() + 30; promptTopPosition = promptTopPosition + field.height() + 15; break; case "bottomRight": promptleftPosition += fieldWidth - promptElmt.width(); promptTopPosition += field.height() + 15; } } promptleftPosition += shiftX; promptTopPosition += shiftY; return { "callerTopPosition": promptTopPosition + "px", "callerleftPosition": promptleftPosition + "px", "marginTopSize": marginTopSize + "px" }; }, _saveOptions: function(form, options) { if ($.validationEngineLanguage) var allRules = $.validationEngineLanguage.allRules; else $.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page"); $.validationEngine.defaults.allrules = allRules; var userOptions = $.extend(true, {}, $.validationEngine.defaults, options); jim = userOptions; if (userOptions.isOverflown) userOptions.relative = true; if (userOptions.relative) userOptions.isOverflown = true; form.data('jqv', userOptions); return userOptions; }, _getClassName: function(className) { if (className) { return className.replace(/:/g, "_").replace(/\./g, "_"); } } }; $.fn.validationEngine = function(method) { var form = $(this); if (!form[0]) return false; // stop here if the form does not exist if (typeof(method) == 'string' && method.charAt(0) != '_' && methods[method]) { if (method != "showPrompt" && method != "hidePrompt" && method != "hide" && method != "hideAll") methods.init.apply(form); return methods[method].apply(form, Array.prototype.slice.call(arguments, 1)); } else if (typeof method == 'object' || !method) { methods.init.apply(form, arguments); return methods.attach.apply(form); } else { $.error('Method ' + method + ' does not exist in jQuery.validationEngine'); } }; $.validationEngine = { defaults: { validationEventTrigger: "blur", scroll: false, focusFirstField: false, promptPosition: "centerRight", bindMethod: "bind", inlineAjax: false, ajaxFormValidation: false, ajaxFormValidationURL: false, onAjaxFormComplete: $.noop, onBeforeAjaxFormValidation: $.noop, onValidationComplete: false, relative: true, isOverflown: false, overflownDIV: "", doNotShowAllErrosOnSubmit: false, binded: false, showArrow: true, isError: false, ajaxValidCache: {}, autoPositionUpdate: true, InvalidFields: [], onSuccess: false, onFailure: false, autoHidePrompt: true, autoHideDelay: 5000 } }; $(function() { $.validationEngine.defaults.promptPosition = methods.isRTL() ? 'topLeft' : "centerRight" }); function getLang(key, defaultText) { if (typeof lang === 'object') { if (typeof lang[key] === 'string') { if (lang[key].length > 5) return lang[key]; } } return defaultText; } $.fn.validationEngineLanguage = function() { }; $.validationEngineLanguage = { newLang: function() { $.validationEngineLanguage.allRules = { "required": {// Add your regex rules here, you can take telephone as an example "regex": "none", "alertText": getLang('validate_input', 'Lütfen "{name}" alanını giriniz.'), "alertTextSelect": getLang('validate_select', 'Lütfen "{name}" seçiniz'), "alertTextCheckboxMultiple": getLang('validate_checkboxMultiple', "* Lütfen bir seçeneği işaretleyiniz"), "alertTextCheckboxe": getLang('validate_checkbox', "* Bu onay kutusu zorunludur") }, "minSize": { "regex": "none", "alertText": getLang('validate_minSize', "{name} alanına en az {min} karakter girmelisiniz."), "alertText2": " karakter girmelisiniz " }, "maxSize": { "regex": "none", "alertText": getLang('validate_maxSize', "{name} alanına en fazla {max} karakter girmelisiniz."), "alertText2": " karakter girebilirsiniz" }, "groupRequired": { "regex": "none", "alertText": "* You must fill one of the following fields" }, "min": { "regex": "none", "alertText": " alanı için en küçük değer: " }, "max": { "regex": "none", "alertText": " alanı için geçerli en yüksek değer: " }, "past": { "regex": "none", "alertText": "* Lütfen ", "alertText2": " tarihinden daha ileri bir tarih giriniz " }, "future": { "regex": "none", "alertText": "* Lütfen ", "alertText2": " tarihinden daha geri bir tarih giriniz " }, "maxCheckbox": { "regex": "none", "alertText": "* En fazla ", "alertText2": " onay kutusu işaretleyebilirsiniz" }, "minCheckbox": { "regex": "none", "alertText": "* Lütfen en az ", "alertText2": " onay kutusunu işaretleyiniz" }, "equals": { "regex": "none", "alertText": " alanına aynı değerleri giriniz" }, "creditCard": { "regex": "none", "alertText": "* Geçersiz kredi kartı numarası" }, "phone": { "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, "alertText": " alanına geçerli telefon numarası giriniz" }, "email": { "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "alertText": " alanına geçerli bir adres giriniz" }, "integer": { "regex": /^[\-\+]?\d+$/, "alertText": " alanına geçerli bir tam sayı giriniz" }, "number": { "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/, "alertText": " alanına geçerli bir noktalı sayı giriniz" }, "date": { "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/, "alertText": " alanına geçerli tarih giriniz. Tarih YYYY-MM-DD formatında olmalı" }, "datetr": { "regex": /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/, "alertText": " alanına geçerli tarih giriniz. Tarih GG-AA-YYYY formatında olmalı" }, "ipv4": { "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, "alertText": " alanına geçerli IP adresi giriniz" }, "url": { "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, "alertText": " alanına geçerli URL giriniz" }, "onlyNumberSp": { "regex": /^[0-9\ ]+$/, "alertText": " alanına sadece rakam giriniz" }, "onlyLetterSp": { "regex": /^[a-zA-Z\ \']+$/, "alertText": " alanına sadece harf giriniz" }, "onlyLetterNumber": { "regex": /^[0-9a-zA-Z-*\/%\?"_ŞİĞÜÇÖşığçüö\s]+$/, "alertText": " alanına geçerli karakterler giriniz" }, "ajaxUserCall": { "url": "ajaxValidateFieldUser", "alertText": "* Bu kullanıcı adı kullanımda", "alertTextLoad": "* Doğrulanıyor, lütfen bekleyiniz" }, "ajaxUserCallPhp": { "url": "phpajax/ajaxValidateFieldUser.php", "extraData": "name=eric", "alertTextOk": "* Bu kullanıcı adını kullanabilirsiniz", "alertText": "* Bu kullanıcı adı kullanımda", "alertTextLoad": "* Doğrulanıyor, lütfen bekleyiniz" }, "ajaxNameCall": { "url": "ajaxValidateFieldName", "alertText": "* Bu isim kullanımda", "alertTextOk": "* Bu isim kullanılabilir", "alertTextLoad": "* Doğrulanıyor, lütfen bekleyiniz" }, "ajaxNicknameCall": { "url": "ajax/member_nick_check", "extraDataDynamic": ["#nickname"], "alertText": "* Bu isim kullanımda", "alertTextOk": "* Bu isim kullanılabilir", "alertTextLoad": "* Doğrulanıyor, lütfen bekleyiniz" }, "ajaxEmailCall": { "url": "ajax/member_email_check", "extraDataDynamic": ["#email"], "alertText": " alanındaki eposta adresi bir üyemiz tarafından kullanılıyor", "alertTextOk": "", "alertTextLoad": " alanındaki e-posta adresi kontrol ediliyor, lütfen bekleyiniz..." }, "ajaxNameCallPhp": { "url": "phpajax/ajaxValidateFieldName.php", "alertText": "* Bu isim kullanımda", "alertTextLoad": "* Doğrulanıyor, lütfen bekleyiniz" }, "ajaxNickCall": { "url": "ajax/member_nick_check", "alertText": "* Bu rumuz (nick) kullanımda", "alertTextOk": "* Bu rumuz (nick) kullanılabilir", "alertTextLoad": "* Doğrulanıyor, lütfen bekleyiniz" }, "validate2fields": { "alertText": "* Lütfen 'HELLO' yazın" } }; } }; $(document).ready(function() { $.validationEngineLanguage.newLang(); }); })(jQuery); (function(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)e=a.wheelDelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a], d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); ;(function($) { var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, loadingTimer, loadingFrame = 1, titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('')[0], { prop: 0 }), isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, _abort = function() { loading.hide(); imgPreloader.onerror = imgPreloader.onload = null; if (ajaxLoader) { ajaxLoader.abort(); } tmp.empty(); }, _error = function() { if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { loading.hide(); busy = false; return; } selectedOpts.titleShow = false; selectedOpts.width = 'auto'; selectedOpts.height = 'auto'; tmp.html( 'The requested content cannot be loaded.
' ); _process_inline(); }, _start = function() { var obj = selectedArray[ selectedIndex ], href, type, title, str, emb, ret; _abort(); selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); if (ret === false) { busy = false; return; } else if (typeof ret == 'object') { selectedOpts = $.extend(selectedOpts, ret); } title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; if (obj.nodeName && !selectedOpts.orig) { selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); } if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { title = selectedOpts.orig.attr('alt'); } href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; if ((/^(?:javascript)/i).test(href) || href == '#') { href = null; } if (selectedOpts.type) { type = selectedOpts.type; if (!href) { href = selectedOpts.content; } } else if (selectedOpts.content) { type = 'html'; } else if (href) { if (href.match(imgRegExp)) { type = 'image'; } else if (href.match(swfRegExp)) { type = 'swf'; } else if ($(obj).hasClass("iframe")) { type = 'iframe'; } else if (href.indexOf("#") === 0) { type = 'inline'; } else { type = 'ajax'; } } if (!type) { _error(); return; } if (type == 'inline') { obj = href.substr(href.indexOf("#")); type = $(obj).length > 0 ? 'inline' : 'ajax'; } selectedOpts.type = type; selectedOpts.href = href; selectedOpts.title = title; if (selectedOpts.autoDimensions) { if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { selectedOpts.width = 'auto'; selectedOpts.height = 'auto'; } else { selectedOpts.autoDimensions = false; } } if (selectedOpts.modal) { selectedOpts.overlayShow = true; selectedOpts.hideOnOverlayClick = false; selectedOpts.hideOnContentClick = false; selectedOpts.enableEscapeButton = false; selectedOpts.showCloseButton = false; } selectedOpts.padding = parseInt(selectedOpts.padding, 10); selectedOpts.margin = parseInt(selectedOpts.margin, 10); tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { $(this).replaceWith(content.children()); }); switch (type) { case 'html' : tmp.html( selectedOpts.content ); _process_inline(); break; case 'inline' : if ( $(obj).parent().is('#fancybox-content') === true) { busy = false; return; } $('
Please try again later.') .hide() .insertBefore( $(obj) ) .bind('fancybox-cleanup', function() { $(this).replaceWith(content.children()); }).bind('fancybox-cancel', function() { $(this).replaceWith(tmp.children()); }); $(obj).appendTo(tmp); _process_inline(); break; case 'image': busy = false; $.fancybox.showActivity(); imgPreloader = new Image(); imgPreloader.onerror = function() { _error(); }; imgPreloader.onload = function() { busy = true; imgPreloader.onerror = imgPreloader.onload = null; _process_image(); }; imgPreloader.src = href; break; case 'swf': selectedOpts.scrolling = 'no'; str = ' '; tmp.html(str); _process_inline(); break; case 'ajax': busy = false; $.fancybox.showActivity(); selectedOpts.ajax.win = selectedOpts.ajax.success; ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { url : href, data : selectedOpts.ajax.data || {}, error : function(XMLHttpRequest, textStatus, errorThrown) { if ( XMLHttpRequest.status > 0 ) { _error(); } }, success : function(data, textStatus, XMLHttpRequest) { var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; if (o.status == 200) { if ( typeof selectedOpts.ajax.win == 'function' ) { ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); if (ret === false) { loading.hide(); return; } else if (typeof ret == 'string' || typeof ret == 'object') { data = ret; } } tmp.html( data ); _process_inline(); } } })); break; case 'iframe': _show(); break; } }, _process_inline = function() { var w = selectedOpts.width, h = selectedOpts.height; if (w.toString().indexOf('%') > -1) { w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; } else { w = w == 'auto' ? 'auto' : w + 'px'; } if (h.toString().indexOf('%') > -1) { h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; } else { h = h == 'auto' ? 'auto' : h + 'px'; } tmp.wrapInner(' '); selectedOpts.width = tmp.width(); selectedOpts.height = tmp.height(); _show(); }, _process_image = function() { selectedOpts.width = imgPreloader.width; selectedOpts.height = imgPreloader.height; $("").attr({ 'id' : 'fancybox-img', 'src' : imgPreloader.src, 'alt' : selectedOpts.title }).appendTo( tmp ); _show(); }, _show = function() { var pos, equal; loading.hide(); if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { $.event.trigger('fancybox-cancel'); busy = false; return; } busy = true; $(content.add( overlay )).unbind(); $(window).unbind("resize.fb scroll.fb"); $(document).unbind('keydown.fb'); if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { wrap.css('height', wrap.height()); } currentArray = selectedArray; currentIndex = selectedIndex; currentOpts = selectedOpts; if (currentOpts.overlayShow) { overlay.css({ 'background-color' : currentOpts.overlayColor, 'opacity' : currentOpts.overlayOpacity, 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', 'height' : $(document).height() }); if (!overlay.is(':visible')) { if (isIE6) { $('select:not(#fancybox-tmp select)').filter(function() { return this.style.visibility !== 'hidden'; }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { this.style.visibility = 'inherit'; }); } overlay.show(); } } else { overlay.hide(); } final_pos = _get_zoom_to(); _process_title(); if (wrap.is(":visible")) { $( close.add( nav_left ).add( nav_right ) ).hide(); pos = wrap.position(), start_pos = { top : pos.top, left : pos.left, width : wrap.width(), height : wrap.height() }; equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); content.fadeTo(currentOpts.changeFade, 0.3, function() { var finish_resizing = function() { content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); }; $.event.trigger('fancybox-change'); content .empty() .removeAttr('filter') .css({ 'border-width' : currentOpts.padding, 'width' : final_pos.width - currentOpts.padding * 2, 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 }); if (equal) { finish_resizing(); } else { fx.prop = 0; $(fx).animate({prop: 1}, { duration : currentOpts.changeSpeed, easing : currentOpts.easingChange, step : _draw, complete : finish_resizing }); } }); return; } wrap.removeAttr("style"); content.css('border-width', currentOpts.padding); if (currentOpts.transitionIn == 'elastic') { start_pos = _get_zoom_from(); content.html( tmp.contents() ); wrap.show(); if (currentOpts.opacity) { final_pos.opacity = 0; } fx.prop = 0; $(fx).animate({prop: 1}, { duration : currentOpts.speedIn, easing : currentOpts.easingIn, step : _draw, complete : _finish }); return; } if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { title.show(); } content .css({ 'width' : final_pos.width - currentOpts.padding * 2, 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 }) .html( tmp.contents() ); wrap .css(final_pos) .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); }, _format_title = function(title) { if (title && title.length) { if (currentOpts.titlePosition == 'float') { return '
'; } return '
' + title + ' ' + title + ''; } return false; }, _process_title = function() { titleStr = currentOpts.title || ''; titleHeight = 0; title .empty() .removeAttr('style') .removeClass(); if (currentOpts.titleShow === false) { title.hide(); return; } titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); if (!titleStr || titleStr === '') { title.hide(); return; } title .addClass('fancybox-title-' + currentOpts.titlePosition) .html( titleStr ) .appendTo( 'body' ) .show(); switch (currentOpts.titlePosition) { case 'inside': title .css({ 'width' : final_pos.width - (currentOpts.padding * 2), 'marginLeft' : currentOpts.padding, 'marginRight' : currentOpts.padding }); titleHeight = title.outerHeight(true); title.appendTo( outer ); final_pos.height += titleHeight; break; case 'over': title .css({ 'marginLeft' : currentOpts.padding, 'width' : final_pos.width - (currentOpts.padding * 2), 'bottom' : currentOpts.padding }) .appendTo( outer ); break; case 'float': title .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) .appendTo( wrap ); break; default: title .css({ 'width' : final_pos.width - (currentOpts.padding * 2), 'paddingLeft' : currentOpts.padding, 'paddingRight' : currentOpts.padding }) .appendTo( wrap ); break; } title.hide(); }, _set_navigation = function() { if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { $(document).bind('keydown.fb', function(e) { if (e.keyCode == 27 && currentOpts.enableEscapeButton) { e.preventDefault(); $.fancybox.close(); } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { e.preventDefault(); $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); } }); } if (!currentOpts.showNavArrows) { nav_left.hide(); nav_right.hide(); return; } if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { nav_left.show(); } if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { nav_right.show(); } }, _finish = function () { if (!$.support.opacity) { content.get(0).style.removeAttribute('filter'); wrap.get(0).style.removeAttribute('filter'); } if (selectedOpts.autoDimensions) { content.css('height', 'auto'); } wrap.css('height', 'auto'); if (titleStr && titleStr.length) { title.show(); } if (currentOpts.showCloseButton) { close.show(); } _set_navigation(); if (currentOpts.hideOnContentClick) { content.bind('click', $.fancybox.close); } if (currentOpts.hideOnOverlayClick) { overlay.bind('click', $.fancybox.close); } $(window).bind("resize.fb", $.fancybox.resize); if (currentOpts.centerOnScroll) { $(window).bind("scroll.fb", $.fancybox.center); } if (currentOpts.type == 'iframe') { $(' ').appendTo(content); } wrap.show(); busy = false; $.fancybox.center(); currentOpts.onComplete(currentArray, currentIndex, currentOpts); _preload_images(); }, _preload_images = function() { var href, objNext; if ((currentArray.length -1) > currentIndex) { href = currentArray[ currentIndex + 1 ].href; if (typeof href !== 'undefined' && href.match(imgRegExp)) { objNext = new Image(); objNext.src = href; } } if (currentIndex > 0) { href = currentArray[ currentIndex - 1 ].href; if (typeof href !== 'undefined' && href.match(imgRegExp)) { objNext = new Image(); objNext.src = href; } } }, _draw = function(pos) { var dim = { width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) }; if (typeof final_pos.opacity !== 'undefined') { dim.opacity = pos < 0.5 ? 0.5 : pos; } wrap.css(dim); content.css({ 'width' : dim.width - currentOpts.padding * 2, 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 }); }, _get_viewport = function() { return [ $(window).width() - (currentOpts.margin * 2), $(window).height() - (currentOpts.margin * 2), $(document).scrollLeft() + currentOpts.margin, $(document).scrollTop() + currentOpts.margin ]; }, _get_zoom_to = function () { var view = _get_viewport(), to = {}, resize = currentOpts.autoScale, double_padding = currentOpts.padding * 2, ratio; if (currentOpts.width.toString().indexOf('%') > -1) { to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); } else { to.width = currentOpts.width + double_padding; } if (currentOpts.height.toString().indexOf('%') > -1) { to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); } else { to.height = currentOpts.height + double_padding; } if (resize && (to.width > view[0] || to.height > view[1])) { if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { ratio = (currentOpts.width ) / (currentOpts.height ); if ((to.width ) > view[0]) { to.width = view[0]; to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); } if ((to.height) > view[1]) { to.height = view[1]; to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); } } else { to.width = Math.min(to.width, view[0]); to.height = Math.min(to.height, view[1]); } } to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); return to; }, _get_obj_pos = function(obj) { var pos = obj.offset(); pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; pos.width = obj.width(); pos.height = obj.height(); return pos; }, _get_zoom_from = function() { var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, from = {}, pos, view; if (orig && orig.length) { pos = _get_obj_pos(orig); from = { width : pos.width + (currentOpts.padding * 2), height : pos.height + (currentOpts.padding * 2), top : pos.top - currentOpts.padding - 20, left : pos.left - currentOpts.padding - 20 }; } else { view = _get_viewport(); from = { width : currentOpts.padding * 2, height : currentOpts.padding * 2, top : parseInt(view[3] + view[1] * 0.5, 10), left : parseInt(view[2] + view[0] * 0.5, 10) }; } return from; }, _animate_loading = function() { if (!loading.is(':visible')){ clearInterval(loadingTimer); return; } $('div', loading).css('top', (loadingFrame * -40) + 'px'); loadingFrame = (loadingFrame + 1) % 12; }; $.fn.fancybox = function(options) { if (!$(this).length) { return this; } $(this) .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) .unbind('click.fb') .bind('click.fb', function(e) { e.preventDefault(); if (busy) { return; } busy = true; $(this).blur(); selectedArray = []; selectedIndex = 0; var rel = $(this).attr('rel') || ''; if (!rel || rel == '' || rel === 'nofollow') { selectedArray.push(this); } else { selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); selectedIndex = selectedArray.index( this ); } _start(); return; }); return this; }; $.fancybox = function(obj) { var opts; if (busy) { return; } busy = true; opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; selectedArray = []; selectedIndex = parseInt(opts.index, 10) || 0; if ($.isArray(obj)) { for (var i = 0, j = obj.length; i < j; i++) { if (typeof obj[i] == 'object') { $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); } else { obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); } } selectedArray = jQuery.merge(selectedArray, obj); } else { if (typeof obj == 'object') { $(obj).data('fancybox', $.extend({}, opts, obj)); } else { obj = $({}).data('fancybox', $.extend({content : obj}, opts)); } selectedArray.push(obj); } if (selectedIndex > selectedArray.length || selectedIndex < 0) { selectedIndex = 0; } _start(); }; $.fancybox.showActivity = function() { clearInterval(loadingTimer); loading.show(); loadingTimer = setInterval(_animate_loading, 66); }; $.fancybox.hideActivity = function() { loading.hide(); }; $.fancybox.next = function() { return $.fancybox.pos( currentIndex + 1); }; $.fancybox.prev = function() { return $.fancybox.pos( currentIndex - 1); }; $.fancybox.pos = function(pos) { if (busy) { return; } pos = parseInt(pos); selectedArray = currentArray; if (pos > -1 && pos < currentArray.length) { selectedIndex = pos; _start(); } else if (currentOpts.cyclic && currentArray.length > 1) { selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; _start(); } return; }; $.fancybox.cancel = function() { if (busy) { return; } busy = true; $.event.trigger('fancybox-cancel'); _abort(); selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); busy = false; }; $.fancybox.close = function() { if (busy || wrap.is(':hidden')) { return; } busy = true; if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { busy = false; return; } _abort(); $(close.add( nav_left ).add( nav_right )).hide(); $(content.add( overlay )).unbind(); $(window).unbind("resize.fb scroll.fb"); $(document).unbind('keydown.fb'); content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); if (currentOpts.titlePosition !== 'inside') { title.empty(); } wrap.stop(); function _cleanup() { overlay.fadeOut('fast'); title.empty().hide(); wrap.hide(); $.event.trigger('fancybox-cleanup'); content.empty(); currentOpts.onClosed(currentArray, currentIndex, currentOpts); currentArray = selectedOpts = []; currentIndex = selectedIndex = 0; currentOpts = selectedOpts = {}; busy = false; } if (currentOpts.transitionOut == 'elastic') { start_pos = _get_zoom_from(); var pos = wrap.position(); final_pos = { top : pos.top , left : pos.left, width : wrap.width(), height : wrap.height() }; if (currentOpts.opacity) { final_pos.opacity = 1; } title.empty().hide(); fx.prop = 1; $(fx).animate({ prop: 0 }, { duration : currentOpts.speedOut, easing : currentOpts.easingOut, step : _draw, complete : _cleanup }); } else { wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); } }; $.fancybox.resize = function() { if (overlay.is(':visible')) { overlay.css('height', $(document).height()); } $.fancybox.center(true); }; $.fancybox.center = function() { var view, align; if (busy) { return; } align = arguments[0] === true ? 1 : 0; view = _get_viewport(); if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { return; } wrap .stop() .animate({ 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) }, typeof arguments[0] == 'number' ? arguments[0] : 200); }; $.fancybox.init = function() { if ($("#fancybox-wrap").length) { return; } $('body').append( tmp = $(''), loading = $(''), overlay = $(''), wrap = $('') ); outer = $('') .append('') .appendTo( wrap ); outer.append( content = $(''), close = $(' '), title = $(''), nav_left = $(' '), nav_right = $(' ') ); close.click($.fancybox.close); loading.click($.fancybox.cancel); nav_left.click(function(e) { e.preventDefault(); $.fancybox.prev(); }); nav_right.click(function(e) { e.preventDefault(); $.fancybox.next(); }); if ($.fn.mousewheel) { wrap.bind('mousewheel.fb', function(e, delta) { if (busy) { e.preventDefault(); } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { e.preventDefault(); $.fancybox[ delta > 0 ? 'prev' : 'next'](); } }); } if (!$.support.opacity) { wrap.addClass('fancybox-ie'); } if (isIE6) { loading.addClass('fancybox-ie6'); wrap.addClass('fancybox-ie6'); $(' ').prependTo(outer); } }; $.fn.fancybox.defaults = { padding : 10, margin : 40, opacity : false, modal : false, cyclic : false, scrolling : 'auto', // 'auto', 'yes' or 'no' width : 560, height : 340, autoScale : true, autoDimensions : true, centerOnScroll : false, ajax : {}, swf : { wmode: 'transparent' }, hideOnOverlayClick : true, hideOnContentClick : false, overlayShow : true, overlayOpacity : 0.7, overlayColor : '#777', titleShow : true, titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' titleFormat : null, titleFromAlt : false, transitionIn : 'fade', // 'elastic', 'fade' or 'none' transitionOut : 'fade', // 'elastic', 'fade' or 'none' speedIn : 300, speedOut : 300, changeSpeed : 300, changeFade : 'fast', easingIn : 'swing', easingOut : 'swing', showCloseButton : true, showNavArrows : true, enableEscapeButton : true, enableKeyboardNav : true, onStart : function(){}, onCancel : function(){}, onComplete : function(){}, onCleanup : function(){}, onClosed : function(){}, onError : function(){} }; $(document).ready(function() { $.fancybox.init(); }); })(jQuery); ;(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window)._scrollable();};$.fn._scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeNamNZD$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin) return elem;var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=='BackCompat'?doc.body:doc.documentElement;});};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;} if(typeof settings=='function') settings={onAfter:settings};if(target=='max') target=9e9;settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue) duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this._scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;} targ=$(targ,this);case'object':if(targ.is||targ.style) toff=(targ=$(targ)).offset();} $.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0;} attr[key]+=settings.offset[pos]||0;if(settings.over[pos]) attr[key]+=targ[axis=='x'?'width':'height']()*settings.over[pos];}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)=='%'?parseFloat(val)/100*max :val;} if(/^\d+$/.test(attr[key])) attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&settings.queue){if(old!=attr[key]) animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings);});};}).end();};$scrollTo.max=function(elem,axis){var Dim=axis=='x'?'Width':'Height',scroll='scroll'+Dim;if(!$(elem).is('html,body')) return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll]) -Math.min(html[size],body[size]);};function both(val){return typeof val=='object'?val:{top:val,left:val};};})(jQuery); (function($) { $.fn.easySlider = function(options){ var defaults = { prevId: 'prevBtn', prevText: '', nextId: 'nextBtn', nextText: '', controlsShow: true, controlsBefore: '', controlsAfter: '', controlsFade: true, firstId: 'firstBtn', firstText: '', firstShow: false, lastId: 'lastBtn', lastText: '', lastShow: false, vertical: false, speed: 1500, auto: false, pause: 3000, continuous: false }; var options = $.extend(defaults, options); this.each(function() { var obj = $(this); var s = $("li", obj).length; var w = $("li", obj).width(); var h = $("li", obj).height(); obj.width(w); obj.height(h); obj.css("overflow","hidden"); var ts = s-1; var t = 0; $("ul", obj).css('width',s*w); if(!options.vertical) $("li", obj).css('float','left'); if(options.controlsShow){ var html = options.controlsBefore; if(options.firstShow) html += ' '; html += ' '; html += ' '; if(options.lastShow) html += ' '; html += options.controlsAfter; $(obj).after(html); }; $("a","."+options.nextId).click(function(){ animate("next",true); }); $("a","."+options.prevId).click(function(){ animate("prev",true); }); $("a","."+options.firstId).click(function(){ animate("first",true); }); $("a","."+options.lastId).click(function(){ animate("last",true); }); function animate(dir,clicked){ var ot = t; switch(dir){ case "next": t = (ot>=ts) ? (options.continuous ? 0 : ts) : t+1; break; case "prev": t = (t<=0) ? (options.continuous ? ts : 0) : t-1; break; case "first": t = 0; break; case "last": t = ts; break; default: break; }; var diff = Math.abs(ot-t); var speed = diff*options.speed; if(!options.vertical) { p = (t*w*-1); $("ul",obj).animate( { marginLeft: p }, speed ); } else { p = (t*h*-1); $("ul",obj).animate( { marginTop: p }, speed ); }; if(!options.continuous && options.controlsFade){ if(t==ts){ $("a","."+options.nextId).hide(); $("a","."+options.lastId).hide(); } else { $("a","."+options.nextId).show(); $("a","."+options.lastId).show(); }; if(t==0){ $("a","."+options.prevId).hide(); $("a","."+options.firstId).hide(); } else { $("a","."+options.prevId).show(); $("a","."+options.firstId).show(); }; }; if(clicked) clearTimeout(timeout); if(options.auto && dir=="next" && !clicked){; timeout = setTimeout(function(){ animate("next",false); },diff*options.speed+options.pause); }; }; var timeout; if(options.auto){; timeout = setTimeout(function(){ animate("next",false); },options.pause); }; if(!options.continuous && options.controlsFade){ $("a","."+options.prevId).hide(); $("a","."+options.firstId).hide(); }; }); }; })(jQuery); var root = location.protocol + '//' + location.host; $(document).ready(function () { if (typeof $.fn.live === 'undefined') { $.fn.live = function (event, foksiyon) { $(document).on(event, this.selector, foksiyon); }; } (function ($) { $.fn.yukseklikEsitle = function () { var nesneSay = this.length; var enYuksek = this.eq(0).height(); for (i = 1; i < nesneSay; ++i) { var currHeight = this.eq(i).height(); if (currHeight > enYuksek) { enYuksek = currHeight } } this.height(enYuksek); return this }; })(jQuery); $('#FormAra, #UstAra').submit(function (e) { var t = $('#livesearch_input').val(); t = t.replace(/\.+/ig, '.'); $('#livesearch_input').val(t); }); $('#cart-wrapper').bind('sepeteEkle', function (e, item) { $(this).html(item); }); $('.MobileRedirectMessage').click(GoRedirectMobile); $('.UyeLogin').click(function (e) { e.preventDefault(); memberLogin($(this).attr('alt'), 0); return false; }); $('#uye-login').live('click', function (e) { e.preventDefault(); memberLogin('uye-', 0); return false; }); $('#uye-eposta').keydown(function (e) { if (e.keyCode == 13) { if ($('#parola').val() == '') $('#parola').focus(); else memberLogin('uye-', 0); } }); $('#uye-parola').keydown(function (e) { if (e.keyCode == 13) memberLogin('uye-', 0); }); $('#ug-eposta').focus(); $('#ug-login').live('click', function () { memberLogin('ug-', 0); return false; }); $('#ug-eposta').keydown(function (e) { if (e.keyCode == 13) { if ($('#ug-parola').val() == '') $('#ug-parola').focus(); else memberLogin('ug-', 0) } }); $('#ug-parola').keydown(function (e) { if (e.keyCode == 13) memberLogin('ug-', 0) }); $('#uye-kayit-login').click(orderLogin); //üyeliksiz giriş $('#bayi-login').click(function (e) { memberLogin('bayi-', '1'); return false; }); $('#bayi-eposta').keydown(function (e) { if (e.keyCode == 13) { if ($('#bayi-parola').val() == '') $('#bayi-parola').focus(); else memberLogin('bayi-', '1'); } }); $('#bayi-parola').keydown(function (e) { if (e.keyCode == 13) memberLogin('bayi-', '1'); }); $('#ebulten-eposta').keydown(function (e) { if (e.keyCode == 13) saveMaillist(); }); $('#ebulten-soyad,#ebulten-ad').keydown(function (e) { if (e.keyCode == 13) { if ($(this).attr('id') == 'ebulten-ad' && document.getElementById('ebulten-soyad')) $('#ebulten-soyad').focus(); else $('#ebulten-eposta').focus(); } }); $('#ebulten-kaydet').click(saveMaillist); $('.c-product .GenelButon').live('click', function () { var mainPrId = $(this).attr('alt').split('-'); var prId = parseInt(mainPrId[0]); var prSubId = mainPrId[2] ? parseInt(mainPrId[2]) : ''; mainPrId = parseInt(mainPrId[1]); if (mainPrId > 0 && prId > 0) { var mainPrSubId = c_altUrunId(); mainPrId = mainPrSubId > 0 ? mainPrId + ':' + mainPrSubId : mainPrId; sepeteEkle(prId, prSubId, 1, '', '', mainPrId); } else if (prId > 0) { sepeteEkle.onSuccess = function () { $(this).fadeOut().fadeIn(); }; sepeteEkle(prId, c_altUrunId(), -1); } return false; }); $('#site-yorum-gonder').click(function () { var memberId = $(this).attr('alt'); var comment = $('textarea#site-yorum').val(); if (isNaN(memberId) || comment.length < 3) { if (typeof TSOFT !== 'undefined') TSOFT.showDialog('Dikkat', "Yorum alanını boş bırakamazsınız.", 300, 100); else alert("Yorum alanını boş bırakamazsınız."); return false; } $.ajax({ type: "POST", url: "ajax.php", data: {m: 'Block', fn: 'siteComment', memberId: memberId, comment: comment}, success: function (msg) { if (msg > 0) $('#yorum-ekle-tasiyici').html('Yorumunuz onaylandıktan sonra yayınlanacaktır. Teşekkür ederiz..'); } }); return false; }); $('.vitrin_tab').click(function (e) { e.preventDefault(); var tabId = this.hash; var holderId = $(this).parent().attr('id').replace("tab-holder-", ""); var parentId = $(this).attr('alt'); var holder = '#tab-content-' + parentId; var p = $(this).parent().parent(); if (typeof p.attr('data-tab') === 'undefined') { p.attr('data-tab', '1'); $(holder).html(''); } var oldPage = parseInt($(this).attr('data-oldPage')); var newPage = parseInt($(this).attr('data-newPage')); newPage = isNaN(newPage) ? 1 : newPage; var cls = 'cls_' + $(this).attr('href') + '_' + $(this).text(); cls = cls.replace(/\W/ig, '') + '_pageId_' + newPage + '_' + parentId; var loading = ' '; if ($(this).parents('.Vitrin').find('.tabLoading').length === 0) $(holder).append(loading); var div = $('.' + cls); if (div.length === 0) { $(holder).append(''); div = $(holder).find('.' + cls); loadPage(tabId, div, newPage); } $(this).attr('data-oldPage', newPage); $("#tab-holder-" + holderId + " a").removeClass('Aktif'); $(this).addClass('Aktif'); $(this).parents('.Vitrin').find('.tabSekmeIcerik').hide(); $('.' + cls).show(); }); $('.vitrin_tab_ileri').click(function (e) { e.preventDefault(); var div = $(this).parents('.Vitrin').find('.vitrin_tab.Aktif'); var cls = 'cls_' + div.attr('href') + '_' + div.text(); cls = cls.replace(/\W/ig, ''); var page = parseInt(div.attr('data-newPage')); page = isNaN(page) ? 1 : page; div.attr('data-oldPage', page); page++; div.attr('data-newPage', page); $('.' + cls).find('.tabCurrentPage').val(page); div.removeClass('Aktif').trigger('click'); }); $('.vitrin_tab_geri').click(function (e) { e.preventDefault(); var div = $(this).parents('.Vitrin').find('.vitrin_tab.Aktif'); var cls = 'cls_' + div.attr('href') + '_' + div.text(); cls = cls.replace(/\W/ig, ''); var page = parseInt(div.attr('data-newPage')); page = isNaN(page) ? 1 : page; div.attr('data-oldPage', page); if (page > 1) page--; div.attr('data-newPage', page); $('.' + cls).find('.tabCurrentPage').val(page); div.removeClass('Aktif').trigger('click'); }); $('.Vitrin .Sekmeler a:first').each(function () { $(this).addClass('Aktif'); }); function loadPage(url, holder, pageNo) { pageNo = isNaN(pageNo) || pageNo < 1 ? 1 : pageNo; holder.parents('.Vitrin').find('.tabLoading').show(); url = url.replace('#sekme', ''); var id = holder.attr('id'); if (id != null) $("#loading-" + id.replace('tab-content-', '')).show(); $('.vitrin_tab_ileri').css('display', 'none !important'); $('.vitrin_tab_geri').css('display', 'none !important'); var parentId = holder.parents('.Vitrin').find('.vitrin_tab:first').attr('alt'); var subInput = $('#subTpl_' + parentId).length === 1 ? $('#subTpl_' + parentId) : holder.parents('.Vitrin').parent().find('input[name=subTpl]:first'); var subTpl = encodNZDI(subInput.val()); $.ajax({ url: '/conn/product/ShowCase/tab/' + url + '/' + subTpl + '/Orta', data: {SAG_AKTIF: $('#sag_aktif').val(), SOL_AKTIF: $('#sol_aktif').val(), PAGE: pageNo}, dataType: "html", success: function (msg) { if (id != null) $("#loading-" + id.replace('tab-content-', '')).hide(); $(holder).css('visibility', 'hidden'); $(holder).html(msg); $(holder).fadeOut(100); $(holder).css('visibility', 'visible'); $('.tabLoading').hide(); $(holder).fadeIn(300, function () { $('.vitrin_tab_ileri').css('display', 'block !important'); $('.vitrin_tab_geri').css('display', 'block !important'); }); } }); } $('.Vitrin').each(function () { $(this).find('.vitrin_tab:first').addClass('Aktif'); ; }); if ($('div.KapananBlok').length > 0) { var KutuId = $("div.KapananBlok") // find spans with ID attribute .map(function () { return this.id; }) // convert to set of IDs .get(); for (var i = 0; i < KutuId.length; i++) if (getCookie(KutuId[i]) == 'true') $('#' + KutuId[i]).remove(); //denemek için: alert(KutuId[i]); $('.killdiv').mouseover(function () { $(this).animate({ opacity: 1 }, 250, function () { }); }).mouseout(function () { $(this).animate({ opacity: 0.1 }, 250, function () { }); }); $('.killdiv').click(function () { $(this).parent().remove(); KutuId = $(this).parent().attr("id"); setCookie(KutuId, "true", 1); }); } $("#popupContactClose").click(function () { disablePopup(); }); $("#overlay").click(function () { disablePopup(); }); $(document).keypress(function (e) { if (e.keyCode == 27 && popupStatus == 1) { disablePopup(); } }); var hash = window.location.hash; if (hash.substr(0, 3) == '#T_') { hash = hash.replace('#T_', ''); hash = hash.split('_|_'); var block = hash[0]; popup(block, hash[1]); window.location.hash = '#'; } $('.karsilastirma').click(karsilastirmaKontrol); $(".karsilastirma").live("click", function () { sendCompareProductId($(this).attr("value")); }); function getBasNZDl(param, val) { var val = val || ''; var link = window.location.href; link = link.replace(/#.*$/, '') + '&'; var re = new RegExp("(\\?|&)" + param + "=", "g"); if (re.test(link)) { re = new RegExp("(\\?|&)(" + param + "=)([^\&]*?)&", "g"); link = link.replace(re, "$1$2" + val + "&"); } else { link += link.indexOf('?') > -1 ? "&" + param + "=" + val : "?" + param + "=" + val; } link = link.replace(/&?\?&?/g, '?'); link = link.replace(/&$/g, ''); link = link.replace(/&&/g, '&'); link = link.replace(/\?&$/g, '?'); return link.replace(/&$/g, ''); } $('.BlokSecim a').click(function (e) { e.preventDefault(); var gr = ''; if ($(this).hasClass('Yatay')) gr = '1'; else if ($(this).hasClass('Liste')) gr = '2'; else if ($(this).hasClass('Katalog')) gr = '3'; else return false; getBasNZDl('Gr', gr); window.location.href = getBasNZDl('Gr', gr); }); $('select[name=Sr], #Sr').change(function (e) { e.preventDefault(); getBasNZDl('Sr', $(this).val()); window.location.href = getBasNZDl('Sr', $(this).val()); }); $('input[name=St], #St').change(function (e) { e.preventDefault(); var val = $(this).is(':checked') ? '1' : ''; var url = getBasNZDl('St', val); url = url.replace(/Baslan=\d+/g, 'Baslan=1'); window.location.href = url; }); $('#sepet-coklu-islem').click(function (e) { e.preventDefault(); sepetTopluIslem(); setTimeout(function () { $(".ckWrapper").remove(); $(".ckOverlay").remove(); }, 3000); }); var myPagNZDl = window.location.href || ''; if (/(\?|\&)(q=[^&]*)/ig.test(myPagNZDl)) { var aramaVal = '' + myPagNZDl.replace(/^.*?(\?|\&)q=([^&]*).*?$/ig, "$2"); aramaVal = decodNZDI(aramaVal.replace(/\++/ig, ' ')); } }); var sepetTopluIslem = function () { $('#toplu-islem-form input[type=checkbox].karsilastirma').each(function () { var sThisVal = (this.checked ? "1" : "0"); if (sThisVal == "1") { var sUid = this.value; sepeteEkle((sUid), $('#alt_urun_' + sUid).val(), $('#sepet-adet-' + sUid).val(), '', ''); sepeteEkle.showCartWin = false; } }); } function c_altUrunId() { var c_altUrunId = ''; if (document.getElementById('AltUrunId')) c_altUrunId = document.getElementById('AltUrunId').value; return c_altUrunId; } var sepeteEkle; sepeteEkle.onSuccess = undefined; sepeteEkle.callBack = undefined; var sepeteGit = function () { location.href = 'Sepet.php'; } var sepetPopup = function () { } function sepeteEkle(urunId, altUrunId, adet, onceHtml, sonraHtml, iliskiliAnaUrunId) { sepeteEkle.showCartWin = true; if ($('#dialogCss').length < 1) { var css = jQuery(" "); css.attr({ rel: "stylesheet", id: 'dialogCss', type: "text/css", href: "/theme/standart/css/dialog.css" }); $("head").append(css); } if (altUrunId == 'sec' || (altUrunId != '' && altUrunId < 0)) { if (sepeteEkle.onAlturunAlert != undefined) { sepeteEkle.onAlturunAlert(); sepeteEkle.onAlturunAlert = undefined; return false; } else { if (typeof TSOFT !== 'undefined') TSOFT.showDialog(LANG.get('dikkat'), LANG.get('alt_urun_seciniz'), 300, 100); else alert(LANG.get('alt_urun_seciniz')); } return false; } $.ajax({ type: "POST", url: "/ajax.php", data: { m: 'Cart', fn: 'add2Cart', urunId: urunId, altUrunId: altUrunId, adet: adet, iliskiliAnaUrunId: iliskiliAnaUrunId, orderNote: $("#order-note" + urunId).val() }, success: function (cevap) { var r = $.parseJSON(cevap); $('.AcilirSepet').remove(); if (r.success == "true") { if (r.url != '') { location.href = r.url; } else if (sepeteEkle.onSuccess != undefined) { sepeteEkle.onSuccess(); sepeteEkle.onSuccess = undefined; } if (typeof sepeteEkle.callBack === 'function') { sepeteEkle.callBack(urunId); } if (typeof PersonalizationForm === 'function') { PersonalizationValidate = false; try { PersonalizationValidate = PersonalizationForm.instance.productDetail.validate(); } catch (ex) { } if (PersonalizationValidate) { try { PersonalizationForm.instance.productDetail.saveForm(); } catch (ex) { } } } $('#cart-wrapper').trigger('sepeteEkle', stripslashes(r.html)); if (onceHtml == undefined) onceHtml = ' ' + LANG.get('sepete_ekle') + ' '; else onceHtml = $("#Sepet" + urunId).html(); if (sonraHtml == undefined) sonraHtml = ' ' + LANG.get('sepete_eklendi') + ' '; else sonraHtml = $("#Sepet" + urunId).html(); $("#Sepet" + urunId).hide().html(sonraHtml).fadeIn(1000, function () { if (onceHtml != sonraHtml) setTimeout(function () { $("#Sepet" + urunId).html(onceHtml); }, 1000); }); if (document.getElementById('cart-soft-message')) { $('#cart-soft-message').fadeIn('slow').delay(1000).fadeOut('fast'); } if (document.getElementById('cart-soft-count')) { $('#cart-soft-count').animate({opacity: 0.25}, 500, function () { $(this).find('span').html(r.amount); $(this).find('label').html(r.totalPrice); $(this).animate({ opacity: 1 }); }); } $('.norm').css('position', 'relative'); var str = ''; $('#fiyat_' + urunId).parents('.norm').append(str); $('#fiyat_' + urunId).parents('.norm').find('.karsilastirma').removeAttr('checked'); $('.sepetUstKatman').unbind('click').click(function () { $(this).remove(); }); if (typeof iliskiliAnaUrunId !== 'undefined') { if (typeof TSOFT !== 'undefined') TSOFT.debug('Ürünler başarıyla sepetinize eklendi.', 3000); else { if (typeof r.msg == "undefined") { alert('Ürün başarıyla sepetinize eklendi.'); } else { alert(r.msg); } } } else { if (sepeteEkle.showCartWin === true) { Cart.show(urunId); } else { TSOFT.debug('Ürün başarıyla sepetinize eklendi.', 3000, 300); } } } else { if (typeof TSOFT !== 'undefined') TSOFT.debug(r.msg, 3000); else alert(r.msg); } } }); return false; } function alarmListemeEkle(urunId, fiyat, kur) { if (document.getElementById('AltUrunId') && ($('#AltUrunId').val() == '' || $('#AltUrunId').val() == 0 || $('#AltUrunId').val() == -1)) { loadPopup('', ' ' + LANG.get('alarm_uyari')); return false; } var altUrunId = !$('#AltUrunId').val() ? 0 : $('#AltUrunId').val(); popup('AlarmListem', '{"Uid":"' + urunId + '","AltUrunId":"' + altUrunId + '","Kur":"' + kur + '"}'); return true; } function alisverisListemeEkle(urunJson, altUrunId) { if (altUrunId == null) { altUrunId = typeof $('#AltUrunId').val() === 'undefined' ? '' : $('#AltUrunId').val(); if (altUrunId === '0') { var msg = 'Lütfen alt ürün seçiniz'; if (typeof l_arr === 'object') { msg = typeof LANG.get('alt_urun_seciniz') === 'undefined' ? msg : LANG.get('alt_urun_seciniz'); } TSOFT.showDialog('Dikkat', msg); return false; } } if (urunJson > 0) urunJson = '"' + urunJson + '|' + altUrunId + '"'; popup('AlisverisListem', '{"Uids":[' + urunJson + ']}'); return true; } function sepetiAlisverisListemeEkle() { popup('AlisverisListem', '{"Sepet":"1"}'); return false } function stoktaOluncaBildir(urunId, altUrunId) { if (altUrunId == null && document.getElementById('AltUrunId')) { altUrunId = $('#AltUrunId').val(); if (parseInt(altUrunId) <= 0) { alert(LANG.get('stok_alturun_uyari')); return false; } } $.ajax({ type: "POST", url: "ajax.php", data: "m=Block&fn=add2NotifyList&prId=" + urunId + "&subPrId=" + altUrunId, dataType: 'json', success: function (cevap) { if (parseInt(cevap.status) == 1) { alert(cevap.statusText, cevap.btnText); } else { popup('UyeGiris') } } }) } function urunGoster(ref, tasiyan) { $.ajax({ type: "POST", url: "ajax.php", data: "m=Block&fn=productView&ref=" + ref, success: function (cevap) { $("#" + tasiyan).html(cevap); } }); } var popup; popup.onSuccess = undefined; function popup(block, paramsJson) { $.ajax({ type: "POST", url: "ajax.php", dataType: "json", data: { m: 'Block', fn: 'initPopup', block: block, params: paramsJson }, complete: function (jsonObj) { jsonObj = $.parseJSON(jsonObj.responseText); if (typeof jsonObj.success === 'undefined') { if (typeof TSOFT !== 'undefined') TSOFT.showDialog('Dikkat', 'Üyelik Girişi Yapınız.', 300, 100); else alert('Üyelik Girişi Yapınız.'); return false; } if (jsonObj.success == "false") { if (jsonObj.url != null) { popup(jsonObj.url, '{"Referer":"' + location.href + '","Hash":"' + block + '_|_' + addslashes(paramsJson) + '"}'); return; } else if (jsonObj.msg != '') { loadPopup('Uyarı..', jsonObj.msg); return false; } } else if (jsonObj.success == "true") { loadPopup(jsonObj.data.header, jsonObj.data.content); $('#popup-content .UyeForm h3').remove(); if (popup.onSuccess != null) { popup.onSuccess(); popup.onSuccess = null; } } else { if (typeof TSOFT !== 'undefined') TSOFT.showDialog('Dikkat', 'Beklenmeyen durum oluştu.', 300, 100); else alert('Beklenmeyen durum oluştu.'); } } }) } function blockContent(blockname, containerId) { $.ajax({ type: "POST", url: "ajax.php", dataType: "json", data: { m: 'Block', fn: 'initPopup', block: blockname, params: '' }, complete: function (jsonObj) { var jsonObj = $.parseJSON(jsonObj.responseText); if (jsonObj.success == "true") { $('#' + containerId).html(jsonObj.data.content); } else if (jsonObj.success != "false") { console.log('Beklenmeyen durum oluştu.'); } } }) } var formMap = new Array(); var memberLogin; memberLogin.callBack = undefined; function memberLogin(idPrefix, isVendor) { formMap['username'] = idPrefix + 'eposta'; formMap['password'] = idPrefix + 'parola'; formMap['message'] = idPrefix + 'mesaj'; formMap['loading'] = idPrefix + 'loading'; formMap['login'] = idPrefix + 'login'; var username = $('#' + formMap['username']).val(); var password = $('#' + formMap['password']).val(); if (username == '' || password == '') { $('#' + formMap['message']).html(LANG.get('eposta_sifre_bos')); $('#' + formMap['password']) return false; } $('#' + formMap['login']).css('display', 'none !important'); $('#' + formMap['loading']).show(); $.ajax({ type: "POST", url: "ajax.php", data: "m=Member&fn=memberLogin&user=" + username + '&pass=' + password + '&vendor=' + parseInt(isVendor) + '&rm=' + $('#beni-hatirla:checked').val(), success: function (json) { var data = $.parseJSON(json); var elId = ''; if (typeof memberLogin.callBack === 'function') { memberLogin.callBack(data); } if (data.isLogin == 0) { $('#' + formMap['message']).html(stripslashes(data.msg)); $('#' + formMap['username']).focus(); $('#' + formMap['login']).css('display', 'block !important'); $('#' + formMap['loading']).hide(); } else if (data.isLogin == 1) { if (data.hash != '') { location.hash = data.hash; location.reload(true); } else if (data.redirectionUrl != '') { var ref = window.location.hash.substr(1); var bulSepet = window.location.href.indexOf('Sepet=1'); if (bulSepet > 0 || ref == 'ref=siparis') sepeteGit(); else location.href = data.redirectionUrl; } else if (strpos(location.href, 'Cikis', 0) !== false) { location.href = location.href.replace('?B=Cikis', ''); } else { location.reload(); } } } }); return false; } function sl(el) { var ld = ' 0) { for (var i in data.requiredFields) { var elId = 'uye-' + data.requiredFields[i]; if (document.getElementById(elId)) { $('#' + elId).focus(); break; } } } if (data.isLogin == 0) { $('#uye-login-msg').html(data.msg); $('form#HizliUyelik input[type=text],input[type=password]').each(function () { if ($(this).val() == '') { $(this).val($(this).attr('defaultValue')); } }); } else if (data.isLogin == 1) { if (button.attr("alt") == "landing") { alert("Tebrikler.. Üyelik kaydınız başarıyla alınmıştır."); } if (data.activation == "true") { $('#activation-msg').html(stripslashes(data.msg)); } else if (data.redirectionUrl != '') location.href = data.redirectionUrl; else location.reload(); } } }); return false; } var saveMaillist; saveMaillist.callBack = undefined; function saveMaillist(btn) { btn = btn.target ? $(btn.target) : (btn != undefined ? $(btn) : $('#ebulten-kaydet')); var ct = btn.parents('div:first'); var ad = ct.find('#ebulten-ad').val() ? ct.find('#ebulten-ad').val() : $('#ebulten-ad').val(); var soyad = ct.find('#ebulten-soyad').val() ? ct.find('#ebulten-soyad').val() : $('#ebulten-soyad').val(); var eposta = ct.find('#ebulten-eposta').val() ? ct.find('#ebulten-eposta').val() : $('#ebulten-eposta').val(); $(".EBulten #ebulten-kaydet img").remove(); $(".EBulten #ebulten-kaydet").append(' '); $.ajax({ type: "POST", url: "ajax.php", data: "m=Member&fn=add2MailList&ad=" + ad + "&soyad=" + soyad + "&eposta=" + eposta, dataType: 'json', success: function (r) { if (typeof saveMaillist.callBack === 'function') { saveMaillist.callBack(eposta, r); } $(".EBulten #ebulten-kaydet img").remove(); var msgText = document.getElementById('ebulten-msg'); var msg = ''; if (typeof r.result === 'number') { switch (r.result.toString()) { case '1' : msg = LANG.get('ad_giriniz'); break; case '2' : msg = LANG.get('eposta_giriniz'); break; case '3' : msg = LANG.get('ad_eposta_giriniz'); break; case '0' : msg = LANG.get('eposta_kontrol_ediniz'); break; case '4' : msg = LANG.get('eposta_kayitli'); break; default : if (ad == 'e-bulten') msg = LANG.get('ebulten_kayit_tesekkur'); } } if (msg == '') { if (ad == 'e-bulten') { alert(r.result, r.btnText); } $('.EBulten').html(r.result); } else if (msgText) { msgText.innerHTML = msg; } else { alert(msg, r.btnText); } } }); return false; } function siteTavsiyeEt(prId) { $.ajax({ type: "POST", url: "ajax.php", data: { "m": "Block", "fn": "siteAdvice", "GonderenAdi": $("#site-tasiye-isim").val(), "GonderenEposta": $("#site-tavsiye-eposta").val(), "AliciAdi": $("#site-alici-adi").val(), "AliciEposta": $("#site-alici-eposta").val(), "Mesaj": $("#site-tavsiye-mesaj").val() }, success: function (r) { var jsonObj = $.parseJSON(r); if (jsonObj.success == 'false') { if (jsonObj.errCode == 1) { popup('UyeGiris'); return false; } alert(jsonObj.msg); } else { alert(jsonObj.msg); } } }); return false; } function kategoriYukle(katId, comboId, ilkSecenek) { if (katId === '') { var List = document.getElementById(comboId); for (var x = List.length; x >= 0; x--) List[x] = null; List[0] = new Option('', ''); return false; } $.getJSON('Json/Kategoriler.php?KatId=' + katId, function (JSON) { var List = document.getElementById(comboId); for (var x = List.length; x >= 0; x--) List[x] = null; var option = new Option('Yükleniyor..!', ''); try { List.add(option, null); } catch (ex) { List.add(option); } $.each(JSON.data, function (i, kategori) { option = new Option(kategori.Ad, kategori.id); try { List.add(option, null); } catch (ex) { List.add(option); } }); if (ilkSecenek != undefined && ilkSecenek != null) { option = new Option(ilkSecenek, ''); List[0] = option; List[0].selected = "1"; } else List[0] = null; } ); } function ilceComboYukle(ilComboId, ilceComboId) { $('#' + ilComboId).change( function () { ilceDoldur(ilceComboId, $(this).val()); if (document.getElementById(ilComboId)[0].value == '') document.getElementById(ilComboId)[0] = null; // get rid of [Seçiniz] for parent combo } ); } function ilDoldur(ilComboId, ulkeKod, ilSec) { ilceDoldur(ilComboId, ulkeKod, ilSec, 'S') } function ilceDoldur(ilceComboId, ilKod, ilceSec, type) { if (type == undefined) type = 'I'; var List = document.getElementById(ilceComboId); if (ilKod == '') { clearListbox(List); return false; } clearListbox(List); add2Listbox(List, '[ Yükleniyor.. ]', ''); $.ajax({ type: 'GET', url: 'ajax.php', async: false, data: { m: 'Member', fn: 'provinceLocationsJson', kod: ilKod, type: type }, success: function (JSON) { var data = $.parseJSON(JSON); for (var i = 0; i < data.length; i++) { if (i === 0) { add2Listbox(List, data[i], ''); } else { add2Listbox(List, data[i], data[i]); } } List[0] = null; if (ilceSec != null) $('#' + ilceComboId).val(ilceSec); } }); } function add2Listbox(List, label, value) { var option = new Option(label, value); try { List.add(option, null); } catch (ex) { List.add(option); } } function clearListbox(List) { for (var x = List.length; x >= 0; x--) List[x] = null; } function getCheckedArray(formId, el) { if (document.forms[formId]) { var chkArr = new Array(); var objCheckBoxes = document.forms[formId].elements[el]; if (objCheckBoxes) { var countCheckBoxes = objCheckBoxes.length; for (var i = 0; i < countCheckBoxes; i++) { if (objCheckBoxes[i].checked) { chkArr.push(objCheckBoxes[i].getAttribute('id')); } } } return chkArr; } return false; } function pop(name, opt) { if (opt == undefined) opt = {}; if (opt.fullscreen) { opt.width = screen.width - 20; opt.height = screen.height - 80; opt.top = 0; opt.left = 0; opt.resizable = 0; opt.scrollbars = 0; } else { if (opt.width == undefined) opt.width = 800; if (opt.height == undefined) opt.height = 600; if (opt.top == undefined) opt.top = (screen.height - opt.height) / 2; if (opt.left == undefined) opt.left = (screen.width - opt.width) / 2; if (opt.scrollbars == undefined) opt.scrollbars = 0; opt.resizable = 1; } if (opt.toolbar == undefined) opt.toolbar = 0; if (opt.toolbar == undefined) opt.menubar = 0; opt.location = 0; opt.status = 0; opt.directories = 0; var params = ''; for (var param in opt) params += param + '=' + opt[param] + ','; params = params.substr(0, params.length - 1); newwindow = window.open('popup.php?P=' + name, name, params); if (window.focus) { newwindow.focus() } return false; } function initPaging(parentId) { var pages = $('#' + parentId + " #pagingMenu li"); var loading = $(" div:#loading"); var content = $('#' + parentId + " div:#content"); var sl = function showLoading() { loading .css({visibility: "visible"}) .css({opacity: "1"}) .css({display: "block"}) ; } var hl = function hideLoading() { loading.fadeTo(1000, 0); } pages.click(function () { sl(); pages.css({'background-color': ''}); $(this).css({'background-color': 'yellow'}); var pageNum = this.id; if (isNaN(pageNum)) pageNum = $(this).attr('rel'); else { var prev = $('#' + parentId + " #pagingMenu li#prev"); var next = $('#' + parentId + " #pagingMenu li#next"); prev.attr('rel', parseInt(pageNum) - 1); next.attr('rel', parseInt(pageNum) + 1); } var targetUrl = "ajax.php?m=Block&fn=pagingData&table=1&page=" + pageNum + "&" + $("#pagingForm").serialize() + " #content"; content.load(targetUrl, hl); }); $('#' + parentId + " #1").css({'background-color': 'yellow'}); var targetUrl = "ajax.php?m=Block&fn=pagingData&table=1&page=1&" + $("#pagingForm").serialize() + " #content"; sl(); content.load(targetUrl, hl); } function log(msg) { if ($.browser.msie) ieLog(msg); else console.log(msg); } function ieLog(msg, empty) { if (!document.getElementById('ie-log')) $(document.body).append('Sepetinize Eklendi'); if (empty) $('#ie-log').html(msg); else $('#ie-log').html(msg + '
' + $('#ie-log').html()); $('#ie-log').css({position: 'fixed', bottom: '0', padding: '3px', background: 'none #3FA', width: '100%', font: '10px sans-serif'}); } function RefreshImage(ImageId, NewImageSrc) { var img = document.getElementById(ImageId); img.src = NewImageSrc + '?' + Math.random(); } function stripslashes(str) { return (str + '').replace(/\\(.?)/g, function (s, n1) { switch (n1) { case '\\': return '\\'; case '0': return '\u0000'; case '': return ''; default: return n1; } }); } function addslashes(str) { return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); } function strpos(haystack, needle, offset) { var i = (haystack + '').indexOf(needle, (offset || 0)); return i === -1 ? false : i; } function isset() { var a = arguments; var l = a.length; var i = 0; if (l == 0) { throw new Error('E'); } while (i != l) { if (typeof (a[i]) == 'undefined' || a[i] === null) { return false } else { i++ } } return true } function round(number, digits) { var multiple = Math.pow(10, digits); var rndedNum = Math.round(number * multiple) / multiple; return rndedNum; } function getQueryVariable(variable) { var query = window.location.search.substring(1).toLowerCase(); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable.toLowerCase()) { return pair[1]; } } } function YeniResimGoster(Nesne) { document.getElementById(Nesne).style.display = 'block'; } function YeniResimGizle(Nesne) { document.getElementById(Nesne).style.display = 'none'; } function BRGoster(Nesne) { document.getElementById(Nesne).style.visibility = 'visible'; } function BRGizle(Nesne) { document.getElementById(Nesne).style.visibility = 'hidden'; } function BlokResim(Nesne) { if (document.getElementsById(Nesne).style.display = 'none') document.getElementsById(Nesne).style.display = 'block'; else document.getElementsById(Nesne).style.display = 'none' } function SetAllCheckBoxes(FormName, FieldName, CheckValue) { if (!document.forms[FormName]) return; var objCheckBoxes = document.forms[FormName].elements[FieldName]; if (!objCheckBoxes) return; var countCheckBoxes = objCheckBoxes.length; if (!countCheckBoxes) objCheckBoxes.checked = CheckValue; else for (var i = 0; i < countCheckBoxes; i++) objCheckBoxes[i].checked = CheckValue; } var sepetCokluUrun = []; function SepetCokluGuncelle(uid, durum, adet) { var UrunId = ''; var Adet = ''; var i; sepetCokluUrun[uid] = durum ? adet : 0; for (i in sepetCokluUrun) { UrunId += i + ','; Adet += sepetCokluUrun[i] + ','; } Adet = Adet.substring(0, Adet.length - 1); UrunId = UrunId.substring(0, UrunId.length - 1); document.getElementById("sepet-coklu-islem").setAttribute("href", "Sepet.php?UrunId=" + UrunId + '&' + 'Adet=' + Adet); } function newsscoller(prev, id) { var current_image = $('#gallery' + id + ' a.selected').length ? $('#gallery' + id + ' a.selected') : $('#gallery' + id + ' a:first'); var current_excerpt = $('#excerpt' + id + ' li.selected').length ? $('#excerpt' + id + ' li.selected') : $('#excerpt' + id + ' li:first'); if (prev) { var next_image = (current_image.prev().length) ? current_image.prev() : $('#gallery' + id + ' a:last'); var next_excerpt = (current_excerpt.prev().length) ? current_excerpt.prev() : $('#excerpt' + id + ' li:last'); } else { var next_image = (current_image.next().length) ? current_image.next() : $('#gallery' + id + ' a:first'); var next_excerpt = (current_excerpt.next().length) ? current_excerpt.next() : $('#excerpt' + id + ' li:first'); } $('#excerpt' + id + ' li, #gallery' + id + ' a').removeClass('selected'); next_image.addClass('selected'); next_excerpt.addClass('selected'); } var popupStatus = 0; function overlay(show) { $("#overlay").css({"opacity": "0.7", "background-color": "#333", "height": document.documentElement.clientWidth}); if (show) $("#overlay").fadeIn("fast"); else $("#overlay").fadeOut("fast"); } function loadPopup(header, content) { if (popupStatus == 0) { overlay(true); if (header != '') { $("#popup-header").html(header); $("#popup-header").show(); } else { $("#popup-header").hide(); } $("#popup-content").html(content); centerPopup(); $("#popupContact").fadeIn("slow"); popupStatus = 1; } } function disablePopup() { if (popupStatus == 1) { overlay(false); $("#popupContact").fadeOut("slow"); popupStatus = 0; } } function centerPopup() { var windowWidth = document.documentElement.clientWidth; var windowHeight = document.documentElement.clientHeight; var popupHeight = $("#popupContact").height(); var popupWidth = $("#popupContact").width(); $("#popupContact").css({ "position": "fixed", "minHeight": "50px", "minWidth": "150px", "top": windowHeight / 2 - popupHeight / 2, "left": windowWidth / 2 - popupWidth / 2 }); } function getVar(v) { var q = window.location.search.substring(1); var vs; if (q == "" && (v == "Kid" || v == "Uid" || v == "MarkaId" || v == "ModelId")) { q = window.location.toString(); vs = q.split("/"); q = vs[vs.length - 1]; vs = q.split(","); var regs = new Array(); regs["Kid"] = /\K\d+$/; regs["Uid"] = /\U\d+$/; regs["MarkaId"] = /\M\d+$/; regs["ModelId"] = /\Y\d+$/; for (var i = 0; i < vs.length; i++) { if (regs[v].test(vs[i])) { return vs[i].substr(1); } } } else { vs = q.split("&"); for (var i = 0; i < vs.length; i++) { var p = vs[i].split("="); if (p[0] == v) { return p[1]; } } } return ''; } function Kucult(id, oran) { setTimeout("document.getElementById('" + id + "').width=document.getElementById('" + id + "').width/" + oran + ";", 1000); } function isset() { var a = arguments; var l = a.length; var i = 0; if (l == 0) { throw new Error('E'); } while (i != l) { if (typeof (a[i]) == 'undefined' || a[i] === null) { return false } else { i++ } } return true } function SelectText(element) { var text = document.getElementById(element); if ($.browser.msie) { var range = document.body.createTextRange(); range.moveToElementText(text); range.select(); } else if ($.browser.mozilla || $.browser.opera) { var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(text); selection.removeAllRanges(); selection.addRange(range); } else if ($.browser.safari) { var selection = window.getSelection(); selection.setBaseAndExtent(text, 0, text, 1); } } function validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } var basNZDl = getHostUrl(); function getHostUrl() { var scripts = document.getElementsByTagName('script'), path, i, scriptSrc, match; for (i = 0, ln = scripts.length; i < ln; i++) { scriptSrc = scripts[i].src; match = scriptSrc.match(/general\.js$/); if (match) { path = scriptSrc.substring(0, scriptSrc.length - 13); break; } } return path; } Number.prototype.formatMoney = function (c, d, t) { var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); }; function GetCount(ddate, iid) { dateNow = new Date(); //grab current date amount = ddate.getTime() - dateNow.getTime(); //calc milliseconds between dates delete dateNow; if (amount < 0) { document.getElementById(iid).innerHTML = " Fırsattan yararlanma süresi dolmuştur.. "; if (document.getElementById('tsoft_counter_label')) document.getElementById('tsoft_counter_label').innerHTML = ""; } else { days = 0; hours = 0; mins = 0; secs = 0; out = ' Bu fırsat için kalan süreniz:'; amount = Math.floor(amount / 1000);//kill the "milliseconds" so just secs days = Math.floor(amount / 86400);//days amount = amount % 86400; hours = intToClockDigit(Math.floor(amount / 3600));//hours amount = amount % 3600; mins = intToClockDigit(Math.floor(amount / 60));//minutes amount = amount % 60; secs = intToClockDigit(Math.floor(amount));//seconds out += '
'; document.getElementById(iid).innerHTML = out; var x = setTimeout(function () { GetCount(ddate, iid) }, 1000); } } function intToClockDigit(val) { return (val.toString().length === 1) ? ('0' + val) : val; } function dtval(d, e) { var pK = e ? e.which : window.event.keyCode; if (pK == 8) { d.value = substr(0, d.value.length - 1); return; } var dt = d.value; var da = dt.split('/'); for (var a = 0; a < da.length; a++) { if (da[a] != +da[a]) da[a] = da[a].substr(0, da[a].length - 1); } if (da[0] > 31) { da[1] = da[0].substr(da[0].length - 1, 1); da[0] = '0' + da[0].substr(0, da[0].length - 1); } if (da[1] > 12) { da[2] = da[1].substr(da[1].length - 1, 1); da[1] = '0' + da[1].substr(0, da[1].length - 1); } if (da[2] > 9999) da[1] = da[2].substr(0, da[2].length - 1); dt = da.join('/'); if (dt.length == 2 || dt.length == 5) dt += '/'; d.value = dt; } function setCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); document.cookie = c_name + "=" + c_value; } function getCookie(c_name) { var i, x, y, ARRcookies = document.cookie.split(";"); for (i = 0; i < ARRcookies.length; i++) { x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); x = x.replace(/^\s+|\s+$/g, ""); if (x == c_name) { return unescape(y); } } } function getRootPath() { var scripts = document.getElementsByTagName("script"); var root, src, idx; for (var i = 0; i < scripts.length; i++) { src = scripts[i].src; idx = src.indexOf('js/general'); if (idx > 0) { root = src.substr(0, idx); break; } } return root; } function empty(mixed_var) { var key; if (mixed_var === "" || mixed_var === 0 || mixed_var === "0" || mixed_var === null || mixed_var === false || typeof mixed_var === 'undefined') { return true; } if (typeof mixed_var == 'object') { for (key in mixed_var) { return false; } return true; } return false; } function urunKarsilastir() { $.fancybox({href: './conn/product/compare/product'}); $.each($('input.karsilastirma:checked'), function () { $(this).attr("checked", false); }); } function karsilastirmaKontrol() { return true; if ($('input.karsilastirma:checked').length > 4) { alert('Karşılaştırmak için en fazla 4 ürün seçebilirsiniz.'); return false; } } function sendCompareProductId(productId) { $.ajax({ type: "POST", url: "./conn/product/compare/addId", data: {productId: productId}, success: function (msg) { } }); } function removeFromCompareList(productId) { sendCompareProductId(productId); } function cLog(str) { if (typeof console === 'undefined' || typeof console.log === 'undefined') return false; console.log(str); } var ProductDynamicLoad = { pageNo: 2, pageNoParam: 'Baslan', basNZDl: '.BASE_URL:last', parentDiv: '.UrunKatalogDivIc', productDiv: '.UrunKatalog', loadMoreButton: '.LoadMoreButton', heightEqualDiv: 'div.YukseklikEsit', loadMoreStatus: true, scrollLoadStatus: true, loadingStatus: false, loadMore: function () { var p = ProductDynamicLoad; if (p.loadMoreStatus === false) { cLog('Daha fazla ürün yok.";'); $(p.loadMoreButton).hide('slow'); return false; } var params = $(p.basNZDl).val().replace(/.*\?/ig, ''); params = params.replace(/^\&/gi, '').replace(/\&$/gi, ''); var requestLink = window.location.pathname.replace(/^\//ig, ''); params = params + '&' + p.pageNoParam + '=' + p.pageNo + '&link=' + requestLink; p.pageNo++; $.ajax({ url: '/Diger/product_dynamic_load.php?' + params, success: function (data) { var dom = $('- ' + days + "
"; out += '- ' + hours + "
"; out += '- ' + mins + "
"; out += '- ' + secs + "
"; out += '').html(data).contents(); var totalProduct = $(dom).find(p.productDiv).length; if (totalProduct === 0) p.loadMoreStatus = false; $(dom).find(p.productDiv).hide().addClass('yuklenenUrunKatalog' + p.pageNo); $(p.parentDiv).append($(dom).find(p.productDiv)); $(p.parentDiv).find('.yuklenenUrunKatalog' + p.pageNo).fadeIn(1000); if (typeof $.fn.yukseklikEsitle === 'function') $(p.heightEqualDiv).yukseklikEsitle(); p.loadingStatus = false; } }); }, check: function () { var p = ProductDynamicLoad; var basNZDl = $(p.basNZDl).val(); if (typeof basNZDl === 'undefined') { cLog('Sayfada BASE_URL bulunamadı. Örnek Kullanım: '); return false; } if ($(p.parentDiv).length < 1) { if (typeof $(p.productDiv).parent().attr('class') === 'undefined') $(p.productDiv).parent().attr('class', 'productDivParent'); p.parentDiv = '.' + $(p.productDiv).parent().attr('class').replace(/^\s*(\w+)\s.*/ig, '$1'); } if ($(p.productDiv).length < 1) { cLog('Parametreler boş bırakılamaz. Örnek Kullanım: '); cLog('ProductDynamicLoad.parentDiv=".UrunKatalogDivIc";'); cLog('ProductDynamicLoad.productDiv=".UrunKatalog";'); cLog('ProductDynamicLoad.run();'); return false; } if (typeof $.fn.yukseklikEsitle !== 'function') cLog('Sayfada /theme/standart/js/jquery.yukseklikEsitle.js bulunamadı.'); if ($(p.heightEqualDiv).length === 0) cLog(p.heightEqualDiv + ' bulunamadı.'); if (typeof p.loadMoreButton === 'undefined') cLog('Sayfada "Daha Fazla Yükle" butonu bulunamadı.'); return true; }, scrollLoad: function () { var p = ProductDynamicLoad; var scrollFunc = function (pageY) { var lastProductTop = $(p.productDiv + ':last').offset().top; var scrollTop = $(document).scrollTop(); var diff = 600 + pageY; if (scrollTop + diff > lastProductTop && p.loadingStatus === false) { p.loadingStatus = true; p.loadMore(); } }; $(window).scroll(function () { scrollFunc(0); }); document.body.addEventListener('touchend', function (e) { scrollFunc(parseInt(e.changedTouches[0].pageY)); }, false); }, scrollHistory : function () { var scroll_len=getCookie("scrollY"); var last_page = getCookie("last_page"); if(scroll_len=="undefined"||scroll_len==undefined){ scroll_len=0; }else { scroll_len=parseInt(scroll_len); if(last_page==window.location.href) { $(window).scroll(0,0); var scrollmin=0; var scrolling = setInterval(function(){ if(window.scrollY<=(scroll_len)-60){ scrollmin += 60; window.scroll(0,scrollmin) ; } else { clearInterval(scrolling); } }, 20); } } }, run: function () { $(window).scroll(function() { setCookie("scrollY",window.scrollY,1); }); $(document).ready(function () { var p = ProductDynamicLoad; if (p.check() === false) return false; if (p.scrollLoadStatus) p.scrollLoad(); $(p.loadMoreButton).click(p.loadMore); }); this.scrollHistory(); } }; function GoRedirectMobile() { $.ajax({ type: "POST", url: "/srv/service/customer/redirect-mobile", data: { }, success: function (data) { location.reload(); } }); } function SendProductNewsForm(productId) { window.open('SendProductNewsForm.aspx?productId=' + productId, '_blank', 'width=500,height=200,left=100,top=100'); } function ShowModalPortalLogs(page) { window.showModalDialog(page, null, "dialogWidth:470px;dialogHeight:280px;edge:raised;resizable:yes;scroll:no;status:no"); } function SendNewsForm(filePath, itemId) { window.open(filePath + itemId, '_blank', 'width=500,height=200,left=100,top=100', 'false'); } function OpenProductDetails(filePath, itemId) { var PrdPopUp = window.open(filePath + itemId, 'PrdPopUp', 'scrollbars=yes,width=700,height=550,left=1,top=1', 'true'); if (PrdPopUp != null) { PrdPopUp.focus(); } } function openInstallments(price, height, width) { var x, y; x = (self.screen.availHeight - height) / 2; y = (self.screen.availWidth - width) / 2; var winAtts = 'width=' + width + ' , height=' + height + ', toolbar=no, scrollbars=yes, directories=no, left=' + y + ',top=' + x + ' '; var chidPopUp = window.open('/Store/ProductInstallments.aspx?price=' + price, 'installments', winAtts); if (chidPopUp != null) { chidPopUp.focus(); } } function OpenSelectionWindow(idname, url, postBack, wName, width, height, hasParam, sbars, status) { var x, y; x = (self.screen.availHeight - height) / 2; y = (self.screen.availWidth - width) / 2; var _strUrl if (hasParam == 1) { url += '&'; } else { url += '?'; } popUpSelectionWindow = window.open(url + 'formname=' + document.forms[0].name + '&id=' + idname + '&postBack=' + postBack, wName, 'width=' + width + ',height=' + height + ',left=' + y + ',top=' + x + ',scrollbars=' + sbars + ',status=' + status); if (popUpSelectionWindow != null) { popUpSelectionWindow.focus(); } } function SetFieldData(formName, id, data, postBack) { window.opener.document.forms[0].elements[id].value = data; ; window.close(); if (postBack) window.opener.__doPostBack(id, ''); } function openChild(_file, wName, width, height, sbar) { var x, y; x = (self.screen.availHeight - height) / 2; y = (self.screen.availWidth - width) / 2; if (sbar == null) { sbar = 0 } winAtts = 'width=' + width + ', height=' + height + ', toolbar=no, scrollbars=' + sbar + ', directories=no, top=' + x + ', left=' + y; var ChidPopUp = window.open(_file, wName, winAtts); if (ChidPopUp != null) { ChidPopUp.focus(); } } function CloseMe() { eval('var theform = document.' + formName + ';'); popUp.close(); } function Print() { window.print(); } function SearchProduct(e, txtsearchid) { if (e == null || e.keyCode == 13) { var bt = document.getElementById(txtsearchid); window.location = "/store/Search.aspx?search=true&srchtxt=" + encodNZDI(bt.value); return false; } } function clickButton(e, buttonid) { var bt = document.getElementById(buttonid); if (typeof bt == 'object') { if (navigator.appName.indexOf("Netscape") > (-1)) { if (e.keyCode == 13) { bt.click(); return false; } } if (navigator.appName.indexOf("Microsoft Internet Explorer") > (-1)) { if (event.keyCode == 13) { bt.click(); return false; } } } } function checkMaxLength(e, el) { switch (e.keyCode) { case 37: // left return true; case 38: // up return true; case 39: // right return true; case 40: // down return true; case 8: // backspace return true; case 46: // delete return true; case 27: // escape el.value = ''; return true; } return (el.value.length < el.getAttribute("txtmaxlength")); } function SetUniqueRadioButton(nameregex, current, hdnElementid, elementValue) { re = new RegExp(nameregex); for(i = 0; i < document.forms[0].elements.length; i++) { elm = document.forms[0].elements[i] if (elm.type == 'radio') { if (re.test(elm.name)) { elm.checked = false; } } } current.checked = true; if(hdnElementid != null && elementValue != null) { var frmElement = document.getElementById(hdnElementid); if(frmElement != null) { frmElement.value = elementValue; } } __doPostBack(hdnElementid,''); } PositionX = 100; PositionY = 100; defaultWidth = 500; defaultHeight = 500; var AutoClose = true; if (parseInt(navigator.appVersion.charAt(0)) >= 4) { var isNN = (navigator.appName == "Netscape") ? 1 : 0; var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0; } var optNN = 'scrollbars=yes,width=' + defaultWidth + ',height=' + defaultHeight + ',left=' + PositionX + ',top=' + PositionY; var optIE = 'scrollbars=yes,width=100,height=100,left=' + PositionX + ',top=' + PositionY; function popImage(imagNZDL, imageTitle) { if (isNN) { imgWin = window.open('about:blank', '', optNN); } if (isIE) { imgWin = window.open('about:blank', '', optIE); } with (imgWin.document) { writeln('Loading... '); writeln(''); writeln('var isNN,isIE;'); writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){'); writeln('isNN=(navigator.appName=="Netscape")?1:0;'); writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}'); writeln('function reSizeToImage(){'); writeln('if (isIE){'); writeln('window.resizeTo(100,100);'); writeln('width=(document.images[0].width)+25;'); writeln('height=(document.images[0].height)+90;'); writeln('window.resizeTo(width,height);}'); writeln('if (isNN){'); writeln('window.innerWidth=document.images["George"].width;'); writeln('window.innerHeight=document.images["George"].height;}}'); writeln('function doTitle(){document.title="' + imageTitle + '";}'); writeln(' '); if (!AutoClose) writeln('') else writeln(''); writeln(' '); close(); } } (function($) { // Compliant with jquery.noConflict() $.fn.jCarouselLite = function(o) { o = $.extend({ btnPrev: null, btnNext: null, btnGo: null, mouseWheel: true, auto: 3000, speed: 500, easing: null, vertical: false, circular: true, visible: 4, start: 0, scroll: 1, beforeStart: null, afterEnd: null }, o || {}); return this.each(function() { // Returns the element collection. Chainable. var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; if(o.circular) { ul.prepend(tLi.slice(tl-v-1+1).clone()) .append(tLi.slice(0,v).clone()); o.start += v; } var li = $("li", ul), itemLength = li.size(), curr = o.start; div.css("visibility", "visible"); li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) var divSize = liSize * v; // size of entire div(total length for just the visible items) li.css({width: li.width(), height: li.height()}); ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images if(o.btnPrev) $(o.btnPrev).click(function() { return go(curr-o.scroll); }); if(o.btnNext) $(o.btnNext).click(function() { return go(curr+o.scroll); }); if(o.btnGo) $.each(o.btnGo, function(i, val) { $(val).click(function() { return go(o.circular ? o.visible+i : i); }); }); if(o.mouseWheel && div.mousewheel) div.mousewheel(function(e, d) { return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); }); if(o.auto) setInterval(function() { go(curr+o.scroll); }, o.auto+o.speed); function vis() { return li.slice(curr).slice(0,v); }; function go(to) { if(!running) { if(o.beforeStart) o.beforeStart.call(this, vis()); if(o.circular) { // If circular we are in first or last, then goto the other end if(to<=o.start-v-1) { // If first, then goto last ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; } else if(to>=itemLength-v+1) { // If last, then goto first ul.css(animCss, -( (v) * liSize ) + "px" ); curr = to==itemLength-v+1 ? v+1 : v+o.scroll; } else curr = to; } else { // If non-circular and to points to first or last, we just return. if(to<0 || to>itemLength-v) return; else curr = to; } // If neither overrides it, the curr will still be "to" and we can proceed. running = true; ul.animate( animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, function() { if(o.afterEnd) o.afterEnd.call(this, vis()); running = false; } ); if(!o.circular) { $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); $( (curr-o.scroll<0 && o.btnPrev) || (curr+o.scroll > itemLength-v && o.btnNext) || [] ).addClass("disabled"); } } return false; }; }); }; function css(el, prop) { return parseInt($.css(el[0], prop)) || 0; }; function width(el) { if(typeof el[0]==='undefined'){ console.log('jcarousel.js offsetWidth is undefined'); return 100; } return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); }; function height(el) { return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); }; })(jQuery);