function pushimage(source, id, width, height) {document.getElementById(id).src = source.replace(source.substring(source.lastIndexOf('_')+1, source.lastIndexOf('.')), width+'x'+height)}

function mail(str) {
	str = str.split('').reverse().join('')
	document.location.href="mai"+"lto:"+str
	return false;
}

function captionizeImages() {
  if (!document.getElementsByTagName) return false
  if (!document.createElement) return false
  var images = document.getElementsByTagName("img")
  if (images.length < 1) return false;
  for (var i=0; i<images.length; i++) {
    if (images[i].className.indexOf("captioned") != -1) {
	  var title = images[i].getAttribute("alt")

      var divCaption = document.createElement("div")
      divCaption.className = "caption"
	  var divCaption_text = document.createTextNode(title)
      divCaption.appendChild(divCaption_text)
      var divContainer = document.createElement("div")
      divContainer.className="imgcontainer"
	  divContainer.style.width = images[i].getAttribute("width")
	  var imgH = parseInt(images[i].getAttribute("height"))+parseInt(40)
	  divContainer.style.cssText = "float: "+images[i].getAttribute("align")+";width:"+images[i].getAttribute("width")+"px;height:"+imgH+"px"

      images[i].parentNode.insertBefore(divContainer,images[i])
      divContainer.appendChild(images[i])
	  insertAfter(divCaption,images[i])
    }
  }
}

function insertAfter(newElement,targetElement) {
  var parent = targetElement.parentNode
  if (parent.lastChild == targetElement) {
    parent.appendChild(newElement)
  } else {
    parent.insertBefore(newElement,targetElement.nextSibling)
  }
}
window.onload = captionizeImages


// AUTO-CLOSE OPTION
windowAutoClose = false
if (windowAutoClose) {
	window.onblur = self.close
}

// PHOTO ALBUM POPUP
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.
PositionX = 50;
PositionY = 50;
defaultWidth  = 700;
defaultHeight = 700;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Laddar...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width)+6;');
		writeln('height=100-(document.body.clientHeight-document.images[0].height)-12;');
		writeln('if (width > 711) {width = 711};');
		writeln('if (height > 700) {height = 700; width = width + 12};');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
		writeln('function doTitle(){document.title="ContentaWeb PhotoAlbum";}');writeln('</sc'+'ript>');
	if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="auto" onload="reSizeToImage();doTitle();self.focus()">')
	else writeln('</head><body bgcolor=000000 scroll="auto" onload="reSizeToImage();doTitle();self.focus()" onclick="self.close()" onblur="self.close()">');
		writeln('<center><img name="George" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
	return false
}

function logout() {
	document.location.href='/includes/member_logout.asp'
}
