(function($){
$(function(){
	
	var o1 = new $.overlay({
		click_close: false
	});

	var o2 = new $.overlay({
		click_close: false
	});

	var o3 = new $.overlay({
		click_close: false
	});
	
	var o4 = new $.overlay({
		click_close: false
	});
	
	var pageSize = $.overlay.pageSize;
	var $block = $('<div style="z-index:5;"></div>')
		.append('<p class="o-title">お探しなのは<span>製品・サービスについて</span></p>')
		.append('<p class="o-btn"><a href="javascript:;" id="o1_close"><img src="images/over-btn.gif" alt="閉じる" width="54" height="19"></a></p>')
		.append('<div class="o-list"><table><tr><td class="o-li1">サービスの詳しい情報</td><td class="o-li2">・・・</td><td class="o-li3"><a href="service/index.html">「サービス」トップ</a></td></tr><tr><td class="o-li1">サービスに関する質問</td><td class="o-li2">・・・</td><td class="o-li3"><a href="contact.html">「お問い合わせ」</a></td></tr></table></div>')
		.css({
			  position: 'absolute'
			, width: 558
			, height: 228
			, top: (pageSize[3] - 200) / 2 + $(window).scrollTop()
			, left: (pageSize[2] - 500) / 2
		});

	var $block2 = $('<div style="z-index:5;"></div>')
		.append('<p class="o-title">お探しなのは<span>会社情報について</span></p>')
		.append('<p class="o-btn"><a href="javascript:;" id="o2_close"><img src="images/over-btn.gif" alt="閉じる" width="54" height="19"></a></p>')
		.append('<div class="o-list"><table><tr><td class="o-li1">当社事業所へのアクセス</td><td class="o-li2">・・・</td><td class="o-li3"><a href="corporate/access.html">「アクセス」</a></td></tr></table></div>')
		.css({
			  position: 'absolute'
			, width: 558
			, height: 228
			, top: (pageSize[3] - 200) / 2 + $(window).scrollTop()
			, left: (pageSize[2] - 500) / 2
		});

	var $block3 = $('<div style="z-index:5;"></div>')
		.append('<p class="o-title">お探しなのは<span>採用について</span></p>')
		.append('<p class="o-btn"><a href="javascript:;" id="o3_close"><img src="images/over-btn.gif" alt="閉じる" width="54" height="19"></a></p>')
		.append('<div class="o-list"><table><tr><td class="o-li1">当社の事業内容</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/business01.html" target="_blank">採用サイト「ビジネスモデル」</a></td></tr><tr><td class="o-li1">現在の募集状況（新卒）</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/info01.html" target="_blank">採用サイト「募集要項（新卒採用）」</a></td></tr><tr><td class="o-li1">現在の募集状況（キャリア）</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/info02.html" target="_blank">採用サイト「募集要項（キャリア採用）」</a></td></tr><tr><td class="o-li1">採用エントリーしたい</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/info01.html" target="_blank">新卒採用</a><a href="http://www.workssol-r.com/info02.html" target="_blank" class="o-ml">キャリア採用</a></td></tr><tr><td class="o-li1">福利厚生・待遇について</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/info05.html" target="_blank">採用サイト「福利厚生」</a></td></tr><tr><td class="o-li1">社内風土について</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/culture.html" target="_blank">採用サイト「カルチャー」</a></td></tr><tr><td class="o-li1">先輩社員の声</td><td class="o-li2">・・・</td><td class="o-li3"><a href="http://www.workssol-r.com/introduction.html" target="_blank">採用サイト「仕事紹介」</a></td></tr></table></div>')
		.css({
			  position: 'absolute'
			, width: 558
			, height: 228
			, top: (pageSize[3] - 200) / 2 + $(window).scrollTop()
			, left: (pageSize[2] - 500) / 2
		});
		
		var $block4 = $('<div style="z-index:5;"></div>')
		.append('<p class="o-title">お探しなのは<span>その他</span></p>')
		.append('<p class="o-btn"><a href="javascript:;" id="o4_close"><img src="images/over-btn.gif" alt="閉じる" width="54" height="19"></a></p>')
		.append('<div class="o-list"><table><tr><td class="o-li1">協業・提携に関して</td><td class="o-li2">・・・</td><td class="o-li3"><a href="contact.html">お問い合わせください</a></td></tr><tr><td class="o-li1">個人情報の取り扱いに関する情報</td><td class="o-li2">・・・</td><td class="o-li3"><a href="privacy.html">「プライバシーポリシー」</a></td></tr></table></div>')
		.css({
			  position: 'absolute'
			, width: 558
			, height: 228
			, top: (pageSize[3] - 200) / 2 + $(window).scrollTop()
			, left: (pageSize[2] - 500) / 2
		});

	o1.$obj.after($block.hide());
	$('#o1_close')
		.click(function(){
			$block.hide();
			o1.close();
			document.pulldownform.pulldownmenu.options[0].selected= true;	
		});

	o2.$obj.after($block2.hide());
	$('#o2_close')
		.click(function(){
			$block2.hide();
			o2.close();
			document.pulldownform.pulldownmenu.options[0].selected= true;	
		});

	o3.$obj.after($block3.hide());
	$('#o3_close')
		.click(function(){
			$block3.hide();
			o3.close();
			document.pulldownform.pulldownmenu.options[0].selected= true;	
		});
		
	o4.$obj.after($block4.hide());
	$('#o4_close')
		.click(function(){
			$block4.hide();
			o4.close();
			document.pulldownform.pulldownmenu.options[0].selected= true;	
		});

	$(window)
		.resize(function(){
			var pageSize = $.overlay.pageSize;
			$block
				.css({
					  top: (pageSize[3] - 200) / 2 + $(window).scrollTop()
					, left: (pageSize[2] - 500) / 2
				});
		})
		.scroll(function(){
			var pageSize = $.overlay.pageSize;
			$block
				.css({
					  top: (pageSize[3] - 200) / 2 + $(window).scrollTop()
				});
		});


	$('#selector1').change(menu_pulldown);

function menu_pulldown(menu_pulldownhpurl) 
{ 
	
	if (menu_pulldownhpurl != "" ){
		if (document.pulldownform.pulldownmenu.selectedIndex=="1"){
			o1.open(function(){$block.show();});
		}
		else if (document.pulldownform.pulldownmenu.selectedIndex=="2"){
			o2.open(function(){$block2.show();});
		}
		else if (document.pulldownform.pulldownmenu.selectedIndex=="3"){
			o3.open(function(){$block3.show();});
		}
		else if (document.pulldownform.pulldownmenu.selectedIndex=="4"){
			o4.open(function(){$block4.show();});
		}
	}
} 
	
});
})(jQuery);