function ajax(request, target) { var xmlhttp=false; //Clear our fetching variable try { xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object } catch (e) { try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest } xmlhttp.open('GET', request, true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { //Check if it is ready to recieve data var content = xmlhttp.responseText; //Load content to js variable if( content ) { document.getElementById(target).innerHTML = content; } } } xmlhttp.send(null) //Nullify the XMLHttpRequest return; } function show(id) { var string = document.getElementById(id).style.display; if(string == 'none') { document.getElementById(id).style.display = 'inline'; } else { document.getElementById(id).style.display = 'none'; } } /* //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } setTimeout("document.getElementById('urldiv').style.display='none'", millisec); clearTimeout(); } function menuHoverIn() { opacity(); } function menuHoverOut() { } */ /* FOTOSANIM.JS */ var fadeimages=new Array() //SET IMAGE PATHS. Extend or contract array as needed fadeimages[0]=["./_gi/fotosAnim/banner1.jpg", "", ""] //plain image syntax fadeimages[1]=["./_gi/fotosAnim/banner2.jpg", "", ""] //image with link syntax fadeimages[2]=["./_gi/fotosAnim/banner3.jpg", "", ""] //image with link and target syntax fadeimages[3]=["./_gi/fotosAnim/banner4.jpg", "", ""] fadeimages[4]=["./_gi/fotosAnim/banner5.jpg", "", ""] fadeimages[5]=["./_gi/fotosAnim/banner6.jpg", "", ""] fadeimages[6]=["./_gi/fotosAnim/banner7.jpg", "", ""] var fadebgcolor="white" ////NO need to edit beyond here///////////// var fadearray=new Array() //array to cache fadeshow instances var fadeclear=new Array() //array to cache corresponding clearinterval pointers var dom=(document.getElementById) //modern dom browsers var iebrowser=document.all function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){ this.pausecheck=pause this.mouseovercheck=0 this.delay=delay this.degree=10 //initial opacity degree (10%) this.curimageindex=0 this.nextimageindex=1 fadearray[fadearray.length]=this this.slideshowid=fadearray.length-1 this.canvasbase="canvas"+this.slideshowid this.curcanvas=this.canvasbase+"_0" if (typeof displayorder!="undefined") theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :) this.theimages=theimages this.imageborder=parseInt(borderwidth) this.postimages=new Array() //preload images for (p=0;p
') else document.write('
') if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox this.startit() else{ this.curimageindex++ setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay) } } function fadepic(obj){ if (obj.degree<100){ obj.degree+=10 if (obj.tempobj.filters&&obj.tempobj.filters[0]){ if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+ obj.tempobj.filters[0].opacity=obj.degree else //else if IE5.5- obj.tempobj.style.filter="alpha(opacity="+obj.degree+")" } else if (obj.tempobj.style.MozOpacity) obj.tempobj.style.MozOpacity=obj.degree/101 else if (obj.tempobj.style.KhtmlOpacity) obj.tempobj.style.KhtmlOpacity=obj.degree/100 else if (obj.tempobj.style.opacity&&!obj.tempobj.filters) obj.tempobj.style.opacity=obj.degree/101 } else{ clearInterval(fadeclear[obj.slideshowid]) obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1" obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas) obj.populateslide(obj.tempobj, obj.nextimageindex) obj.nextimageindex=(obj.nextimageindex' slideHTML+='' if (this.theimages[picindex][1]!="") //if associated link exists for image slideHTML+='' picobj.innerHTML=slideHTML } fadeshow.prototype.rotateimage=function(){ if (this.pausecheck==1) //if pause onMouseover enabled, cache object var cacheobj=this if (this.mouseovercheck==1) setTimeout(function(){cacheobj.rotateimage()}, 100) else if (iebrowser&&dom||dom){ this.resetit() var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) crossobj.style.zIndex++ fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50) this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0" } else{ var ns4imgobj=document.images['defaultslide'+this.slideshowid] ns4imgobj.src=this.postimages[this.curimageindex].src } this.curimageindex=(this.curimageindex m2.index) return 1; else { // if index is the same, sort by length if (m1.length < m2.length) return -1; else if (m1.length > m2.length) return 1; } return 0; } // gets a list of all matches for a given regular expression SyntaxHighlighter.prototype.GetMatches = function(regex, css, code) { var index = 0; var match = null; while ((match = regex.exec(code)) != null) { this.matches[this.matches.length] = new SyntaxHighlighter.Match(match[0], match.index, css); } } // checks if one match is inside any other match SyntaxHighlighter.prototype.IsInside = function(match) { if (match == null || match.length == 0) return; for (var i = 0; i < this.matches.length; i++) { var c = this.matches[i]; if (c == null) continue; if ((match.index > c.index) && (match.index <= c.index + c.length)) return true; } return false; } SyntaxHighlighter.prototype.ProcessRegexList = function(code) { for (var i = 0; i < this.regexList.length; i++) this.GetMatches(this.regexList[i].regex, this.regexList[i].css, code); } // get the text inside an element SyntaxHighlighter.prototype.GetInnerText = function(element) { // for browsers that support it, this is faster if (element.innerText) { return element.innerText; } // otherwise do it the hard way var innerText = ""; for (var i = 0; i < element.childNodes.length; i++) { if (element.childNodes[i].nodeType == 3) { innerText += element.childNodes[i].nodeValue; } else { innerText + this.GetInnerText(element.childNodes[i]); } } return innerText; } SyntaxHighlighter.prototype.Highlight = function(element) { // get the code to highlight var code = this.GetInnerText(element); element.originalText = code; // make platform linebreaks consistent code = code.replace(/\r\n/g, "\n").replace(/\r/g, "\n"); // trim empty lines at start and end code = code.replace(/^\s*\n/g, "").replace(/\n\s*$/g, ""); // remove content from the element while (element.childNodes.length > 0) { element.removeChild(element.childNodes[0]); } this.matches = new Array(); this.ProcessRegexList(code); if (this.matches.length == 0) { this.AddText(element, code); return; } var result = ""; // sort the matches this.matches = this.matches.sort(SyntaxHighlighter.SortCallback); // The following loop checks to see if any of the matches are inside // of other matches. This process would get rid of highligting strings // inside comments, keywords inside strings and so on. for (var i = 0; i < this.matches.length; i++) { if (this.IsInside(this.matches[i])) { this.matches[i] = null; } } // Finally, go through the final list of matches and pull the all // together adding everything in between that isn't a match. var pos = 0; var span; for (var i = 0; i < this.matches.length; i++) { var match = this.matches[i]; if (match == null || match.length == 0) continue; // add the text between the end of the last match and the start of this one this.AddText(element, code.substring(pos, match.index)); //element.appendChild(document.createTextNode(code.substring(pos, match.index))); // add the match itself, highlighted this.AddText(element, match.value, match.css); pos = match.index + match.length; } this.AddText(element, code.substring(pos)) } SyntaxHighlighter.prototype.AddText = function(element, text, css) { var el; if (css) { el = document.createElement("SPAN"); el.className = css; element.appendChild(el); element = el; } var lines = text.split("\n"); for (var i = 0; i < lines.length; i++) { element.appendChild(document.createTextNode(lines[i])); if (i < lines.length - 1) { if (lines[i] == "") { element.appendChild(document.createTextNode(" ")); } element.appendChild(document.createElement("BR")); } } } SyntaxHighlighter.prototype.GetKeywords = function(str) { return '\\b' + str.replace(/ /g, '\\b|\\b') + '\\b'; } // highlights all elements with a highlight attribute SyntaxHighlighter.HighlightAll = function() { var elementsList = document.getElementsByTagName("PRE"); var elements = []; for (var i=0; i 0) { var sub = element.childNodes[0]; sub.parentNode.removeChild(sub); container.appendChild(sub); } element.appendChild(listing); element.appendChild(container); element = container; } if (SyntaxHighlighter.Brushes[language] == null) continue; var highlighter = new SyntaxHighlighter.Brushes[language](); highlighter.Highlight(element); element.className = element.className + " " + language; } } } SyntaxHighlighter.CodeListingToggle = function() { if (this.codeElement.style.display == 'none') { this.codeElement.style.display = ''; this.innerHTML = 'close'; } else { this.codeElement.style.display = 'none'; this.innerHTML = 'open'; } return false; } SyntaxHighlighter.Brushes.javascript = function() { var keywords = 'abstract boolean break byte case catch char class const continue debugger ' + 'default delete do double else enum export extends false final finally float ' + 'for function goto if implements import in instanceof int interface long native ' + 'new null package private protected public return short static super switch ' + 'synchronized this throw throws transient true try typeof var void volatile while with'; this.regexList = [ { regex: new RegExp('//.*$', 'gm'), css: 'comment' }, // one line comments { regex: new RegExp('/\\*[\\s\\S]*?\\*/', 'g'), css: 'comment' }, // multiline comments { regex: new RegExp('"(?:[^"\n]|[\"])*?"', 'g'), css: 'string' }, // double quoted strings { regex: new RegExp("'(?:[^'\n]|[\'])*?'", 'g'), css: 'string' }, // single quoted strings { regex: new RegExp('^\\s*#.*', 'gm'), css: 'preprocessor' }, // preprocessor tags like #region and #endregion { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keywords ]; } SyntaxHighlighter.Brushes.javascript.prototype = new SyntaxHighlighter(); SyntaxHighlighter.Brushes.java = SyntaxHighlighter.Brushes.javascript; SyntaxHighlighter.Brushes.xml = function() {} SyntaxHighlighter.Brushes.xml.prototype = new SyntaxHighlighter(); SyntaxHighlighter.Brushes.xml.Aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml']; SyntaxHighlighter.Brushes.xml.prototype.ProcessRegexList = function() { function push(array, value) { array[array.length] = value; } /* If only there was a way to get index of a group within a match, the whole XML could be matched with the expression looking something like that: () | () | (<)*(\w+)*\s*(\w+)\s*=\s*(".*?"|'.*?'|\w+)(/*>)* | () */ var index = 0; var match = null; var regex = null; // Match CDATA in the following format // <\!\[[\w\s]*?\[(.|\s)*?\]\]> this.GetMatches(new RegExp('<\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\]>', 'gm'), 'cdata'); // Match comments // this.GetMatches(new RegExp('', 'gm'), 'comments'); // Match attributes and their values // (\w+)\s*=\s*(".*?"|\'.*?\'|\w+)* regex = new RegExp('([\\w-\.]+)\\s*=\\s*(".*?"|\'.*?\'|\\w+)*', 'gm'); while ((match = regex.exec(this.code)) != null) { push(this.matches, new SyntaxHighlighter.Match(match[1], match.index, 'attribute')); // if xml is invalid and attribute has no property value, ignore it if (match[2] != undefined) { push(this.matches, new SyntaxHighlighter.Match(match[2], match.index + match[0].indexOf(match[2]), 'attribute-value')); } } // Match opening and closing tag brackets // this.GetMatches(new RegExp('', 'gm'), 'tag'); // Match tag names // = Math.abs(this.state - this.target)) { this.state = this.target; } else { this.state += movement; } try { this.propagate(); } finally { this.options.onStep.call(this); if (this.target == this.state) { window.clearInterval(this.intervalId); this.intervalId = null; this.options.onComplete.call(this); } } }, // shortcuts play: function() {this.seekFromTo(0, 1)}, reverse: function() {this.seekFromTo(1, 0)}, // return a string describing this Animator, for debugging inspect: function() { var str = "# 20) return; } }, getStyle: function(state) { state = this.from + ((this.to - this.from) * state); if (this.property == 'filter') return "alpha(opacity=" + Math.round(state*100) + ")"; if (this.property == 'opacity') return state; return Math.round(state) + this.units; }, inspect: function() { return "\t" + this.property + "(" + this.from + this.units + " to " + this.to + this.units + ")\n"; } } // animates a colour based style property between two hex values function ColorStyleSubject(els, property, from, to) { this.els = Animator.makeArray(els); this.property = Animator.camelize(property); this.to = this.expandColor(to); this.from = this.expandColor(from); this.origFrom = from; this.origTo = to; } ColorStyleSubject.prototype = { // parse "#FFFF00" to [256, 256, 0] expandColor: function(color) { var hexColor, red, green, blue; hexColor = ColorStyleSubject.parseColor(color); if (hexColor) { red = parseInt(hexColor.slice(1, 3), 16); green = parseInt(hexColor.slice(3, 5), 16); blue = parseInt(hexColor.slice(5, 7), 16); return [red,green,blue] } if (window.DEBUG) { alert("Invalid colour: '" + color + "'"); } }, getValueForState: function(color, state) { return Math.round(this.from[color] + ((this.to[color] - this.from[color]) * state)); }, setState: function(state) { var color = '#' + ColorStyleSubject.toColorPart(this.getValueForState(0, state)) + ColorStyleSubject.toColorPart(this.getValueForState(1, state)) + ColorStyleSubject.toColorPart(this.getValueForState(2, state)); for (var i=0; i 255) number = 255; var digits = number.toString(16); if (number < 16) return '0' + digits; return digits; } ColorStyleSubject.parseColor.rgbRe = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i; ColorStyleSubject.parseColor.hexRe = /^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; // Animates discrete styles, i.e. ones that do not scale but have discrete values // that can't be interpolated function DiscreteStyleSubject(els, property, from, to, threshold) { this.els = Animator.makeArray(els); this.property = Animator.camelize(property); this.from = from; this.to = to; this.threshold = threshold || 0.5; } DiscreteStyleSubject.prototype = { setState: function(state) { var j=0; for (var i=0; i section ? 1 : 0); } if (this.options.rememberance) { document.location.hash = this.rememberanceTexts[section]; } } }