// $Id: popup_image_selection.js,v 1.3 2006/01/04 08:51:31 max Exp $

/*
	Display popup window
*/

function popup_image_selection_RK(type, id, imgid, num) {
	return window.open("provider/image_selection_2.php?type="+type+"&id="+id+"&imgid="+imgid+"&num="+num,"selectimage","width=600,height=370,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no");
}

/*
	Reset new selected image
*/
function popup_image_selection_reset_RK(type, id, imgid) {
	if (document.getElementById(imgid)) {
		var ts = new Date();
		//document.getElementById(imgid).src = xcart_web_dir+"/image.php?type="+type+"&id="+id+"&ts="+ts.getTime();
		document.getElementById(imgid).src = xcart_web_dir+"/skin2/images/dot_clear.gif";

       if (document.getElementById(imgid+'_text')) {
			document.getElementById(imgid+'_text').style.display = 'none';
			for (var cnt = 1; true; cnt++) {
				if (!document.getElementById(imgid+'_text'+cnt))
					break;
				window.opener.document.getElementById(imgid+'_text'+cnt).style.display = 'none';
			}
		}

		if (document.getElementById('skip_image_'+type))
			document.getElementById('skip_image_'+type).value = 'Y';
		else if (document.getElementById('skip_image_'+type+"_"+id))
			document.getElementById('skip_image_'+type+"_"+id).value = 'Y';

		if (document.getElementById(imgid+'_reset'))
			document.getElementById(imgid+'_reset').style.display = 'none';
			document.getElementById(imgid).style.width = 0+'px';
			document.getElementById(imgid).style.height = 0+'px';
			
	}
}

