//When document loads, apply the prepareImageSwap function to various images with our desired settings function setImageSwaps() { prepareImageSwap(document.body); //Note that once an image is processed, it won't be processed again, so you should set more specific images first, e.g. document.body, as it is the grand container, has to be processed last. } function prepareImageSwap(elem,mouseOver,mouseOutRestore,mouseDown,mouseUpRestore,mouseOut,mouseUp) { //Do not delete these comments. //Non-Obtrusive Image Swap Script V1.1 by Hesido.com //Attribution required on all accounts if (typeof(elem) == 'string') elem = document.getElementById(elem); if (elem == null) return; var regg = /(.*)(_nm\.)([^\.]{3,4})$/ var prel = new Array(), img, imgList, imgsrc, mtchd; imgList = elem.getElementsByTagName('img'); for (var i=0; img = imgList[i]; i++) { if (!img.rolloverSet && img.src.match(regg)) { mtchd = img.src.match(regg); img.hoverSRC = mtchd[1]+'_on.'+ mtchd[3]; img.outSRC = img.src; if (typeof(mouseOver) != 'undefined') { img.hoverSRC = (mouseOver) ? mtchd[1]+'_on.'+ mtchd[3] : false; img.outSRC = (mouseOut) ? mtchd[1]+'_ou.'+ mtchd[3] : (mouseOver && mouseOutRestore) ? img.src : false; img.mdownSRC = (mouseDown) ? mtchd[1]+'_md.' + mtchd[3] : false; img.mupSRC = (mouseUp) ? mtchd[1]+'_mu.' + mtchd[3] : (mouseOver && mouseDown && mouseUpRestore) ? img.hoverSRC : (mouseDown && mouseUpRestore) ? img.src : false; } if (img.hoverSRC) {preLoadImg(img.hoverSRC); img.onmouseover = imgHoverSwap;} if (img.outSRC) {preLoadImg(img.outSRC); img.onmouseout = imgOutSwap;} if (img.mdownSRC) {preLoadImg(img.mdownSRC); img.onmousedown = imgMouseDownSwap;} if (img.mupSRC) {preLoadImg(img.mupSRC); img.onmouseup = imgMouseUpSwap;} img.rolloverSet = true; } } function preLoadImg(imgSrc) { prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc; } } function imgHoverSwap() {this.src = this.hoverSRC;} function imgOutSwap() {this.src = this.outSRC;} function imgMouseDownSwap() {this.src = this.mdownSRC;} function imgMouseUpSwap() {this.src = this.mupSRC;} function resize_iframe(id, txtid) { if(document.getElementById(id).height<500) document.getElementById(id).height=500; else document.getElementById(id).height=0; if(document.getElementById(txtid).innerHTML= '(click to see)') document.getElementById(txtid).innerHTML= '(click to hide)'; else document.getElementById(txtid).innerHTML= '(click to see)'; } function popup(url, w, h, scroll) { detailWindow=window.open(url,'detailWin','width=' + w + ',height=' + h + 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1'); detailWindow.focus(); } function confirmSubmit() { var agree=confirm("Are you sure you want to delete this?"); if (agree) { //alert('true'); return true; } else { //alert('f'); return false; } } function confirmDels() { var agree=confirm("Are you sure you want to delete all the above checked comments?"); if (agree) { //alert('true'); return true; } else { //alert('f'); return false; } } function confirmApprove() { var agree=confirm("Are you sure you want to approve this?"); if (agree) { return true; } else return false; } function ajaxthis(url, postdata, changearray) { //get with ajax the info for that sec var xmlHttpReq = false; var self = this; // Mozilla/Safari if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq.open('POST', url, true); self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { var myArray = self.xmlHttpReq.responseText.split('``'); for (var j=0; jReply loading...'; var myAjax = ajaxthis('getreply2.php', pars, [placetoadd]); } function ajaxflag(id, placetoadd, verifycookie) { // Prepare query string and send AJAX request var pars = 'id=' + id + '&testuid=' + verifycookie + '&ajax=y'; // Update user interface document.getElementById(placetoadd).innerHTML = 'Reply loading...'; var myAjax = ajaxthis('flag.php', pars, [placetoadd]); } function ajaxnoreply(placetorem) { // Update user interface document.getElementById(placetorem).innerHTML = ''; } // Twisty.js // // Copyright (c) 2007 Red Hat, Inc. // // 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. // // Provide a nice interface for creating disclosure triangles in a web page // To use: // // put onload="initTwisty();" in your tag. // // You should have this in your style sheet: // // .twisty:hover { // background-color: #f0f0f0; // border: 1px solid #e0e0e0; // margin-left: -1px; // } // // .twisty { // cursor: hand; // cursor: pointer; // } // // When you have a section you wish to expose/hide, put: // //
Some Label //
//
Some content
//
//
function hideTwisty (id) { var el = getElemById (id); var twisty; if (el) { setStyle (el, {display: 'none'}); } for (var i = 0; i < el.parentNode.childNodes.length; i++) { if (el.parentNode.childNodes[i].nodeName == 'A') { var t = el.parentNode.childNodes[i]; for (var j = 0; j < t.childNodes.length; j++) { if (t.childNodes[j].className == 'twisty') twisty = t.childNodes[j]; } } } if (typeof twisty != "undefined") twisty.setAttribute('src', 'twisty-hidden.gif'); } function toggleTwisty (id) { var el = getElemById (id); var twisty; for (var i = 0; i < el.parentNode.childNodes.length; i++) { if (el.parentNode.childNodes[i].nodeName == 'A') { var t = el.parentNode.childNodes[i]; for (var j = 0; j < t.childNodes.length; j++) { if (t.childNodes[j].className == 'twisty') twisty = t.childNodes[j]; } } } twisties = getElementsByClassName (document, "img", "twisty"); for (var i = 0; i < twisties.length; i++) { if (twisties[i].src.indexOf('twisty-do-down.gif') != -1) { twisties[i].setAttribute ('src', 'twisty-down.gif'); } else if (twisties[i].src.indexOf('twisty-do-hidden.gif') != -1) { twisties[i].setAttribute ('src', 'twisty-hidden.gif'); } } if (el.style.display == "none") { if (typeof twisty != "undefined") twisty.setAttribute('src', 'twisty-do-down.gif'); if (typeof Effect != "undefined") { Effect.toggle(id, "Slide", {duration:.4}); } else { setStyle(el, {display: 'block'}); } } else { if (typeof twisty != "undefined") twisty.setAttribute('src', 'twisty-do-hidden.gif'); if (typeof Effect != "undefined") { Effect.toggle(id, "Slide", {duration:.4}); } else { setStyle(el, {display: 'none'}); } } } function getElementsByClassName(oElm, strTagName, strClassName){ var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); var oElement; for(var i=0; i"; } } var field = fieldname.replace("[]", ''); document.getElementById(field).innerHTML=selected; } function newtallyemail() { var linklist = document.getElementById('tallyemails'); //var newlink = document.createElement("
add another email
"); var newlink = document.createElement("div"); newlink.className ="emailtally"; newlink.innerHTML = "email: "; linklist.appendChild(newlink); } function seturl(id) { var tit=document.getElementById(id).value; if(document.getElementById('url').value=='') document.getElementById('url').value=friendlyURL(tit); } function friendlyURL (clearString) { var output = ''; var x = 0; clearString = clearString.toString(); var regex = /(^[a-zA-Z0-9_.]*)/; while (x < clearString.length) { var match = regex.exec(clearString.substr(x)); if (match != null && match.length > 1 && match[1] != '') { output += match[1]; x += match[1].length; } else { if (clearString[x] == ' ') output += '-'; else { var charCode = clearString.charCodeAt(x); var hexVal = charCode.toString(16); //output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase(); output += ''; } x++; } } return output; } function edit_permalink() { urldata = document.getElementById('url-name-full').innerHTML; document.getElementById('url-name-full').innerHTML=''; document.getElementById('save_perma').style.display="inline"; document.getElementById('edit-slug-buttons').style.display="none"; } function cancel_permalink(orig) { document.getElementById('url-name-full').innerHTML=orig; document.getElementById('save_perma').style.display="none"; document.getElementById('edit-slug-buttons').style.display="inline"; } function save_permalink() { urldata = document.getElementById('url').value; document.getElementById('url-name-full').innerHTML=urldata; document.getElementById('save_perma').style.display="none"; document.getElementById('edit-slug-buttons').style.display="inline"; } var timeout = 500; var closetimer = 0; var ddmenuitem = ''; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) document.getElementById(ddmenuitem).style.visibility = 'hidden'; // get new layer and show it if(document.getElementById(id)) { ddmenuitem = id; document.getElementById(ddmenuitem).style.visibility = 'visible'; } } // close showed layer function mclose() { if(ddmenuitem) document.getElementById(ddmenuitem).style.visibility = 'hidden'; //alert(document.getElementById(ddmenuitem).style.visibility); } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onclick = mclose; /** * -------------------------------------------------------------------- * jQuery-Plugin "pngFix" * Version: 1.2, 09.03.2009 * by Andreas Eberhard, andreas.eberhard@gmail.com * http://jquery.andreaseberhard.de/ * * Copyright (c) 2007 Andreas Eberhard * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) * * Changelog: * 09.03.2009 Version 1.2 * - Update for jQuery 1.3.x, removed @ from selectors * 11.09.2007 Version 1.1 * - removed noConflict * - added png-support for input type=image * - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com * 31.05.2007 initial Version 1.0 * -------------------------------------------------------------------- * @example $(function(){$(document).pngFix();}); * @desc Fixes all PNG's in the document on document.ready * * jQuery(function(){jQuery(document).pngFix();}); * @desc Fixes all PNG's in the document on document.ready when using noConflict * * @example $(function(){$('div.examples').pngFix();}); * @desc Fixes all PNG's within div with class examples * * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );}); * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png * -------------------------------------------------------------------- */ (function($) { jQuery.fn.pngFix = function(settings) { // Settings settings = jQuery.extend({ blankgif: 'blank.gif' }, settings); var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1); var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1); if (jQuery.browser.msie && (ie55 || ie6)) { //fix images with png-source jQuery(this).find("img[src$=.png]").each(function() { jQuery(this).attr('width',jQuery(this).width()); jQuery(this).attr('height',jQuery(this).height()); var prevStyle = ''; var strNewHTML = ''; var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : ''; var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : ''; var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : ''; var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : ''; var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : ''; var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : ''; if (this.style.border) { prevStyle += 'border:'+this.style.border+';'; this.style.border = ''; } if (this.style.padding) { prevStyle += 'padding:'+this.style.padding+';'; this.style.padding = ''; } if (this.style.margin) { prevStyle += 'margin:'+this.style.margin+';'; this.style.margin = ''; } var imgStyle = (this.style.cssText); strNewHTML += ''; if (prevStyle != ''){ strNewHTML = '' + strNewHTML + ''; } jQuery(this).hide(); jQuery(this).after(strNewHTML); }); // fix css background pngs jQuery(this).find("*").each(function(){ var bgIMG = jQuery(this).css('background-image'); if(bgIMG.indexOf(".png")!=-1){ var iebg = bgIMG.split('url("')[1].split('")')[0]; jQuery(this).css('background-image', 'none'); jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')"; } }); //fix input with png-source jQuery(this).find("input[src$=.png]").each(function() { var bgIMG = jQuery(this).attr('src'); jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');'; jQuery(this).attr('src', settings.blankgif) }); } return jQuery; }; })(jQuery);