function pop_window(url, w, h) {
	myfocus = window.open(url, 'mywindow', 'menubar=no,scrollbars=no,width='+w+',height='+(h+30)); 
	setTimeout('myfocus.focus()',500);
}

function getObject(objectId) {
	if (document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId);
	} else if (document.all && document.all(objectId)) {
		return document.all(objectId);
	} else {
		return false;
	}
}

function hide_it(id) {
	var myObj = getObject(id);
	if (myObj.style != false) myObj.style.display = 'none';
}

function show_it(id) {
	var myObj = getObject(id);
	if (myObj.style != false) myObj.style.display = 'block';
}

function populate_it(myField, myValue, myArrayName) {
	var selectedArray = eval(myArrayName + myValue);
	while (selectedArray.length < myField.options.length) {
		myField.options[(myField.options.length - 1)] = null;
	}
	for (var i=0; i < selectedArray.length; i++) {
		eval("myField.options[i]=" + "new Option" + selectedArray[i]);
	}
}

function select_it(myField, myValue) {
	var elmLength = myField.length;
	for (var i = 0; i < elmLength; i++) {
		if (myField.options[i].value == myValue) {
			myField.selectedIndex = i
		}
	}
}

function slide_show(imageName, imageArray, counter) {
	var slideShowSpeed = 4000; // slideShow speed
	var crossFadeDuration = 3; // duration of crossfade
	var t;
	imageArray = imageArray.toString();
	imageArray = imageArray.split(',');
	var arrLength = imageArray.length;
	//alert(counter);
	var preLoad = new Array();
	for (i = 0; i < arrLength; i++) {
		preLoad[i] = new Image();
		preLoad[i].src = imageArray[i];
	}
	if (document.all) {
		document.images[imageName].style.filter="blendTrans(duration=2)";
		document.images[imageName].style.filter="blendTrans(duration=crossFadeDuration)";
		document.images[imageName].filters.blendTrans.Apply();
	}
	document.images[imageName].src = preLoad[counter].src;
	if (document.all) {
		document.images[imageName].filters.blendTrans.Play();
	}
	counter = counter + 1;
	if (counter >= (arrLength)) counter = 1;
	t = setTimeout('slide_show("'+imageName+'", "'+imageArray+'", '+counter+')', slideShowSpeed);
}
