var isMobile = 0;
var currency = new Array(5);
currency[0] = new Array('USD','1.6','US dollars','$');
currency[1] = new Array('GBP','1','British pounds','£');
var pounds = 1;
currency[2] = new Array('AUD','1.7','Australian dollars','$');
currency[3] = new Array('CAD','1.9','Canadian dollars','$');
currency[4] = new Array('EUR','1.4','Euros','€');
var minPrice = 40;
var maxPrice = 200;
var minPriceColor = 40;
var maxPriceColor = 200;
var minPriceBW = 25;
var maxPriceBW = 120;
var minPriceNoShading = 35;
var maxPriceNoShading = 180;
var minPriceNoOutline = 35;
var maxPriceNoOutline = 180;
var minPriceNoShadingOutline = 30;
var maxPriceNoShadingOutline = 160;
var thumbnails = new Array();
var thumbnailSize = 75;
var pages = new Array();
function Page()
{
this.title;
this.picture;
this.text = new Array();
this.casestudies = new Array();
this.testimonials = new Array();
}
var landingpage = "main";
pages['main'] = new Page();
pages['main'].title = "simongoodway.com";
pages['main'].picture = "kangaroo.jpg";
pages['main'].text[0] = "I'm Simon Goodway, a freelance illustrator with over 15 years of professional experience. In that time I've worked on a wide variety of projects for big name clients like easyJet, ebay and British Telecom, as well as projects for individuals like greetings cards, gift illustrations and children's books.";
pages['main'].text[1] = "I can meet most deadlines, and I can make changes quickly and easily if my initial design isn't quite what you had in mind. I include unlimited revisions in the price, so we'll go back and forth with the artwork until you're completely happy.";
pages['main'].text[2] = "If you think I might be able to help you, get in touch and we'll see what we can do. It would be great to work with you!";
pages['main'].casestudies.push(new caseStudy("main/ahlquist","Some educational material I produced on behalf of Thames Water.",6));
pages['main'].casestudies.push(new caseStudy("main/chhibba","These characters were commissioned for a range of t-shirts, making light hearted puns on various names.",10));
pages['main'].casestudies.push(new caseStudy("main/panel","A series of prospective panel cartoons I produced for newspapers and magazines.",14));
pages['main'].casestudies.push(new caseStudy("main/liu","Artwork for an England-themed Chinese nursery.",7));
pages['main'].casestudies.push(new caseStudy("main/glenn","I was asked to produce this design as nose art for a BT-13A Valiant aircraft.",1));
pages['main'].casestudies.push(new caseStudy("main/brindle","A series of images produced for projection as sets for a play.",9));
var t;
t = new Testimonial();
t.attribution = "Vivek Chhibba"
t.testimonial[0] = "After giving him a simple description of the kind of illustrations I wanted, Simon was able to recreate perfectly what I had in mind. He was able to complete the whole project within a VERY reasonable time span.";
pages['main'].testimonials.push(t);
t = new Testimonial();
t.attribution = "Sally Allnutt"
t.testimonial[0] = "Simon grasped the ideas immediately and his illustrations introduced a whole new level of humour to the project.";
pages['main'].testimonials.push(t);
t = new Testimonial();
t.attribution = "Adriana Farmiga, Norton Family Office"
t.testimonial[0] = "We've had nothing but a top-notch, professional result from Simon Goodway, and would recommend him to anyone, for any project, however large or small!";
pages['main'].testimonials.push(t);
function getFolder()
{
return "https://simongoodway.com/";
}
var shadingOn = true;
var outlinesOn = true;
var currSliderPosition = 1;
var sliderLen = 139;
function caseStudy(name,desc,num)
{
this.name = name;
this.description = desc;
this.num = num;
}
function Testimonial()
{
this.attribution;
this.testimonial = new Array();
}
var pic = new Image();
var prev_pic = new Image();
var next_pic = new Image();
var clockID = 0;
var rate = 0.7;
var weighted = 0.5;
var inprogress=0;
var image;
var counter = 0;
var ims = 79;
var images = new Array();
var current_pic;
var current_pic_num;
var current_pic_total;
if(landingpage.substr(0,5)=="index") landingpage="main";
var currentHash= "";
var usedArrows = false;
for(var i=1; i<=ims; i++) images[i]=0;
function goto(page)
{
document.location='##'+page;
show();
}
function setup()
{
if(isMobile!=1) startTimer();
//show(1);
currentHash = landingpage;
setTimeout("checkHash()",100);
setTimeout("loadBackgroundPages()",1000);
}
function loadBackgroundPages()
{
var p = new Array("main","books","websites","cards","process","prices","contactme","testimonials","childrensbooks");
for(i=0; i
='a' && h.charAt(i)<='z') h2 += h.charAt(i);
if(currentHash != h2) show();
setTimeout("checkHash()",100);
}
function pageWidth()
{
var a = window.innerWidth;
if(!a) a = 0;
var b = document.body.clientWidth;
if(!b) b = 0;
var c = document.documentElement.clientWidth;
if(!c) c = 0;
var d = 800;
return Math.max(Math.max(a,b),Math.max(c,d));
}
function changepic(z)
{
var s="prev";
var t="next";
if(z==1) { var u=s; s=t; t=u; }
/* prev_pic.src = "";
pic.src = "";
next_pic.src = "";*/
if(!current_pic) return;
// $(s+'_piccy').src = "";
if(current_pic_total==2 && current_pic_num==(s+1))
{
$(t+'_piccy').src = "";
setClass(t+"_piccy","hidden","");
}
else
{
$(t+'_piccy').src = "casestudies/"+current_pic+"_"+(current_pic_num<10?"0":"")+current_pic_num+".jpg";
if(isMobile)
{
$(t+'_piccy').style.width = $('piccy').offsetWidth;
$(t+'_piccy').style.height = $('piccy').offsetHeight;
}
setClass(t+"_piccy","","hidden");
}
if(z==0) current_pic_num = (current_pic_num>1?current_pic_num-1:current_pic_total);
else current_pic_num = (current_pic_num2 || current_pic_num==(2-z))
{
if(z==0) window[s+"_pic_num"] = (current_pic_num>1?current_pic_num-1:current_pic_total);
else window[s+"_pic_num"] = (current_pic_numtotal) return;
var image;
var preload_pic = new Image();
preload_pic.image = image;
preload_pic.next = n+1;
preload_pic.total = total;
if(n<10) n="0"+n;
preload_pic.src='casestudies/'+image+'_'+n+'.jpg';
preload_pic.onload = function()
{
preloadCaseStudy(this.image, this.next, this.total);
}
}
function embiggen(i,image)
{
if(!image) return;
prev_pic.src = "";
pic.src = "";
next_pic.src = "";
setClass("case_study","","hidden");
setClass("prev_piccy","hidden","");
setClass("piccy","","hidden");
setClass("next_piccy","hidden","");
setClass("blurb","","hidden");
$('piccy').src = "nav/hourglass.gif";
if(isMobile)
{
$('piccy').style.width = "300px";
$('piccy').style.height = "300px";
}
$('prev_piccy').src = "";
$('next_piccy').src = "";
current_pic = image;
current_pic_num = 1;
if( ($("csa_"+i+"_1").className.indexOf("csa1")!==-1 && (!$("csa_"+i+"_1").style.opacity || $("csa_"+i+"_1").style.opacity>0.2))|| ($("csa_"+i+"_2").className.indexOf("csa1")!==-1 && $("csa_"+i+"_2").style.opacity && $("csa_"+i+"_2").style.opacity <0.2 ) ) current_pic_num = parseInt($("csa_"+i+"_1").src.substr($("csa_"+i+"_1").src.length-6,2));
else current_pic_num = parseInt($("csa_"+i+"_2").src.substr($("csa_"+i+"_2").src.length-6,2));
current_pic_total = blurb_num[image];
setInnerHTML("blurb",blurb[image]);
setInnerHTML("testimonial","");
pic.src="casestudies/"+image+"_"+(current_pic_num<10?"0":"")+current_pic_num+".jpg";
pic.onload = function()
{
$('piccy').src = this.src;
$('piccy').style.visibility = "visible";
if(isMobile)
{
$('piccy').style.width = this.width*1.5;
$('piccy').style.height = this.height*1.5;
$('case_studies_dummy').style.height = $('case_studies').offsetHeight;
if(isMobile==1) window.scrollTo(0,100000);
}
}
if(current_pic_total>1)
{
showArrows();
if(current_pic_total>2)
{
prev_pic_num = (current_pic_num>1?current_pic_num-1:current_pic_total);
prev_pic.src = "casestudies/"+current_pic+"_"+(prev_pic_num<10?"0":"")+prev_pic_num+".jpg";
prev_pic.onload = function()
{
$('prev_piccy').src = this.src;
setClass("prev_piccy","","hidden");
if(isMobile)
{
$('prev_piccy').style.width = this.width*1.5;
$('prev_piccy').style.height = this.height*1.5;
$('case_studies_dummy').style.height = $('case_studies').offsetHeight;
}
}
}
next_pic_num = (current_pic_num1) setTimeout("preloadCaseStudy('"+image+"',2,"+current_pic_total+")", 5000);
}
function hideArrows()
{
$('arrows').style.visibility='hidden';
$('arrows').style.height=0;
$('arrows').style.position='absolute';
setClass("tip2","hidden","");
setClass("tip1","hidden","");
}
function showArrows()
{
$('arrows').style.visibility='visible';
$('arrows').style.height=27;
$('arrows').style.position='relative';
setClass("tip1","hidden","");
if(!usedArrows) setClass("tip2","","hidden");
}
function moveFunction(sliderPosition) {
currSliderPosition = sliderPosition;
var s = Math.max(0,Math.ceil(sliderPosition*9)-1);
var price = minPrice+s*((maxPrice-minPrice)/8);
$("price_picture").style.backgroundPosition = "0px -"+(s*450*(isMobile?2:1))+"px";
setInnerHTML("priceinpounds",Math.round(price/10)*10);
if($("price")) setInnerHTML("price",Math.round(price / currency[pounds][1] * currency[$("currencyfield").value][1]/5)*5);
}
function setCurrency()
{
if($("currency")) setInnerHTML("currency",currency[$("currencyfield").value][3]);
if($("price")) setInnerHTML("price",Math.round($('priceinpounds').innerHTML / currency[pounds][1] * currency[$("currencyfield").value][1]/5)*5);
}
function Overlay(name,probability,prerequisites,postrequisites,duration,leave,cancelledby)
{
this.name = name;
this.probability = probability;
this.prerequisites = prerequisites.split(",");
this.postrequisites = postrequisites.split(",");
this.duration = duration;
this.leave = leave;
this.cancelledby = cancelledby.split(",");
this.displayed = false;
this.img = new Image;
this.img.name = this.name;
this.img.duration = this.duration;
this.img.onload = function()
{
if($(this.name))
{
$(this.name).style.display = "block";
$(this.name).src = this.src;
}
else createElement("img","sidebar",this.name,"","sidebar","src",this.src);
setTimeout("endOverlay('"+this.name+"');",this.duration); cancelOverlays(this.name);
}
}
var overlays = new Array();
function _o(a,b,c,d,e,f,g) { overlays.push(new Overlay(a,b,c,d,e,f,g)); }
_o("babygiraffeblink",18,"","lionup",300,false,"");
_o("birdblink",18,"","birdflyaway",300,false,"");
_o("elephantblink",18,"","",300,false,"");
_o("giraffeblink",18,"","",300,false,"");
_o("hippo1blink",18,"","drain",300,false,"");
_o("hippo2blink",18,"","drain",300,false,"");
_o("hippobirdblink",18,"","drain",300,false,"");
_o("lionblink",18,"","lionup",300,false,"");
_o("monkeyblink",18,"","monkeysnake",300,false,"");
_o("snakeblink",18,"","monkeysnake",300,false,"");
_o("ripple1",15,"","drain",1000,false,"");
_o("ripple2",15,"","drain",1000,false,"");
_o("ripple3",15,"","drain",1000,false,"");
_o("waves",15,"","drain",1200,false,"");
_o("hippobirddrill",9,"","drain",1000,false,"");
_o("hippobirddrilldrained",9,"drain","",1000,false,"");
_o("butterfly1",9,"","",4000,false,"");
_o("butterfly2",9,"","",4000,false,"");
_o("butterfly3",9,"","",4000,false,"");
_o("squirrel",7,"","lionup",2420,false,"");
_o("birdflap",7,"","birdflyaway",800,false,"");
_o("birdhop",7,"","birdflyaway",1300,false,"");
_o("giraffesmile",7,"","lionup",3500,false,"");
_o("lionroar",7,"lionup","",2400,false,"");
_o("monkeyswing",6,"","monkeysnake",1000,false,"");
_o("snakeslither",6,"","monkeysnake",1000,false,"");
_o("duck",6,"","drain",3600,false,"");
_o("crab",6,"drain","",16000,false,"");
_o("elephanttrunk",6,"","drain",1500,false,"");
_o("birdflyaway",5,"","birdflyaway",1200,true,"");
_o("lionup",5,"","lionup,monkeysnake",700,true,"liondown");
_o("liondown",9,"lionup","",700,false,"");
_o("giraffetwist",5,"","monkeysnake,lionup",5000,false,"");
_o("monkeysnake",4,"","monkeysnake,lionup",3500,true,"");
_o("drain",4,"","drain",1800,true,"");
var randmax = 0;
for(var i=0; i=0; i++)
{
r -= overlays[i].probability;
}
i--;
var canDo = true;
// check prerequisites
for(var j=0; j='a' && ch.charAt(i)<='z') currentHash += ch.charAt(i);
if(!currentHash) currentHash = landingpage;
if(currentHash!="contactsent")
{
if(currentHash != landingpage) hideAll();
if(pages[currentHash]) displayPage(currentHash,partial);
else ajax("do.php?action=getpage&getpage="+currentHash,loadPage,10,"page",true);
}
}
function hideAll()
{
setClass("case_study","hidden","");
setClass("prev_piccy","hidden","");
setClass("piccy","hidden","");
setClass("next_piccy","hidden","");
setClass("blurb","hidden","");
setClass("contactform","hidden","");
if($('case_studies_dummy')) $('case_studies_dummy').style.height = 0;
$('prev_piccy').src = "";
$('piccy').src = "";
$('next_piccy').src = "";
removeChildren("blurb");
hideArrows();
for(i=0; inum) at=1;
thumbnails[id] = setTimeout("fadeThumb('"+name+"',"+id+","+at+","+(toggle==1?2:1)+","+num+",0)",100);
}
function displayPage(s,partial)
{
ajax("do.php?action=logpage&p="+s);
blurb=new Array();
blurb_num=new Array();
var p = pages[s];
if(!partial)
{
hideAll();
}
if(p.title) document.title = p.title;
else document.title = "simongoodway.com - Freelance illustrator and cartoonist";
if(currentHash=="prices" || currentHash=="contactme")
{
if($("_main_left_inner")) $("_main_left_inner").id = "main_left_inner";
}
else
{
if($("main_left_inner")) $("main_left_inner").id = "_main_left_inner";
}
if(!partial)
{
if(p.picture)
{
$("picture").style.backgroundImage = "url(pics/"+p.picture+")";
var img = document.createElement("img");
img.setAttribute("src","pics/"+p.picture);
img.onload = function(){ $("picture").style.height = this.height; }
$("picture").style.height = "430px";
$("picture").style.backgroundPosition = "0px 0px";
}
else
{
$("picture").style.backgroundImage = "url(nav/hourglass.gif)";
var img = document.createElement("img");
img.setAttribute("src","pics/"+p.picture);
$("picture").style.backgroundPosition = "0px 0px";
}
for(var i=0; i")
{
var zz = createElement("p","","",p.text[i],"main_text");
if(currentHash!="prices" && p.text[i].indexOf("javascript:void")==-1) zz.innerHTML = zz.innerHTML.replace(/&/g,"&");
}
}
}
else removeChildren("case_studies_inner");
thumbnailSize = Math.min(230,Math.max(($("case_studies_inner").offsetWidth-(p.casestudies.length*4))/p.casestudies.length,75));
if(isMobile) thumbnailSize = Math.min(320,($("case_studies_inner").offsetWidth-(3*4))/3);
for(i=0; i1)
{
im = createElement("img","csa2 casestudy","csa_"+i+"_2","",a,"src","casestudies/"+p.casestudies[i].name+"_thumb_02.jpg");
im.style.opacity = 0;
im.style.filter = "alpha(opacity=0)";
im.style.width=thumbnailSize;
im.style.height=thumbnailSize;
thumbnails[i] = setTimeout("updateThumb('"+p.casestudies[i].name+"',"+i+",2,1,"+p.casestudies[i].num+")",5000+i*500);
}
}
if(p.casestudies.length>0 && $("case_study").className=="hidden")
{
setClass("tip1","","hidden");
setClass("tip2","hidden","");
}
if(!partial)
{
if(isMobile!=1 || currentHash=="testimonials")
{
for(i=0; i0 && currentHash!="testimonials")
{
var more = createElement("div","more","","","testimonial");
createElement("a","","","More testimonials...",more,"href","javascript:void(0);","onclick","document.location='##testimonials'; show();");
}
}
}
if(currentHash=="prices")
{
sliderLen = parseInt($("slider5").style.left);
colorOption("col");
$("price_picture").style.backgroundImage = "url(pics/pricescale/all.jpg)";
if(isMobile)
{
$("price_picture").style.backgroundPosition = "0px -7200px";
$("price_picture").style.height = "900px";
}
else
{
$("price_picture").style.backgroundPosition = "0px -3600px";
$("price_picture").style.height = "450px";
}
$("price_picture").style.visibility = "visible";
setInnerHTML("priceinpounds",maxPrice);
if($("price")) setInnerHTML("price",Math.round(maxPrice / currency[pounds][1] * currency[$("currencyfield").value][1]/5)*5);
setCurrency();
var preload_pic1 = new Image(450,4050);
preload_pic1.src='pics/pricescale/bw.jpg';
var preload_pic3 = new Image(450,4050);
preload_pic3.src='pics/pricescale/outline.jpg';
var preload_pic4 = new Image(450,4050);
preload_pic4.src='pics/pricescale/colour.jpg';
var preload_pic2 = new Image(450,4050);
preload_pic2.src='pics/pricescale/shading.jpg';
$("slider3").ontouchstart =sliderClick;
}
if(currentHash=="contactme")
{
if(isMobile!==1) setFocus('name');
}
//if(!partial)
{
var b = getElementsByClass("buttona");
for(var i=0; i=0; i--)
{
n.removeChild(n.childNodes[i]);
}
}
function appendTextNode(appendTo,txt)
{
if(!txt) return;
if(typeof(txt)!="string")
{
appendTo.appendChild(document.createTextNode(txt));
return;
}
var s = txt.indexOf("<");
var left, mid, right;
if(s==-1)
{
left = txt;
if(left.length>0) appendTo.appendChild(document.createTextNode(left));
}
else
{
var e = txt.indexOf(">",s);
if(e==-1)
{
left = txt;
if(left.length>0) appendTo.appendChild(document.createTextNode(left));
}
else
{
left = txt.substring(0,s);
if(left.length>0) appendTo.appendChild(document.createTextNode(left));
mid = txt.substring(s+1,e);
right = txt.substring(e+1);
var z = mid.split(" ");
var type = z[0];
var nodeclass="";
var nodeid="";
var fields="";
var textnode="";
for(var j=1; j";
var e = right.indexOf(str);
var nests = 0;
var prevnests = -1;
var nested = 0;
while(e!=-1 && prevnests < nested)
{
left = right.substring(0,e);
nested = 0;
var n1=-1;
do
{
var n = n1;
n1=left.indexOf("<"+type+">",n+1);
var n2=left.indexOf("<"+type+" ",n+1);
if( ( n1 >= 0 && n2 >= 0 && n2= 0 ) ) n1 = n2;
if(n1>=0) nested++;
} while(n1>=0 && nested<50);
prevnests = nests;
for(n1=prevnests; n10) appendTextNode(el,left);
if(right.length>0) appendTextNode(appendTo,right);
}
else
{
if(right.length>0) appendTextNode(appendTo,right);
}
}
}
}
function getElementsByClass(searchClass,node,tag)
{
var classElements = new Array();
if ( node == null ) node = document;
if ( tag == null ) tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (var i = 0, j = 0; i < elsLen; i++)
{
if ( pattern.test(els[i].className) )
{
classElements[j] = els[i];
j++;
}
}
return classElements;
}
function createElement(type,cl,id,childTextNode,appendTo)
{
if(typeof(appendTo)=="string") appendTo = $(appendTo);
var e;
var appended = false;
if(type=="tr" && appendTo && appendTo.insertRow!==undefined)
{
appended = true;
e = appendTo.insertRow(-1);
}
else if(type=="td" && appendTo && appendTo.insertCell!==undefined)
{
appended = true;
e = appendTo.insertCell(-1);
}
else e = document.createElement(type);
if(cl) e.setAttribute("class",cl);
if(cl) e.setAttribute("className",cl);
if(id) e.setAttribute("id",id);
if(childTextNode) (typeof(childTextNode)=="string"||typeof(childTextNode)=="number"?appendTextNode(e,childTextNode):e.appendChild(childTextNode));
for(var i=5; i0; j++)
{
if(s[j].length>0)
{
var t = s[j].split(":");
if(t.length>1) e.style[t[0].replace(/^\s*|\s*$/g,'')] = t[1].replace(/^\s*|\s*$/g,'');
}
}
}
else
{
e.setAttribute(arguments[i],arguments[i+1]);
}
}
}
if(appendTo && !appended) appendTo.appendChild(e);
return e;
}
function setClass(el, classAdd, classRemove)
{
if(typeof(el)=="string") el = $(el);
if(el)
{
var cl = el.className;
cl = cl.split(" ");
var cl2 = "";
for(var i=0; i0 && requests[0].obsolete==true) requests.splice(0,1);
if(requests.length>0) requests[0].sendHttpRequest();
}
}
}
}
function sliderClick(e)
{
if(document.onmousemove == slideIsMove) return;
var oPix = document.childNodes ? 'px' : 0;
e2 = sliderMousePos(e);
slideIsDown(e);
var msMvCo = sliderMousePos(e); if( !e ) { e = window.event ? window.event : ( new Object() ); }
var theNewPos = msMvCo[0] - window.msStartCoord[0];
if( theNewPos < 0 ) { theNewPos = 0; } if( theNewPos > sliderLen ) { theNewPos = sliderLen; }
moveFunction(theNewPos/sliderLen);
}
function slideIsDown(e) {
var slider = $("slider5");
//make note of starting positions and detect mouse movements
var theLayer = slider.style ? slider.style : slider; var oPix = document.childNodes ? 'px' : 0;
var p = $("main");
var style = p.currentStyle || window.getComputedStyle(p);
var a = parseInt(style.marginLeft)+parseInt(style.paddingLeft)+parseInt(style.getPropertyValue('border-left-width'))+6;
if(isMobile==1)
w = $("slider2").offsetLeft+($("slider6").offsetWidth/2);
else
w = $("slider2").offsetLeft+a+($("slider6").offsetWidth/2);
w2 = sliderMousePos(e);
window.msStartCoord =w2;
window.msStartCoord[0] =w;
window.lyStartCoord = slider.style?[parseInt(slider.style.left),parseInt(slider.style.top)]:[parseInt(slider.left),parseInt(slider.top)];
if( document.captureEvents && Event.MOUSEMOVE ) { document.captureEvents(Event.MOUSEMOVE); document.captureEvents(Event.MOUSEUP); }
window.storeMOUSEMOVE = document.onmousemove;
window.storeTOUCHMOVE = document.ontouchmove;
window.storeMOUSEUP = document.onmouseup;
window.storeTOUCHEND = document.ontouchend;
window.storeBODYTOUCHMOVE = document.body.ontouchmove;
window.storeBODYTOUCHEND = document.body.ontouchend;
window.storeLayer = slider;
document.body.storeTOUCHMOVE = document.body.ontouchmove;
document.onmousemove = slideIsMove;
document.ontouchmove = slideIsMove;
document.onmouseup = slideIsMove;
document.ontouchend = slideIsMove;
document.body.ontouchmove = function(event) { event.preventDefault();}
document.body.ontouchend = function(e) { this.ontouchmove = this.storeTOUCHMOVE; }
return false;
}
function sliderMousePos(e) {
//get the position of the mouse
if( !e ) { e = window.event; } if( !e || ( typeof( e.pageX ) != 'number' && typeof( e.clientX ) != 'number' ) ) { return [0,0]; }
if( typeof( e.pageX ) == 'number' ) { var xcoord = e.pageX; var ycoord = e.pageY; } else {
var xcoord = e.clientX; var ycoord = e.clientY;
if( !( ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) || ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) || window.navigator.vendor == 'KDE' ) ) {
if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) ) {
xcoord += document.documentElement.scrollLeft; ycoord += document.documentElement.scrollTop;
} else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) ) {
xcoord += document.body.scrollLeft; ycoord += document.body.scrollTop; } } }
return [xcoord,ycoord];
}
function slideIsMove(e) {
if (window.getSelection) window.getSelection().removeAllRanges();
else if (document.selection && document.selection.empty) document.selection.empty();
//move the slider to its newest position
var msMvCo = sliderMousePos(e); if( !e ) { e = window.event ? window.event : ( new Object() ); }
var theLayer = window.storeLayer.style ? window.storeLayer.style : window.storeLayer; var oPix = document.childNodes ? 'px' : 0;
//var theNewPos = window.lyStartCoord[0] + ( msMvCo[0] - window.msStartCoord[0] );
var theNewPos = msMvCo[0] - window.msStartCoord[0];
if( theNewPos < 0 ) { theNewPos = 0; } if( theNewPos > sliderLen ) { theNewPos = sliderLen; }
theLayer.left = theNewPos + oPix;
//run the user's functions and reset the mouse monitoring as before
if(( e.type && e.type.toLowerCase() == 'mousemove' ) || ( e.type && e.type.toLowerCase() == 'touchmove' ) ) {
moveFunction(theNewPos/sliderLen);
} else {
document.onmousemove = window.storeMOUSEMOVE;
document.ontouchmove = window.storeTOUCHMOVE;
document.onmouseup = window.storeMOUSEUP;
document.ontouchend = window.storeTOUCHEND;
document.body.ontouchmove = window.storeBODYTOUCHMOVE;
document.body.ontouchend = window.storeBODYTOUCHEND;
if( window.storeLayer.stopFunc ) { window.storeLayer.stopFunc(theNewPos/window.storeLayer.maxLength); }
}
}
function colorOption(o)
{
if($("coloptionshading") && $("coloptionoutline"))
{
shadingOn = $("coloptionshading").checked;
outlinesOn = $("coloptionoutline").checked;
if(o=="bw")
{
$("price_picture").style.backgroundImage = "url(pics/pricescale/bw.jpg)";
$("coloptionshadingouter").className = "coloptionsdisabled";
$("coloptionoutlineouter").className = "coloptionsdisabled";
$("coloptionshading").disabled = true;
$("coloptionoutline").disabled = true;
$("bwicon").className = "selectedicon";
$("colicon").className = "unselectedicon";
minPrice = minPriceBW;
maxPrice = maxPriceBW;
}
else
{
$("colicon").className = "selectedicon";
$("bwicon").className = "unselectedicon";
$("coloptionshadingouter").className = "coloptionsenabled";
$("coloptionoutlineouter").className = "coloptionsenabled";
$("coloptionshading").disabled = false;
$("coloptionoutline").disabled = false;
if(shadingOn && outlinesOn)
{
$("price_picture").style.backgroundImage = "url(pics/pricescale/all.jpg)";
$("colicon").src = "pics/priceicons/all.jpg";
minPrice = minPriceColor;
maxPrice = maxPriceColor;
}
else if(shadingOn)
{
$("price_picture").style.backgroundImage = "url(pics/pricescale/shading.jpg)";
$("colicon").src = "pics/priceicons/shading.jpg";
minPrice = minPriceNoOutline;
maxPrice = maxPriceNoOutline;
}
else if(outlinesOn)
{
$("price_picture").style.backgroundImage = "url(pics/pricescale/outline.jpg)";
$("colicon").src = "pics/priceicons/outline.jpg";
minPrice = minPriceNoShading;
maxPrice = maxPriceNoShading;
}
else
{
$("price_picture").style.backgroundImage = "url(pics/pricescale/colour.jpg)";
$("colicon").src = "pics/priceicons/colour.jpg";
minPrice = minPriceNoShadingOutline;
maxPrice = maxPriceNoShadingOutline;
}
}
}
moveFunction(currSliderPosition);
}
function hide(el)
{
if(typeof(el)=="string") el = $(el);
if(el)
{
el.style.visibility = 'hidden';
el.style.position = 'absolute';
}
}