//(c)2006-2010 Max Edwards - www.maxedwards.com
//
function insertMTL() {
var e = 'max.edwards.uk /#/ gmail.com'.replace(' /#/ ', '@');
document.write('<a href="m' + 'ai' + 'lt' + 'o:' + e + '">' + e + '</a>');
}
var AWC_PageView = '';
var AWC_IFrame = '';
var AWC_ExtLink = '';
var AWC_ExtForm = '';
var AWC_Mailto = 'Lead';
var ClickLog_IFrame = true;
var ClickLog_ExtLink = true;
var ClickLog_ExtForm = true;
var ClickLog_Mailto = true;
var ExtLinkMode = 'BLANK';
var ExtFormMode = 'BLANK';
var adWordsConversionID = '1071638707';
var serverName='www.guitarchords.me.uk';
var appPath='';
var activeCC='??';
var fallbackCC='UK';
var loadCSSH=false
function replaceAll(s, text, by, ignoreCase) {
var rai = -1;
var textlc=text.toLowerCase();
if(ignoreCase) rai = s.toLowerCase().indexOf(textlc);else rai = s.indexOf(text);
var its = 0;
while (rai>=0 && its < 5000) {
its++;
if(rai>0)
s = s.slice(0, rai) + by + s.slice(rai+text.length);
else
s = by + s.slice(rai+text.length);
if(ignoreCase) rai = s.toLowerCase().indexOf(textlc, rai+by.length);else rai = s.indexOf(text, rai+by.length);
}
if(its>=5000) alert('OVERFLOW!');
return s;
}
function trim(s) {return ltrim(rtrim(s));}
var whitespace = ' \t\n\r';
function rtrim(s) {
while (whitespace.indexOf(s.charAt(s.length-1)) >= 0 && s.length > 0)
if(s.length == 1) s='';else s = s.slice(0, -1);
return s;
}
function ltrim(s) {
while (whitespace.indexOf(s.charAt(0)) >= 0 && s.length > 0)
if(s.length == 1) s='';else s = s.slice(1);
return s;
}
function getRefToDiv(divID) {return getRefToElement(divID);}
function getRefToElement(id) {
if( document.layers ) {
return document.layers[id];}
if( document.getElementById ) {
return document.getElementById(id);}
if( document.all ) {
return document.all[id];}
if( document[id] ) {
return document[id];}
return false;
}
function getInnerText(obj) {
if(typeof(obj.innerText) != 'undefined') return (obj.innerText);
if(typeof(obj.textContent) != 'undefined') return(obj.textContent);
if(typeof(obj.text) != 'undefined') return(obj.text);
return null;
return obj.innerText || obj.textContent || obj.text;
}
function setInnerText(obj, txt) {
if(typeof(obj.innerText) != 'undefined') {obj.innerText = txt;return}
if(typeof(obj.textContent) != 'undefined') {obj.textContent = txt;return}
if(typeof(obj.text) != 'undefined') {obj.text = txt;return}
return null;
}
function addEvent(obj, eventname, func) {
if(typeof obj.addEventListener != 'undefined')
obj.addEventListener(eventname, func, false);
else
if(typeof obj.attachEvent != 'undefined') {
obj.attachEvent('on' + eventname, func);
}else {
eval('obj.on' + eventname + ' = func;');
}
}
function addLoadEvent(func) {
if(typeof window.addEventListener != 'undefined')
window.addEventListener('load', func, false);
else
if(typeof document.addEventListener != 'undefined')
document.addEventListener('load', func, false);
else
if(typeof window.attachEvent != 'undefined')
window.attachEvent('onload', func);
else {
if(typeof window.onload == 'function') {
var existing = window.onload;
window.onload = function() {
existing();
func();
}
}
else window.onload = func;
}
}
function addResizeEvent(func) {
if(typeof window.addEventListener != 'undefined')
window.addEventListener('resize', func, false);
else
if(typeof document.addEventListener != 'undefined')
document.addEventListener('resize', func, false);
else
if(typeof window.attachEvent != 'undefined')
window.attachEvent('onresize', func);
else {
if(typeof window.onload == 'function') {
var existing = window.onresize;
window.onresize = function() {
existing();
func();
}
}
else window.onresize = func;
}
}
function XMLfetch(loc, async, asyncCallbackFunction) {
var XMLrequest = createXMLHttpRequest();
if(XMLrequest) {
if(typeof(async) == 'undefined') async = false;
if(async) {
if(typeof(asyncCallbackFunction) == 'undefined') {
asyncCallbackFunction = function() {
if(XMLrequest.readyState==4) {
}
}
}
XMLrequest.onreadystatechange = asyncCallbackFunction;
}
try {XMLrequest.open("GET", loc, async);}catch (e) {
}
var ok = false;
try {XMLrequest.send('');ok = true;}catch (e) {}
if(!ok)
try {XMLrequest.send();ok = true;}catch (e) {}
if(ok && !async) return XMLrequest.responseText;else return '';
}else {
return '';
}
}
function createXMLHttpRequest() {
try { return new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {}
try { return new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}
try { return new XMLHttpRequest();}catch(e) {}
return null;
}
function dumpObject(obj) {
n = '';
for (property in obj) {
n += property + ' = \'' + eval('obj.' + property) + '\' ';
}
alert(n)
}
function setAllCheckboxes(aForm, aValue) {
var all = aForm.elements;
for (var i = 0;i < all.length;++i) {
if(all[i].nodeName.match(/^input$/i) && all[i].type.match(/^checkbox$/i))
all[i].checked = aValue;
}
}
function Random(N) {
return Math.floor(N * (Math.random() % 1));
}
function randomInt(MinV, MaxV) {
return MinV + Random(MaxV - MinV + 1);
}
var abIDcount = 0;
function makeAutoBanner(width, height, rangeStart, rangeFinish, keywords, baseURL) {
if(!baseURL) baseURL = appPath;
var urlJoin = '?';
var coun = '';
if(activeCC != '' && activeCC != '??') coun = activeCC;
var src= baseURL + '/autoban2_' + width + 'x' + height + coun + '/' + rangeStart + '/' + rangeFinish;
if(keywords) if(keywords != '') {
src += urlJoin + 'q=' + escape(keywords);
urlJoin = '&';
}
abIDcount += 1;
if(abIDcount == 1) {
src += urlJoin + 'id=1';
urlJoin = '&';
}
document.write('<iframe frameborder="0" width="' + width + '" height="' + height + '" src="' + src + '" border="0" marginwidth="0" marginheight="0" scrolling="no" style="background:transparent;"></iframe>');
}
function getStyle(obj,styleProp)
{
if(obj.currentStyle)
return obj.currentStyle[styleProp];
else if(window.getComputedStyle)
return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
return eval('obj.style.' + styleProp);
}
function elementVisible(obj) {
do {
if(getStyle(obj,'display').toUpperCase()=='NONE') return false;
if(getStyle(obj,'visibility').toUpperCase()=='HIDDEN') return false;
obj=obj.parentNode;
}while (obj.tagName.toUpperCase() != 'BODY');
return true;
}
var _SR_divPrefix;
var _SR_width;
var _SR_height;
var _SR_numBans;
var _SR_sideScroll;
var _SR_animate_interval_ms = 50;
var _SR_animate_duration_ms = 1000;
var _SR_minSecondsSpacing = 15;
var _SR_maxSecondsSpacing = 21;
var _SR_deferInit = true;
var __SR = new Array();
function SR_createRotator() {
__SR.length++;
__SR[__SR.length-1] = new SR_rotatorObject(__SR.length-1);
}
function SR_rotatorObject(arrayIndex) {
this.myIndex = arrayIndex;
this.prefix = _SR_divPrefix;
this.width = _SR_width;
this.height = _SR_height;
this.sideScroll = _SR_sideScroll;
this.numBans = _SR_numBans;
this.animate_interval_ms = _SR_animate_interval_ms;
this.animate_duration_ms = _SR_animate_duration_ms;
this.minSecondsSpacing = _SR_minSecondsSpacing;
this.maxSecondsSpacing = _SR_maxSecondsSpacing;
this.deferInit = _SR_deferInit;
this.banNew = randomInt(1, this.numBans);
this.banOld = -1;
if(this.sideScroll)
this.destVal = this.width;
else
this.destVal = this.height;
this.curVal = this.destVal;
var steps = this.animate_duration_ms / this.animate_interval_ms;
if(this.sideScroll)
this.animate_increment = Math.round(this.width / steps, 0);
else
this.animate_increment = Math.round(this.height / steps, 0);
if(this.animate_increment < 1) this.animate_increment = 1;
this.ensureNextBannerLoaded = function() {
var objNew = getRefToElement(this.prefix + this.banNew);
var objLinks = objNew.getElementsByTagName('a');
if(objLinks.length>0) {
var objImgs = objLinks[0].getElementsByTagName('img');
if(objImgs.length>0) {
var defSrc = getAttr(objImgs[0], 'defSrc');
if(defSrc) if(defSrc!='') if(defSrc.indexOf('http') == 0) {
objImgs[0].src = defSrc;
objImgs[0].removeAttribute('defSrc');
}
}
}
return true;
}
this.doNextStep = function() {
var objNew = getRefToElement(this.prefix + this.banNew);
this.ensureNextBannerLoaded();
if(this.banOld < 0) {
if(this.sideScroll) {
objNew.style.display = 'inline';
}else {
objNew.style.display = 'block';
}
}else {
this.curVal += this.animate_increment;
if(this.curVal > this.destVal) this.curVal = this.destVal;
if(this.sideScroll) {
objNew.style.width = this.curVal + 'px';
objNew.style.display = 'inline';
}else {
objNew.style.height = this.curVal + 'px';
objNew.style.display = 'block';
}
objNew.style.visibility = 'visible';
var objOld = getRefToElement(this.prefix + this.banOld);
if(this.curVal == this.destVal) {
objOld.style.display = 'none';
}else {
if(this.sideScroll)
objOld.style.width = (this.destVal - this.curVal) + 'px';
else
objOld.style.height = (this.destVal - this.curVal) + 'px';
}
}
if(this.curVal == this.destVal) {
var prog = (this.banNew-1) / (this.numBans-1);
var delay = this.minSecondsSpacing * prog + this.maxSecondsSpacing * (1 - prog);
this.banOld = this.banNew;
this.banNew = (this.banNew % this.numBans) + 1;
this.curVal = 0;
if(delay>3)
setTimeout('__SR[' + this.myIndex + '].ensureNextBannerLoaded();', Math.round((delay - 3) * 1000, 0));
else
this.ensureNextBannerLoaded();
setTimeout('__SR[' + this.myIndex + '].doNextStep();', Math.round(delay * 1000, 0));
}else {
setTimeout('__SR[' + this.myIndex + '].doNextStep();', this.animate_interval_ms);
}
}
this.doNextStep();
}
function getAttr(node, attr) {
var v = '';
try {v=node.getAttribute(attr);}catch (e) {
return '';
}
return v;
}
function availableWidth() {
if(typeof(window.innerWidth) != 'undefined') return window.innerWidth;
if(typeof(document.documentElement.clientWidth) != 'undefined') return document.documentElement.clientWidth;
return document.body.clientWidth;
}
function availableHeight() {
if(typeof(window.innerHeight) != 'undefined') return window.innerHeight;
if(typeof(document.documentElement.clientHeight) != 'undefined') return document.documentElement.clientHeight;
return document.body.clientHeight;
}
function googleVideo(docID, wid, hei, startP) {
var r = '';
r += '<embed style="width:' + wid + 'px;height:' + hei + 'px;" id="VideoPlayback" flashvars="initialTime=' + startP + '"';
r += ' type="application/x-shockwave-flash" quality="best" bgcolor="#000000"';
r += ' src="http://video.google.com/googleplayer.swf?docId=' + docID + '"></embed>';
return r;
}
function youTube(docID, wid, hei, dummy) {
var r = '';
r += '<object width="' + wid + '" height="' + hei + '">';
r += '<param name="movie" value="http://www.youtube.com/v/' + docID + '"></param>';
r += '<embed src="http://www.youtube.com/v/' + docID + '" type="application/x-shockwave-flash"';
r += ' width="' + wid + '" height="' + hei + '"></embed></object>';
return r;
}
function makeGoogleSearch(kw) {
var h = '';
var asID = '';
if(serverName=='www.spinge.com') asID='eet89urclj4';
if(serverName=='www.nowtravel.org.uk') asID='jlguuhfvzbc';
if(serverName=='www.maxoffice.org.uk') asID='tpnp38z9nhw';
if(asID!='') {
h += '<br /><br /><form action="http://www.google.com/cse" id="cse-search-box">';
h += '<div>';
h += '<input type="hidden" name="cx" value="partner-pub-3891734730917860:' + asID + '" />';
h += '<input type="hidden" name="ie" value="ISO-8859-1" />';
h += '<input type="text" name="q" size="31" value="' + kw + '"/>';
h += '<input type="submit" name="sa" value="Search" />';
h += '</div>';
h += '</form>';
h += '<scr' + 'ipt type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></scr' + 'ipt>';
}
document.write(h);
}
addLoadEvent(checkTargets);
var lCC = false;
var lTZ = false;
var lSCR = false;
var redir = '';
var AWC_JSredir = '';
function doLoggingAndRedirects() {
if(lCC || lTZ || lSCR) {
var url = 'http://' + serverName + appPath + '/log';
url += '/l';if(lCC && typeof(sGeobytesLocationCode)!='undefined')
url += escape(sGeobytesLocationCode);
url += '/z';if(lTZ) { var d = new Date();url += d.getTimezoneOffset();}
url += '/s';if(lSCR) url += screen.width + 'x' + screen.height;
XMLfetch(url, (redir == ''));
}
if(redir != '') {
if(redir.indexOf('!!CC!!') >= 0) {
var CC = fallbackCC;
if(typeof(sGeobytesLocationCode) != 'undefined')
if(sGeobytesLocationCode != 'unknown')
CC = sGeobytesLocationCode.slice(0,2);
redir = redir.replace('!!CC!!', CC);
}
if(redir.toLowerCase().indexOf('http') == 0)
if(redir.toLowerCase().indexOf('http://' + serverName.toLowerCase()) < 1) {
adWordsConversion(AWC_JSredir);
XMLfetch('http://' + serverName + appPath + '/_ExitVia_JSREDIRECT.aspx?dest=' + escape(redir));
}
location.replace(redir);
}
}
var iframeDims = '';
var iframeNo = 0;
var iframeProvider = '';
var iframeExtraInfo = '';
function checkTargets() {
adWordsConversion(AWC_PageView);AWC_PageView = '';
if(loadCSSH) {CSSH_parseStylesheets();}
doLoggingAndRedirects();
var r = '';
var links = document.getElementsByTagName('a');
r += '\nNon-standard links:\n';
var h;
if(links.length > 0) {
for (var i=0;i<links.length;i++) {
h = links[i].href.toString().toLowerCase();
extLink = h.indexOf('http') == 0
extLink = extLink && (h.indexOf(location.toString().slice(0, 8 + serverName.length)) != 0);
if(extLink) {
r += links[i].href + ' (EXTERNAL)\n';
if(ExtLinkMode == 'BLANK') links[i].target='_blank';
if(ExtLinkMode == 'SAME') links[i].target='';
addEvent(links[i], 'click', logLINKclick);
}
if(h.indexOf('mailto:') == 0) {
r += links[i].href + ' (MAILTO)\n';
addEvent(links[i], 'click', logMAILTOclick);
}
}
}
var forms = document.getElementsByTagName('form');
r += '\nexternal forms:\n';
var act;
if(forms.length > 0) {
for (var i=0;i<forms.length;i++) {
act = forms[i].action.toString().toLowerCase();
if(act.indexOf(serverName)<0 && act.indexOf('http')==0) {
r += forms[i].action + '\n';
if(ExtFormMode == 'BLANK') forms[i].target='_blank';
if(ExtFormMode == 'SAME') forms[i].target='';
addEvent(forms[i], 'submit', logFORMsubmit);
}
}
}
if(document.all) {
var x = document.getElementsByTagName("iframe");
if(typeof x == "undefined") {
return;
}
if(x.length ==0) {
return;
}
for (iframeNo=0;iframeNo<x.length;iframeNo++) {
identifyIframe(x[iframeNo]);
x[iframeNo].onfocus = logIFRAMEclick;
}
}else {
window.addEventListener('beforeunload', FFpageExit, false);
window.addEventListener('mousemove', FFgetMouse, true);
}
}
var FFpx;
var FFpy;
function FFgetMouse(e) {FFpx=e.pageX;FFpy=e.clientY;}
function findY(obj) {
var y = 0;
while (obj) {y += obj.offsetTop;obj = obj.offsetParent;}
return(y);
}
function findX(obj) {
var x = 0;
while (obj) {x += obj.offsetLeft;obj = obj.offsetParent;}
return(x);
}
function FFpageExit(e) {
var x = document.getElementsByTagName("iframe");
if(typeof x == "undefined") {
return;
}
if(x.length ==0) {
return;
}
for (iframeNo=0;iframeNo<x.length;iframeNo++) {
var iLeft = findX(x[iframeNo]);
var iTop = findY(x[iframeNo]);
var xMatch = (FFpx > (iLeft - 10) && FFpx < (parseInt(iLeft) + parseInt(x[iframeNo].width) + 15));
var yMatch = (FFpy > (iTop - 10) && FFpy < (parseInt(iTop) + parseInt(x[iframeNo].height) + 10));
if(xMatch && yMatch) {
identifyIframe(x[iframeNo]);
logIFRAMEclick(e);
}else {
}
}
}
function identifyIframe(obj) {
iframeDims = obj.width + 'x' + obj.height;
iframeExtraInfo = obj.extraInfo;if(!iframeExtraInfo) iframeExtraInfo = '';
iframeProvider = 'unknown+provider&fullSource=' + obj.src;
var x = obj.src;
if(!x) return;
x = x.toString().toLowerCase();
if(x.indexOf('googlesyndication') > -1) {iframeProvider = 'googlesyndication';return;}
if(x.indexOf('tradedoubler') > -1) {iframeProvider = 'tradedoubler';return;}
if(x.indexOf('/_debug/_write') > -1) {iframeProvider = 'AdSenseDevserverSubstitute';return;}
if(x.indexOf('/autoban') > -1) {iframeProvider = 'LinkPlexAutoBanner';return;}
}
function isRightClick_v2(e) {
var but = -1;
if(typeof e != "undefined")
if(typeof e.which != "undefined")
but = e.which;
if(typeof event != "undefined")
if(typeof event.button != "undefined")
but = event.button;
return (but == 2 || but == 3);
}
function isRightClick(e) {
var but = -1;
if(document.all) but=event.button;else but=e.which;
return (but == 2 || but == 3);
}
function logIFRAMEclick(e) {
if(isRightClick(e)) return true;
if(document.all) l = window.event.srcElement;else l = e.target;
adWordsConversion(AWC_IFrame);AWC_IFrame = '';
if(ClickLog_IFrame) {
XMLfetch('http://' + serverName + appPath + '/_ExitVia_IFRAME.aspx?name=' + l.name + '&iframeNo=' + (iframeNo+1) + '&dimensions=' + iframeDims + '&provider=' + iframeProvider + '&extraInfo=' + iframeExtraInfo.toString());
ClickLog_IFrame = false;
}
if(typeof _uacct != "undefined") {
if(l.src.indexOf("pagead2.googlesyndication.com/pagead/iclk") > -1) {
urchinTracker("/GoogleAdSenseClick");
}else if(l.src.indexOf("pagead2.googlesyndication.com/pagead/ads") > -1) {
urchinTracker("/GoogleAdLinkClick");
}else if(l.src.indexOf("adwords.google.com") > -1) {
urchinTracker("/GoogleAdwordsSignup");
}else if(l.src.indexOf("services.google.com") > -1) {
urchinTracker("/AdsByGoogleFeedback");
}else if(l.src.indexOf("mm.chitika.net") > -1) {
urchinTracker ("/ChitikaClick");
}else if(l.src.indexOf("overture.com") > -1) {
urchinTracker("/YPNClick");
}else if(l.src.indexOf("publisher.yahoo.com") > -1) {
urchinTracker("/YahooPublisherFeedback");
}
}
}
function logLINKclick(e) {
if(isRightClick(e)) return true;
if(document.all) l = window.event.srcElement;else l = e.target;
var leaving = (ExtLinkMode == 'SAME' || l.target=='');
adWordsConversion(AWC_ExtLink);if(leaving) AWC_ExtLink = '';
if(ClickLog_ExtLink) {
XMLfetch('http://' + serverName + appPath + '/_ExitVia_HYPERLINK.aspx?innerText=' + escape(l.innerText) + '&name=' + escape(l.name) + '&title=' + escape(l.title) + '&id=' + escape(l.id) + '&href=' + escape(l.href), !leaving);
if(leaving) ClickLog_ExtLink = false;
}
}
function logMAILTOclick(e) {
if(isRightClick(e)) return true;
if(document.all) l = window.event.srcElement;else l = e.target;
adWordsConversion(AWC_Mailto);AWC_Mailto = '';
if(ClickLog_Mailto) {
XMLfetch('http://' + serverName + appPath + '/_ExitVia_MAILTO.aspx?innerText=' + escape(l.innerText) + '&name=' + escape(l.name) + '&title=' + escape(l.title) + '&id=' + escape(l.id) + '&href=' + escape(l.href), true);
}
}
function logFORMsubmit(e) {
if(document.all) l = window.event.srcElement;else l = e.target;
var leaving = (ExtLinkMode == 'SAME' || l.target=='');
adWordsConversion(AWC_ExtForm);if(leaving) AWC_ExtForm = '';
if(ClickLog_ExtForm) {
XMLfetch('http://' + serverName + appPath + '/_ExitVia_FORM.aspx?action=' + escape(l.action) + '&name=' + escape(l.name) + '&id=' + escape(l.id), !leaving);
if(leaving) ClickLog_ExtForm = false;
}
}
function adWordsConversion(label) {
if(typeof label == "undefined") return;
if(label == '') return;
crossDomainTrackerLoad('http://www.googleadservices.com/pagead/conversion/' + adWordsConversionID + '/?value=1&label=' + label + '&script=0');
}
var tmpImage=new Image();
function crossDomainTrackerLoad(url) {
if(typeof document.createElement != "undefined") {
var anImg = document.createElement( 'img' );
anImg.setAttribute('id','tmpTrackingImage');
anImg.setAttribute('width',1);
anImg.setAttribute('height',1);
document.body.appendChild( anImg );
addEvent(anImg, 'load', removeTmpTrackerImage);
anImg.setAttribute("src", url);
}else {
tmpImage.src = url;
}
}
function removeTmpTrackerImage()
{
var anImg = getRefToElement('tmpTrackingImage');
if(anImg) anImg.parentNode.removeChild(anImg);
}
function checkAgreement() {
if(getRefToDiv('agreeTerms').checked) return true;
alert('Please confirm that you have read and agree to my Terms & Conditions.\n\nI cannot commence any type of work for you INCLUDING:\n\n- fulfilling a request for a quote\n- meeting to discuss possible work\n\non any terms other than those expressed therein.\n\nAny contact you make with me shall be taken as full agreement to my terms.\n\nTherefore it is vital that you have properly read and understood them.');
return false;
}
// JSOK