var recommendImg = new Array();

function loadImage(num, imgpath) {
	recommendImg[num] = new Image();
	recommendImg[num].src = imgpath;
	recommendImg[num].loaded = 1;
}

// 10.01.08 iwashita update -----------------------------------
function chgImage(num,recipe_id){
	if(typeof(recommendImg[num]) != 'undefined') {
		document.images['recommendImg'].src = recommendImg[num].src;
		document.getElementById('recommendImgPopup').href = "/recipe/popup.php?recipe_id=" + recipe_id + "&home=1";
	}
}
//-------------------------------------------------------------


function WindowOpen(url,width,height,target){
   width  = width  ? width  : 437;
   height = height ? height : 333;
   target = target ? target : 'popup';
   var wo = window.open(url,target,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height);
   wo.focus();
}

function WinOpen_page(url,width,height){
   var wo = window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + "\"");
   wo.focus();
}

function BlockEnter(evt){
	evt = (evt) ? evt : event; 
	var charCode=(evt.charCode) ? evt.charCode : 
		((evt.which) ? evt.which : evt.keyCode);
	if ( Number(charCode) == 13 || Number(charCode) == 3) {
		return false;
	} else {
		return true;
	}
}

function attachBlockEnter(formid) {
	var elements = document.forms[formid].elements;
	for (var j=0; j < elements.length; j++) {
		var e = elements[j];	
		if (e.type == "text"){
			e.onkeypress=BlockEnter;
		}
	}
}
