function newImage(arg) {
    if (document.images) {
	rslt = new Image();
	rslt.src = arg;
	return rslt;
    }
}

function changeImages() {
    if (document.images && (preloadFlag == true)) {
	for (var i=0; i<changeImages.arguments.length; i+=2) {
	    document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
	}
    }
}

var preloadFlag = false;
function preloadImages() {
	 if (document.images) {
		home_over = newImage("/images/home-over.gif");
//		suggest_over = newImage("/images/link-suggest-over.gif");
		info_over = newImage("/images/link-info-over.gif");
//		banner_over = newImage("/images/link-banner-over.gif");
		wiget_over = newImage("/images/link-wiget-org-over.gif");
//		info_over = newImage("/images/navigation/info-over.gif");
//		contact_over = newImage("/images/navigation/contact-over.gif");
//		content_over = newImage("/images/navigation/arrow-left-over.gif");
//		next_over = newImage("/images/navigation/gallery-content-over.gif");
//		back_over = newImage("/images/navigation/arrow-right-over.gif");
		preloadFlag = true;
	}
}
function setLanguage(arg) {
   var expire_date = new Date();
   var one_month = expire_date.getTime() + (30 * 24 * 60 * 60 * 1000);
   expire_date.setTime(one_month);
   var current_cookie = document.cookie;
   if (arg == "de") {
	 document.cookie = "lang=de; expires=" + expire_date.toGMTString() +"; path=/";
	 document.location.href = document.location.href
   }
   if (arg == "en") {
     document.cookie = "lang=en; expires=" + expire_date.toGMTString() +"; path=/";
	 document.location.href = document.location.href
   }
}


var message="Copyright 2003 - 2006 by Philippe Wiget Photography.\n If you are interested in an image, feel free to contact me via the 'contact' link";
function clickIE4(){
			if (event.button==2){
			alert(message);
			return false;
			}
}
function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}
function rightclick() {
	if (document.layers){
			document.captureEvents(Event.MOUSEDOWN);
			document.onmousedown=clickNS4;
	}
	else if (document.all&&!document.getElementById){
			document.onmousedown=clickIE4;
	}
	document.oncontextmenu=new Function("alert(message);return false;")
}
function click_count(arg) {
	document.getElementById("link_cl").src = "/links/click_counter.php?link="+arg;
}



function openCheckURL(url) {
	window.name = "photolinks_ch";
	window.open("/links/check_url.php?url=" + url + "","url","width=350,height=350,left=5,top=5");
}
function reportWindowPos() {
	window.resizeTo(480,460);
	window.moveTo(30,30);
	window.focus();
}
