function fnc_message() {
	document.message_form.submit();
}
function fnc_tel() {
	document.message_form.contact_type.value = "tel";
	document.message_form.submit();
}

function fncPopupImage(puppy_id, no, photo_type) {

	var NewWindow;
	NewWindow = window.open('', 'wind', 'toolbar=no, menubar=no, status=no, resizable=yes, scrollbars=yes');
	NewWindow.document.open();
	NewWindow.document.writeln('<html><head>');
	NewWindow.document.writeln('<meta http-equiv="content-type" content="text/html; charset=euc-jp" />');
	NewWindow.document.writeln('<link href="http://dogbreeder.ugpet.com/css/popup.css" rel="stylesheet" type="text/css" />');
	NewWindow.document.writeln('</head><body oncontextmenu="return false" >');
	NewWindow.document.writeln('<center>');
	NewWindow.document.writeln('<img src="http://dogbreeder.ugpet.com/upload/puppy_photo/' + puppy_id + '_' + no + '.' + photo_type + '" />');
	NewWindow.document.writeln('<br><a href="#" Onclick="javascript:window.close();"><img src="http://dogbreeder.ugpet.com/image/pageclose.gif" alt="閉じる" class="close_button_img" /></a>');
	NewWindow.document.writeln('</center>');
	NewWindow.document.writeln('</body></html>');
	NewWindow.document.close();
	NewWindow.focus();

}

if(typeof photoEffect != 'undefined'){
 photoEffect.init();
}

function popupImage(filepath, width, height){
    var y = 0;
    var x = 0;
    if (!popupImage.imgNode) {
        if (document.all) {
            y = document.body.scrollTop + 32;
            x = document.body.scrollLeft + 32;
            popupImage.imgNode = document.createElement('img');
            popupImage.imgNode.attachEvent('onclick', closeImage);
		
        } else if (document.implementation) {
            y = window.pageYOffset + 32;
            x = window.pageXOffset + 32;
            popupImage.imgNode = document.createElement('img');
            popupImage.imgNode.addEventListener('click' ,closeImage , true);

        } else {
            return;
        }
    }

    with(popupImage){
        imgNode.setAttribute('src', filepath );
        if (width && height) {
            imgNode.setAttribute('width', width );
            imgNode.setAttribute('height', height );
        }
        imgNode.style.position = 'absolute';
        imgNode.style.left = '32px';
        imgNode.style.top = y + 'px';
        imgNode.style.borderColor = '#0099FF';
        imgNode.style.borderWidth = '2px';
        imgNode.style.borderStyle = 'solid';
        imgNode.style.margin = '0';
        document.body.appendChild(imgNode);
    }

    function closeImage(){
        if (popupImage.imgNode) {
            document.body.removeChild(popupImage.imgNode);
            delete popupImage.imgNode;
        }
    }
}


