
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
   }

function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}

function checkAll(e, itemName)
{
	var aa = document.getElementsByName(itemName);
	for (var i=0; i<aa.length; i++){
	aa[i].checked = e.checked;
	if(e.checked){
		aa[i].parentNode.parentNode.style.background = '#ffffeb';
	}
	else{aa[i].parentNode.parentNode.style.background = '';}
	}
}
function isCheckT(obj){
	a = obj.parentNode.parentNode;
   if(obj.checked){
	a.style.background = '#ffffeb';
	}else{
	a.style.background = '';
	}
}


$(document).ready(function(){ 

$("#shrink dt:first").addClass("active"); 
$("#shrink dd:not(:first)").hide(); 
$("#shrink dt").click(function(){ 
$(this).next("dd").slideToggle("slow") 
//.siblings("p:visible").slideUp("slow"); 
$(this).toggleClass("active"); 
//$(this).siblings("h3").removeClass("active"); 
}); 
$("#gallery_output img").not(":first").hide();

			$("#gallery_nav a").click(function() {
				if ( $("#" + this.rel).is(":hidden") ) {
					$("#gallery_output img").slideUp();
					$("#" + this.rel).slideDown();
				}
			});
   $('#shrink_faq').find('dt').click(function() {
   //   alert($(this).next().html());
     $(this).next().slideToggle("slow");
	 
   });
});


//$(document).ready(function() {
//			$("#gallery_outputcc img").not(":first").hide();
//
//			$("#gallery_navcc a").click(function() {
//				if ( $("#" + this.rel).is(":hidden") ) {
//					$("#gallery_outputcc img").slideUp();
//					$("#" + this.rel).slideDown();
//				}
//			});
//		});

		
var left;
$().ready(function(){
    left = parseInt($("#scroll_list").css("left"));
    $(".btn").click(function(){
        move(this.id);
    });
    
});

function move(sign)
{
    var tleft = left;
    switch(sign)
    {
        case "left":
        {
            var len = $("#scroll_list li").length * 129;
            if((len - Math.abs(left)) > 646)
            {
                tleft -= 645;
            }
            else
            {
                tleft = left;
            }
            break;
        }
        case "right":
        {
            if (left == 0)
            {
                tleft = 0;
            }
            else
            {
                tleft += 645;
            }
            break;
        }
    }
    
    if ((tleft - left) != 0)
    {
        $("#scroll_list").animate({
            left:tleft + "px"
        },1000,function(){
            left = tleft;
            
        });
    }
    
}

$(function(){
	 $('#closeCon').click(function(){ $('#ShowSendInquiry').hide('slow'); });   
     $("#checkbox input[name=boxlist]").click(function(){
		 if(this.checked){
		 	var x,y;     
			oRect = this.getBoundingClientRect();     
			x=oRect.left;
			y=this.getBoundingClientRect().top+document.documentElement.scrollTop+document.body.scrollTop;  
			x= x-8;
			y= y-58;
			$('#ShowSendInquiry').css('top',y);  
			$('#ShowSendInquiry').css('left',x);  
			$('#ShowSendInquiry').show('slow');  
		 }else{
			 if(!mycheckbox()){
				$('#ShowSendInquiry').hide('slow'); 
			 }else{
				 $("input[name='boxlist']:checked").each(function(obj){
					var x,y;     
					oRect = this.getBoundingClientRect();     
					x=oRect.left;
					y=this.getBoundingClientRect().top+document.documentElement.scrollTop+document.body.scrollTop;  
					x= x-8;
					y= y-58;
					$('#ShowSendInquiry').css('top',y);  
					$('#ShowSendInquiry').css('left',x);  
					$('#ShowSendInquiry').show('slow');  
				 }); 
			 }
		 }
	 });
	 
function mycheckbox() { 
	var falg = 0; 
	$("input[name=boxlist]:checkbox").each(function () { 
	if ($(this).attr("checked")) { 
	falg += 1; 
	} 
	}) 
	if (falg > 0) 
		return true; 
	else 
		return false; 
} 
 
});  
