
/*背景画像変更のちらつき解除*/
try { 
	document.execCommand('BackgroundImageCache', false, true); 
} catch(e) {} 

/*かみぼうスクリプトの追加*/
/*  $(document).ready(function(){
	var root = 'http://www.kai-p.co.jp/test/';
	var kami = 'about/';

	var kamiobj = '<div style="position:fixed;right:0; bottom:0;"><object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="220" height="160" style="position:relative;"><param name="movie" value="'+root+kami+'kamibou.swf" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="expressinstall" value="'+root+'Scripts/expressInstall.swf" /><param name="LOOP" value="false" /><!-- 次のオブジェクトタグは IE 以外のブラウザで使用するためのものです。IE では IECC を使用して非表示にします。 --><!--[if !IE]>--><object type="application/x-shockwave-flash" data="'+root+kami+'kamibou.swf" width="550" height="400" style="position:relative;"><!--<![endif]--><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="swfversion" value="6.0.65.0" /><param name="expressinstall" value="'+root+'Scripts/expressInstall.swf" /><param name="LOOP" value="false" /><!--[if !IE]>--></object><!--<![endif]--></object></div>';

    $("body").prepend();
  });
*/
  $(document).ready(function(){

	var root = 'http://www.kai-p.co.jp/';
	var kami = 'http://www.kai-p.co.jp/kamibo/';

	now = new Date();
	var v = (now.getSeconds()+1)%4+1;

	var com = '<div class="kamibo"><object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="235" height="160" style="position:relative;"><param name="movie" value="'+kami+'kamibou'+v+'.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="expressinstall" value="'+root+'Scripts/expressInstall.swf" /><param name="LOOP" value="false" /><!-- 次のオブジェクトタグは IE 以外のブラウザで使用するためのものです。IE では IECC を使用して非表示にします。 --><!--[if !IE]>--><object type="application/x-shockwave-flash" data="'+kami+'kamibou'+v+'.swf" width="235" height="160" style="position:relative;"><!--<![endif]--><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="swfversion" value="6.0.65.0" /><param name="expressinstall" value="'+root+'Scripts/expressInstall.swf" /><param name="LOOP" value="false" /><!--[if !IE]>--></object><!--<![endif]--></object></div>';
    
	if(document.URL == root+'rules/') {/*表示しないページ（何もしない）*/
	} else if(document.URL == root+'rules/index.html') {
	} else if(document.URL == root+'sitemap/') {
	} else if(document.URL == root+'sitemap/index.html') {
	} else if(document.URL == root+'policy/') {
	} else if(document.URL == root+'policy/index.html') {
	} else if(document.URL == root+'link/') {
	} else if(document.URL == root+'link/index.html') {
	} else if(document.URL == root+'inquiry/') {
	} else if(document.URL == root+'inquiry/index.html') {
	} else if(document.URL == root+'inquiry/form.cgi') {
	} else if(document.URL == root+'recruit/new_form.html') {
	} else if(document.URL == root+'recruit/new.cgi') {
	} else if(document.URL == root+'recruit/mid_form.html') {
	} else if(document.URL == root+'recruit/mid.cgi') {
	} else { /*上記以外では表示*/
		$("body").prepend(com);
	}
  });


/*ロールオーバーイメージ*/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*-----smartRollover--------------------------------------------------------------------*/
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

/*-----jCarouselLite1.01min---------------------------------------------------------------------*/
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);
