/**
 * ***********************************************************************************************
 * Project:      Order File
 * Filename:     this
 * Type:
 * Module:       CakePHP 1.2.4.8284
 *               PHP 5.2.11
 *               Apache 2.2.14
 * Subcategory:
 * Description:
 * Characterset: utf-8
 * Translation:
 * ***********************************************************************************************
 * Author:       Takashi Kawahara <t_kawahara@chess-inc.com>
 * Copyright:    2009 chess,inc. All Rights Reserved.
 * Homepage:     http://www.chess-inc.com/
 * ***********************************************************************************************
 */
$(function(){
    $("#accordion").accordion();

    // ▼ アコーディオン非表示制御
    $('.styleLeftNavi1').click(function(){
	if($("+ div",$(this).parent()).css("display")!="none"){
	    $("+ div",$(this).parent()).hide();
	}else{
	    $("+ div",$(this).parent()).slideToggle('fast');
	}
    });
    $('.styleLeftNavi1').mouseover(function(){
	$(this).css('cursor','pointer');
    });
    $("+ div" ,$('.styleLeftNavi1').parent()).hide();
    // ▲ アコーディオン非表示制御

    // ▼ アコーディオン非表示制御
    $('.slidevisibility').click(function(){
	if($("+ div",this).css("display")!="none"){
	    $("+ div",this).hide();
	}else{
	    $("+ div",this).slideToggle('fast');
	}
    });
    $('.slidevisibility').mouseover(function(){
	$(this).css('cursor','pointer');
    });
    $("+ div" ,'.slidevisibility').hide();
    // ▲ アコーディオン非表示制御
    // ###################################################
    // ▼ 画像拡大
    $('div.fancyzoom a').fancyZoom({
	scaleImg: true,
	closeOnClick: true
    });
    // ▲ 画像拡大
    // ▼生地選択チェックボックス制御
    $('a','.selectMaterial').click(function(){
	$('+ input:checkbox',this).attr('checked',true);
	if($('+ input:checkbox',this).attr('checked') == true){
	    // 違う画像がクリックされた場合ではない
	    // 背景色を変更
	    $('.selectMaterial').css('background','#ffffff');
	    $(this).parent().css('background','#ffc3c3');
	    // チェックを変更
	    $('a + input:checkbox','.selectMaterial').attr('checked',false);
	    $('+ input:checkbox',this).attr('checked',true);
	}

    });
    $('a + input:checkbox','.selectMaterial').click(function(){
	// 他のチェックボックスをuncheck
	$('a + input:checkbox','.selectMaterial').attr('checked',false);
	$(this).attr('checked',true);
	// 背景色を変更
	$('.selectMaterial').css('background','#ffffff');
	$(this).parent().css('background','#ffc3c3');
    });
    $('a','.selectMaterial').mouseover(function(){
	$(this).css('cursor','pointer');

    });
    $('a + input:checkbox','.selectMaterial').mouseover(function(){
	$(this).css('cursor','pointer');
    });
// ▲生地選択チェックボックス制御
});
// #######################################################
/**
 * 小窓を開く
 */
function openWindowCenter(url,windowname,width,height){
    // var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
    var features="location=no, menubar=no, status=no, scrollbars=no, resizable=yes, toolbar=no";
    if (width) {
	if (window.screen.width > width)
	    features+=", left="+(window.screen.width-width)/2;
	else width=window.screen.width;
	features+=", width="+width;
    }
    if (height) {
	if (window.screen.height > height)
	    features+=", top="+(window.screen.height-height)/2;
	else height=window.screen.height;
	features+=", height="+height;
    }
    window.open(url,windowname,features);
}

