jQuery(function(){
	
	thisURL = document.URL
	pd = thisURL.indexOf("send-inquiry.html")
	
	var $pHight = 0
	
	function ttClientHeight(){
        return document.documentElement.clientHeight;
    }
	
	function ttScrollTop(){
        return document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;	
    }
		
	function topnow()	
	{if(pd !== -1){
		jQuery("#newnotice").hide()
	}
	
	document.getElementById("newnotice").style.top = ttScrollTop()+ttClientHeight() - jQuery("#newnotice").height()+"px";
	}
	
	jQuery(window).scroll(function(){
								b=jQuery("body").height();
								c=ttScrollTop();
								d=ttClientHeight();
								if(c<=(b-d))
								topnow();
								else
								c = b-d;
								});
	
    jQuery(window).load(function(){
		jQuery("#inquiryframe").hide();
        jQuery("#newnotice").slideDown("slow");
		topnow();

    })

    jQuery("label[id=tomin]").click(function(){
		jQuery("#noticetip").show();
		jQuery("#inquiryframe").hide();
		jQuery("#newnotice").animate({width:"160px"},"fast",function(){topnow()});
		
	})
        
    jQuery("label[id=toclose]").click(function(){
        jQuery("div[id=newnotice]").hide();
		topnow();
    })
	
	jQuery("#noticetip,#tomax").click(function(){
		jQuery("#noticetip").hide();
		jQuery("#newnotice").animate({width:"100%"},"fast");
		jQuery("#noticecon").slideDown();		
		jQuery("#inquiryframe").show();
		topnow();
	})
})