// Make sure file is not hosted in a different frameset
if(top.location.href != window.location.href){
	top.location.href = window.location.href
}

var http = httpGetObject();

function openWindow(url, w, h){
	var windowprops = "width=" + w + ",height=" + h +",left=10,top=10,scrollbars=no,status=yes,toolbar=no,location=no,directories=no,resizable=yes";
	popup = window.open(url,'newWin',windowprops);
	popup.focus();
	return popup;
}

function switchClass(obj,strClassName){
	obj.className = strClassName;
}

function gotoURL(strUrl){
	location = strUrl;
}

function copyrightYear(startYear){
	d = new Date();
	if(startYear != d.getFullYear()){
		return startYear + " - " + d.getFullYear();
	} else {
		return startYear;
	}
}

/*
* change image source
*
* @param string mainImageId - image id
* @param string imageUrl - url of the image that have to be put as a sourse to original image
*/
function changeMainImage(mainImageId, imageUrl){
	var mainImage = document.getElementById(mainImageId);
	if(mainImage){
		// change image source to imageUrl
		mainImage.src = imageUrl;
	}
}

function validZIP(val){
	return true;
	re = new RegExp(/^\d{5,5}$/);
	if(val.match(re)){
		return true;
	} else {
		return false;
	}
}
