var message="Copyright (c) 2009, Ian Webb. You may not download this image!";
if (navigator.appName == 'Microsoft Internet Explorer'){
function NOclickIE(e) {
if (event.button == 2 || event.button == 3) {
alert(message);
return false;
}
return true;
}
document.onmousedown=NOclickIE;
document.onmouseup=NOclickIE;
window.onmousedown=NOclickIE;
window.onmouseup=NOclickIE;
}
else {
function NOclickNN(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=NOclickNN; }
document.oncontextmenu=new Function("alert(message);return false")
}

function reAmount(size,job)
{
  //Default price for pics
  cost = '7.50'; // default value;
  var url = document.URL;
  var urlfile = (url.substring(url.lastIndexOf("\/")+1,url.lastIndexOf("\.")));
  //alert('This is '+job+', and '+size+', loc is '+urlfile);
  // everyone else pays the default prices. 
  switch (size)
  {
  
  case '8x6 (Cropped)': {cost = '7.50'; break; }
  case '9x6': {cost = '7.50'; break; }
    case 'A4': {cost = '10.00'; break; }
  case 'A3': {cost = '20.00'; break; }
  }




  // Special Pricing : change the job tag to match and edit the prices. 
  // default prices will apply otherwise. 
  if (job == 'os0') {
    switch (size)
    {
    case '8x6 (Cropped)': {cost = '5.00'; break; }
    case '9x6': {cost = '6.00'; break; }
    case 'A4': {cost = '10.00'; break; }
    case 'A3': {cost = '20.00'; break; }
    }
  } 

  if (job == 'anotherevent') {
    switch (size)
    {
    case '8x6 (Cropped)': {cost = '5.00'; break; }
    case '9x6': {cost = '6.00'; break; }
    case 'A4': {cost = '10.00'; break; }
    case 'A3': {cost = '20.00'; break; }
    }
  } 

  if (job == 'yetanotherevent') {
    switch (size)
    {
    case '8x6 (Cropped)': {cost = '5.00'; break; }
    case '9x6': {cost = '6.00'; break; }
    case 'A4': {cost = '10.00'; break; }
    case 'A3': {cost = '20.00'; break; }
    }
  } 




  if (size != 'default') {
     alert(size+" size costs \£"+cost+" each");
  }
  // update the field in the paypal form so that when they submit, the right price is used. 
  document.buypic.amount.value = cost;
}

// CREDITS:
// Snowmaker Copyright (c) 2003 Peter Gehrig. All rights reserved.
// Distributed by http://www.hypergurl.com
// Permission given to use the script provided that this notice remains as is.

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////

function randommaker(range) {		
	rand=Math.floor(range*Math.random())
    return rand
}

function initsnow() {
	if (ie5 || opera) {
		marginbottom = document.body.clientHeight
		marginright = document.body.clientWidth
	}
	else if (ns6) {
		marginbottom = window.innerHeight
		marginright = window.innerWidth
	}
	var snowsizerange=snowmaxsize-snowminsize
	for (i=0;i<=snowmax;i++) {
		crds[i] = 0;                      
    	lftrght[i] = Math.random()*15;         
    	x_mv[i] = 0.03 + Math.random()/10;
		snow[i]=document.getElementById("s"+i)
		snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
		snow[i].size=randommaker(snowsizerange)+snowminsize
		snow[i].style.fontSize=snow[i].size
		snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
		snow[i].sink=sinkspeed*snow[i].size/5
		if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
		if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
		if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
		if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
		snow[i].posy=randommaker(6*marginbottom-marginbottom-6*snow[i].size)
		snow[i].style.left=snow[i].posx
		snow[i].style.top=snow[i].posy
	}
	movesnow()
}

function movesnow() {
	for (i=0;i<=snowmax;i++) {
		crds[i] += x_mv[i];
		snow[i].posy+=snow[i].sink
		snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]);
		snow[i].style.top=snow[i].posy
		
		if (snow[i].posy>=marginbottom-6*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
			if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
			if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
			if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
			if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
			snow[i].posy=0
		}
	}
	var timer=setTimeout("movesnow()",50)
}

function printImage() {
// Type the number of images you are rotating.
NumberOfImagesToRotate = 14;
// Specify the first and last part of the image tag.
FirstPart = '<img src="randompix/image';
LastPart = '.jpg" width="300" height="450" align="right" border="1" style="border-color: white">';
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}

