/*----------PATH COMMON START----------*/
var pathVars = window.location.href;
var fileVars = pathVars.substring(path.lastIndexOf('/',pathVars.length)+1,pathVars.length);
var linkPath;
//
if ((fileVars == "index.php")||(fileVars == "sitemap.html")||(fileVars == "")){
		linkPath = "";
}else{
		linkPath = "../";
}
/*----------PATH COMMON END----------*/

/*NAVIGATION MENU START---------------------------------*/
function HeaderMenu(){
var htmlTxt="";
htmlTxt+='<h1><a href="'+linkPath+'index.php" title="QBIST"><img src="'+linkPath+'img/common/main_logo.gif" alt="QBIST" width="180" height="51" /></a></h1>';
htmlTxt+='<div id="officialbox"><img src="'+linkPath+'img/common/main_logo_ward.gif" alt="キュービスト公式ホームページ" width="212" height="13" /></div>';
htmlTxt+='<div id="searchbox">';
htmlTxt+='<div id="searchtitle"><img src="'+linkPath+'img/common/serach_img.gif" alt="サイト内検索" width="82" height="18" /></div>';
htmlTxt+='<form action="'+linkPath+'search/site_search.php" method="post">';
htmlTxt+='<input name="searchtext" type="text" id="searchtext" value="" />';
htmlTxt+='<input type="image" id="searchbtn" src="'+linkPath+'img/common/btn_serach.gif" alt="検索" value="検索" />';
htmlTxt+='</form>';
htmlTxt+='</div>';
$('#header').html(htmlTxt);
}
$(document).ready(HeaderMenu);
/*NAVIGATION MENU START---------------------------------*/

/*NAVIGATION MENU START---------------------------------*/
function NaviMenu(){
var htmlTxt="";
htmlTxt+='<ul>';
if((fileVars.indexOf("index")!=-1)||(fileVars=="")){
htmlTxt+='<li><a href="'+linkPath+'index.php" title="TOP"><img src="'+linkPath+'img/common/btn_top_on.gif" alt="TOP" width="158" height="30" /></a></li>';
}else{
htmlTxt+='<li><a href="'+linkPath+'index.php" title="TOP"><img src="'+linkPath+'img/common/btn_top.gif" alt="TOP" width="158" height="30" class="over" /></a></li>';	
}

if(fileVars.indexOf("company")!=-1){
htmlTxt+='<li><a href="'+linkPath+'company/company_philosophy.html" title="会社案内"><img src="'+linkPath+'img/common/btn_company_on.gif" alt="会社案内" width="158" height="30" /></a></li>';
}else{
htmlTxt+='<li><a href="'+linkPath+'company/company_philosophy.html" title="会社案内"><img src="'+linkPath+'img/common/btn_company.gif" alt="会社案内" width="158" height="30" class="over" /></a></li>';
}
/*
if(fileVars.indexOf("business")!=-1){
htmlTxt+='<li><a href="'+linkPath+'business/business_books.html" title="業務のご案内"><img src="'+linkPath+'img/common/btn_business_on.gif" alt="業務のご案内" width="158" height="30" /></a></li>';
}else{
htmlTxt+='<li><a href="'+linkPath+'business/business_books.html" title="業務のご案内"><img src="'+linkPath+'img/common/btn_business.gif" alt="業務のご案内" width="158" height="30" class="over" /></a></li>';
}
*/
if(fileVars.indexOf("works")!=-1){
htmlTxt+='<li><a href="'+linkPath+'works/works_new_list.php" title="制作物の紹介"><img src="'+linkPath+'img/common/btn_works_on.gif" alt="制作物の紹介" width="158" height="30" /></a></li>';
}else{
htmlTxt+='<li><a href="'+linkPath+'works/works_new_list.php" title="制作物の紹介"><img src="'+linkPath+'img/common/btn_works.gif" alt="制作物の紹介" width="158" height="30" class="over" /></a></li>';
}

if(fileVars.indexOf("resruit")!=-1){
htmlTxt+='<li><a href="'+linkPath+'recruit/resruit_jobs.html" title="スタッフ募集"><img src="'+linkPath+'img/common/btn_recruit_on.gif" alt="スタッフ募集" width="158" height="30" /></a></li>';
}else{
htmlTxt+='<li><a href="'+linkPath+'recruit/resruit_jobs.html" title="スタッフ募集"><img src="'+linkPath+'img/common/btn_recruit.gif" alt="スタッフ募集" width="158" height="30" class="over" /></a></li>';
}

htmlTxt+='</ul>';
$('#globalnavi').html(htmlTxt);
}
$(document).ready(NaviMenu);
/*NAVIGATION MENU END---------------------------------*/

