this.name="CDV_MAIN";
var popupWindowObject=null;
var printPopupWindowObject=null;

if (document.images){
	var imageUrls = new Array('objects/logo.gif','objects/logo_HOVER.gif');
	var imagesPreloadArray = new Array();
	for (i=0; i<imageUrls.length; i++) {
		imagesPreloadArray[i] = new Image();
		imagesPreloadArray[i].src = imageUrls[i];
	}
}

function changeImage(imageId, imageUrl) {
	if (document.images && ((imageUrl.indexOf("/media/") != -1) || (imageUrl.indexOf("/fontimages/") != -1))) {
		obj = eval("document."+imageId);
		absolutePath = obj.src.substring(0, obj.src.lastIndexOf("/")+1);
		if (imageUrl.indexOf("/media/") != -1) {
			imageName = imageUrl.substring(imageUrl.indexOf("/media/")+7, imageUrl.length);
		} else {
			imageName = imageUrl.substring(imageUrl.indexOf("/fontimages/")+12, imageUrl.length);
		}
		if ((absolutePath+imageName) != obj.src) {
			obj.src = imageUrl;
		}
	}
}

function checkWindow(){
	if(popupWindowObject!=null){
		if(popupWindowObject.closed==false){
			popupWindowObject.close();
		}
	}
	if(printPopupWindowObject!=null){
		if(printPopupWindowObject.closed==false){
			printPopupWindowObject.close();
		}
	}
}

function popupWindow(destinationURL){
	var popupLeftPosition=(screen.width-700)/2;
	var popupTopPosition=(screen.height-500)/2;
	popupWindowObject=window.open(destinationURL,"CDV_POPUP","width=700,height=500,innerWidth=700,innerHeight=500,left="+popupLeftPosition+",top="+popupTopPosition+",dependent=yes,hotkeys=no,location=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=no");
}

function printPopupWindow(destinationURL){
	var popupLeftPosition=(screen.width-700)/2;
	var popupTopPosition=(screen.height-600)/2;
	printPopupWindowObject=window.open(destinationURL,"CDV_PRINT_POPUP","width=700,height=500,innerWidth=700,innerHeight=500,left="+popupLeftPosition+",top="+popupTopPosition+",dependent=yes,hotkeys=no,location=no,menubar=yes,resizable=no,scrollbars=yes,status=no,toolbar=no");
}
