// JavaScript Document // var ev = e || window.event; var ev={ _items: new Array(), AddListener: function (el, sType, fn, scope) { if (el==window) { rFunc=this.DomEvent; } else { rFunc=this.elEvent; } var o=this.GetEvent(el, sType); // If this event has not registered yet, Register it. if (!o) { if (window.addEventListener) { el.addEventListener(sType, rFunc, false); } else if (window.attachEvent) { el.attachEvent("on" + sType, rFunc); } } // This event has registed before, Check the callback function. else { if ((o.fn==fn) && (o.scope==scope)) return; } // Add this event to waiting list. this._items.push({'el': el, 'type': sType, 'fn': fn, 'scope': scope}); }, RemoveListener: function(el, sType, fn) { var i=0; for (var x=0; this._items.length; x++) { o=this._items[x]; if ((o.el==el) && (o.type==sType)) { i++; if (o.fn==fn) { var n=x; } } } this._items.splice(n, 1); if (i<=1) { if (window.removeEventListener) { el.removeEventListener(sType, fn, (capture)); } else if (window.detachEvent) { el.detachEvent("on" + sType, fn); } } }, event: {}, GetEvent: function (el, sType) { var o=null; for (var x=0; x 1 ) return false; else return ( emailFilter.test(fieldValue) && !doesEmailHaveInvalidChar(fieldValue) ) ? true : false; } function doesEmailHaveInvalidChar(fieldValue) { var illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\] ]/; return ( illegalChars.test(fieldValue) ) ? true : false; } function checkMailId(mailids) { if (isBlank(mailids) || !isEmailValid(mailids) ) { return false; } return true; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i '; html+=' '; html+='Browse '; html+='Clear '; div.innerHTML=html; } } function LoadDefault(obj) { var Default=MyCMS.STFOLDER+'/getthumb.php?file=0.jpg';// if (obj.src.indexOf(Default)!=-1) return; obj.src=Default; } function ClearPicture(id) { LoadDefault($(id+'_img')); $(id+"_url").value=""; } function ColorizeTable_Init() { if (!document.getElementsByClassName) return; var instances=document.getElementsByClassName("colorize"); for (var x=0; x0) && (repeat>1) && ((y-header)%repeat==0) && (y-header>0)) { instance.rows[0].parentNode.insertBefore(instance.rows[0].cloneNode(-1), instance.rows[y]); continue; } Element.extend(instance.rows[y]); while (true) { v=instance.rows[y].className.match('colorize-row[0-9]+'); if (!v) break; instance.rows[y].removeClassName(v[0]); } instance.rows[y].addClassName("colorize-row"+(m%alternate)); m++; } } radio_value=function (form, name, value) { var f=document.forms[form]; if (!f) return; var r=f[name]; if (!r) return; if (r.length) { for (var x=0; x0) p+="width="+(w+32)+","; if (h>0) p+="height="+(h+32)+","; window.open(src,'w1',p+'status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes'); return false; } _FullPath=function () { var m=new Array(), v=0; if (arguments[0].substr(0, 1)=="/") m[v++]=""; for (var x=0; x < arguments.length; x++) { a=arguments[x]; if (a=="") continue; if (a.substr(a.length-1, 1)=="/") a=a.substr(0, a.length-1); if (a=="") continue; if (a.substr(0, 1)=="/") a=a.substr(1); if (a=="") continue; m[v++]=a; } return m.join('/'); } function ConfirmDelete(obj) { if (!confirm('You are about to delete item, Are you sure?')) return false; if (obj.href.indexOf("?")==-1) obj.href+="?"; obj.href+='&confirm=1&redirect='+ encodeURIComponent( location.href); } function ConfirmDelete2(message, obj) { if (!confirm(message)) return false; if (obj.href.indexOf("?")==-1) obj.href+="?"; obj.href+='&confirm=1'; } function SwapImage(o, img) { o.old=img; o.onmouseover=function () { img=this.src; this.src=this.old; this.old=img; } o.onmouseout=function () { img=this.src; this.src=this.old; this.old=img; } } function isFunction(f) { if (!f) return false; if (typeof f=='function') { return f; } else if (typeof f == 'string' && eval('typeof ' + f)=='function') { return eval(f); } return false; } function selectvalue(id, value) { cmb=$(id); for (i=0; i < cmb.options.length; i++) { if (cmb.options[i].value==value) { cmb.options[i].selected=true; break; } } } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } function openWindow(obj, w, h, center) { nm=""; if (obj.innerText) { nm= obj.innerText; } else if (obj.textContent) { nm=obj.textContent; } if (center) { wleft = (screen.width - w) / 2; wtop = (screen.height - h) / 2; } else { wleft=0; wtop =0; } v=window.open(obj.href, 'w1', 'left=' + wleft + ', top=' + wtop + ',width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no'); if (v) { //v.resizeTo(w, h); // Just in case left and top are ignored //v.moveTo(wleft, wtop); v.focus(); return false; } else { return true; } } /** * jQuery (PNG Fix) v1.2 * Microsoft Internet Explorer 24bit PNG Fix * * The MIT License * * Copyright (c) 2007 Paul Campbell (pauljamescampbell.co.uk) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @param Object * @return Array */ (function($) { $.fn.pngfix = function(options) { // Review the Microsoft IE developer library for AlphaImageLoader reference // http://msdn2.microsoft.com/en-us/library/ms532969(VS.85).aspx // ECMA scope fix var elements = this; var settings = $.extend({ imageFixSrc: false, sizingMethod: false }, options); if(!$.browser.msie || ($.browser.msie && $.browser.version >= 7)) { return(elements); } function setFilter(el, path, mode) { var fs = el.attr("filters"); var alpha = "DXImageTransform.Microsoft.AlphaImageLoader"; if (fs[alpha]) { fs[alpha].enabled = true; fs[alpha].src = path; fs[alpha].sizingMethod = mode; } else { el.css("filter", 'progid:' + alpha + '(enabled="true", sizingMethod="' + mode + '", src="' + path + '")'); } } function setDOMElementWidth(el) { if(el.css("width") == "auto" & el.css("height") == "auto") { el.css("width", el.attr("offsetWidth") + "px"); } } return( elements.each(function() { // Scope var el = $(this); if(el.attr("tagName").toUpperCase() == "IMG" && (/\.png/i).test(el.attr("src"))) { if(!settings.imageFixSrc) { // Wrap the in a then apply style/filters, // removing the tag from the final render el.wrap(""); var par = el.parent(); par.css({ height: el.height(), width: el.width(), display: "inline-block" }); setFilter(par, el.attr("src"), "scale"); el.remove(); } else if((/\.gif/i).test(settings.imageFixSrc)) { // Replace the current image with a transparent GIF // and apply the filter to the background of the // tag (not the preferred route) setDOMElementWidth(el); setFilter(el, el.attr("src"), "image"); el.attr("src", settings.imageFixSrc); } } else { var bg = new String(el.css("backgroundImage")); var matches = bg.match(/^url\("(.*)"\)$/); if(matches && matches.length) { // Elements with a PNG as a backgroundImage have the // filter applied with a sizing method relevant to the // background repeat type setDOMElementWidth(el); el.css("backgroundImage", "none"); // Restrict scaling methods to valid MSDN defintions (or one custom) var sc = "crop"; if(settings.sizingMethod) { sc = settings.sizingMethod; } setFilter(el, matches[1], sc); // Fix IE peek-a-boo bug for internal links // within that DOM element el.find("a").each(function() { $(this).css("position", "relative"); }); } } }) ); } })(jQuery)