/*SPECIAL MENU START---------------------------------*/
function SpecialMenu(){
var htmlTxt="";
htmlTxt+='<ul>';
htmlTxt+='<li><a href="http://bngb.qbist.co.jp/pc/index.html" target="_blank" title="バンダイナムコゲームスブックス公式サイト"><img src="'+linkPath+'img/common/special_banner/special_bngb.gif" alt="バンダイナムコゲームスブックス公式サイト" width="148" height="78" /></a></li>';
htmlTxt+='<li><a href="http://www.qcom.jp/" target="_blank" title="株式会社 キューコム"><img src="'+linkPath+'img/common/special_banner/banner_qcom.gif" alt="株式会社 キューコム" width="148" height="78" /></a></li>';
htmlTxt+='</ul>';
$('#specialmenu').html(htmlTxt);
}
$(document).ready(SpecialMenu);
/*SPECIAL MENU END---------------------------------*/

/*FOOTER MENU START---------------------------------*/
function FooterMenu(){
var htmlTxt="";
htmlTxt+='<ul>';
htmlTxt+='<li id="btnsitemap"><a href="'+linkPath+'sitemap.html">サイトマップ</a></li>';
htmlTxt+='<li id="btnabout"><a href="'+linkPath+'info/info_about.html">このサイトについて</a></li>';
htmlTxt+='<li id="btnprivacy"><a href="'+linkPath+'info/info_privacy.html">プライバシーポリシー</a></li>';
htmlTxt+='<li id="btncontact"><a href="'+linkPath+'info/info_inquiry.html">お問い合わせ</a></li>';
htmlTxt+='</ul>';
htmlTxt+='<div id="btnrss"><a href="'+linkPath+'gen_rss.php/" title="RSS配信"><img src="'+linkPath+'img/common/btn_rss.gif" alt="RSS配信" width="90" height="26" /></a></div>';
htmlTxt+='<div id="copyright"><p>Copyright 2008 &copy; QBIST Inc. All Rights Reserved.</p></div>';
$('#footerin').html(htmlTxt);
}
$(document).ready(FooterMenu);
/*FOOTER MENU START---------------------------------*/

/*FLASH LOAD START---------------------------------*/
function FlashLoad(){
		var so = new SWFObject("img/top/qbist_top.swf", "flashdata", "614", "346", "9", "#ffffff");
		so.addParam("menu", "false");
		so.addParam("wmode", "transparent");
		//so.addVariable("flashVarText", "this is passed in via FlashVars for example only");	
		so.write("flashcontent");
		
		var htmlData=$('#flashcontent noscript').text();
		$('#flashcontent noscript').replaceWith(htmlData);
}
/*FLASH LOAD START---------------------------------*/
 
/*SEARCH FORM DEFAULT START---------------------------------*/
$(document).ready(function(){
var VarsText="検索したい文字を入力";
//var VarsText="\u691c\u7d22\u3057\u305f\u3044\u6587\u5b57\u3092\u5165\u529b"
$('#searchtext:text').val(VarsText);
$('#searchtext:text').focus(
	function(){
		if($(this).val()==VarsText){
		$(this).val('');
		}
	}).blur(
		function(){
		if($(this).val()==''){
		$(this).val(VarsText);
		}
	});
});
/*SEARCH FORM DEFAULT END---------------------------------*/

/*MAIN MENU HEIGHT SET START---------------------------------*/
function heightSet(){
var varsMenu=643;
var varsMain=$('#mainbox').height();
//
if(varsMenu<varsMain){
		$('#menubox').height($('#mainbox').height()-4);
		$('#specialbox').height($('#menubox').height()-363);
}else{
		$('#menubox').height(varsMenu);
		$('#specialbox').height(varsMenu-363);
		$('#nextframe').height(varsMenu-10);
}
}
/*MAIN MENU HEIGHT SET END---------------------------------*/

/*WORKS HEIGHT SET START---------------------------------*/
function WorksheightSet(){
$('table.workslistleft:eq(0) th,table.workslistright:eq(0) th').flatHeights();
$('table.workslistleft:eq(1) th,table.workslistright:eq(1) th').flatHeights();
$('table.workslistleft:eq(2) th,table.workslistright:eq(2) th').flatHeights();
$('table.workslistleft:eq(3) th,table.workslistright:eq(3) th').flatHeights();
$('table.workslistleft:eq(4) th,table.workslistright:eq(4) th').flatHeights();
}
$(document).ready(WorksheightSet);
/*WORKS HEIGHT SET END---------------------------------*/

