/* function or opening a popup window */

function createWindow(cUrl,cName,cFeatures) {
	var xWin = window.open(cUrl,cName,cFeatures);
	xWin.focus();
}

function shutwin() {
	var xWin = window.close();
}

function resize(windowWidth,windowHeight,targetWidth,targetHeight,widthMod,heightMod,fullScreen) {
	if (fullScreen) {
		targetWidth = screen.availWidth;
		targetHeight = screen.availHeight;
	 }
	if (windowWidth < targetWidth) 
		windowWidth += widthMod;
	if (windowHeight < targetHeight) 
		windowHeight += heightMod;
	windowLeft = (screen.availWidth / 2) - (windowWidth / 2);
	windowTop = (screen.availHeight / 2) - (windowHeight / 2);
	top.window.resizeTo(windowWidth,windowHeight);
	top.window.moveTo(windowLeft,windowTop);
	if (windowWidth < targetWidth || windowHeight < targetHeight)		
		setTimeout('resize(' + windowWidth + ', ' + windowHeight + ', ' + targetWidth + ', ' + targetHeight + ', ' + widthMod + ', ' + heightMod + ', ' + fullScreen + ');',10);
 }

function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function loadImages() {
		var i;
		var temp;

		for (i = 0; i < arguments.length; i++) {
				temp = makeId(arguments[i]);
				eval(temp +"= new Image()");
				eval(temp+".src ='"+ arguments[i] +"'");
		}
}
function makeId(path) {
		return path.substring( path.lastIndexOf("/")+1, path.lastIndexOf("."));
}

function addPic(_p) {
  myPics[myPics.length?myPics.length:0] = new Image();
  myPics[myPics.length-1].src=_p; // preload all pics
}

function checkIt(val) {
  current = Math.abs((current+parseInt(val))%myPics.length);
  document.myimg.src = myPics[current].src;
}