/*PAGE TOP SMOOTH SCROLL START---------------------------------*/
function TopScroll(){
$('.pagetopbtn a').click(function(){
var top=$();
var varscrolTop=top.attr('scrollTop');
if (varscrolTop!=0){
$().scrollTo('#pagetop',{duration:1000,easing:'swing'});
return false;
}
});
}
$(document).ready(TopScroll);
/*PAGE TOP SMOOTH SCROLL END---------------------------------*/

/*NEW WINDOW START---------------------------------*/
function OpenWindow(theURL,winName,features) {
var winop = window.open(theURL,winName,features);
winop.focus();
void(0);
}
/*NEW WINDOW START---------------------------------*/

/*------------------------------------------------------------------------------------------------*/
/*TOP DATA COLOR SET START---------------------------------*/
$(document).ready(function(){
$('#schedulebox table tbody tr:odd').css('backgroundColor','#eaead0');
});
/*TOP DATA COLOR SET END---------------------------------*/

/*COMPANY OUTLINE SET START---------------------------------*/
function DispOutline(selectvars){
	var SetAlpha=selectvars;
	$('#domoutline div[id^=domdisp]').css('display','none');
	if(SetAlpha!=undefined){
	$('#domoutline #domdisp'+SetAlpha).fadeIn('slow').css('display','block');
	}
}
$(document).ready(function(){
$('#domoutline #dombtna a').hover(function(){DispOutline('a');},function(){DispOutline();});
$('#domoutline #dombtnb a').hover(function(){DispOutline('b');},function(){DispOutline();});
$('#domoutline #dombtnc a').hover(function(){DispOutline('c');},function(){DispOutline();});
$('#domoutline #dombtnd a').hover(function(){DispOutline('d');},function(){DispOutline();});
$('#domoutline #dombtne a').hover(function(){DispOutline('e');},function(){DispOutline();});
$('#domoutline #dombtnf a').hover(function(){DispOutline('f');},function(){DispOutline();});
$('#domoutline #dombtng a').hover(function(){DispOutline('g');},function(){DispOutline();});
$('#domoutline #dombtnh a').hover(function(){DispOutline('h');},function(){DispOutline();});
$('#domoutline #dombtni a').hover(function(){DispOutline('i');},function(){DispOutline();});
$('#domoutline #dombtnj a').hover(function(){DispOutline('j');},function(){DispOutline();});
});
/*COMPANY OUTLINE SET END---------------------------------*/

/*PAGE NEXT SMOOTH SCROLL START---------------------------------*/
function AboutScroll(){
$('#nextframe a[href^=#]').click(function(){
var varAnchor=$(this).attr('href');
$().scrollTo(varAnchor,{duration:1000});
return false;
});
}
$(document).ready(AboutScroll);
/*PAGE TOP SMOOTH SCROLL END---------------------------------*/

/*WORKS LIST ROLLOVER START---------------------------------*/
function RollOverList(){
	var image = new Image();
	image.src= linkPath + 'img/works/works_list_on.gif';
$('.workslistleft a,.workslistright a').hover(
	function(){$(this).parent().parent().parent().parent().css({'background-image':'url('+linkPath+'img/works/works_list_on.gif)','background-position':'center top'});},
	function(){$(this).parent().parent().parent().parent().css({'background-image':'url('+linkPath+'img/works/works_list.gif)','background-position':'center bottom'});}
	);
}
$(document).ready(RollOverList);
/*WORKS LIST ROLLOVER START---------------------------------*/

/*WORKS AMAZON START---------------------------------*/
function AmazonBtnChange(){
	var AmazonBtn=$('img[src=../img/buy-from-tan.gif]');
	$(AmazonBtn).attr('src','../img/common/btn_amazon.gif')
				.attr('class','over');
	/*src:"../img/common/btn_amazon.gif",
    alt:"amazonで買う",
	width:"121",
	height:"22",
	class:"over"
	});*/
	$(AmazonBtn).parent().addClass('amazonlink');
}
$(document).ready(AmazonBtnChange);													
/*WORKS AMAZON END---------------------------------*/

/*ROLLOVER START---------------------------------*/
function rollOverImages() {
  var image_cache = new Object();
  $("img.over").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}
$(document).ready(rollOverImages);
/*ROLLOVER END---------------------------------*/

/*pngfix start---------------------------------*/
$(document).ready(function(){
$(document).pngFix();
});
/*pngfix end---------------------------------*/
