/*
 * general.js - for cyclops.co.jp
 * @requires jQuery v1.2.1
 *
 * Copyright (c) 2007 cyclops.co.,ltd.
 * $Date: 2007.12.25
 *
 */



/**
 *	Initialization
 */


$(document).ready(function(){
	$.cyc.init();
});


$.cyc = {
	init: function() {
		for (module in $.cyc) {
			if ($.cyc[module].init){
				$.cyc[module].init();
			}
		}
	}
};





/**
 *	lightBox
 */
$.cyc.lightBox = {
	init: function() {
		$('a[@rel*=lightbox]').lightBox({
			imageBlank: 'http://bermudavagabond.com/preview/images/lightbox-blank.gif',
			imageLoading: 'http://bermudavagabond.com/preview/images/lightbox-ico-loading.gif',
			imageBtnClose: 'http://bermudavagabond.com/preview/images/lightbox-btn-close.gif',
			imageBtnPrev: 'http://bermudavagabond.com/preview/images/lightbox-btn-prev.gif',
			imageBtnNext: 'http://bermudavagabond.com/preview/images/lightbox-btn-next.gif'
		});
	}
};

/**
 *	externalLinks (add target _blank)
 */
$.cyc.externalLinks = {
	init: function() {
		$('a[@rel=external]').attr("target","_blank");
	}
};


/**
 *	pagetop
 */
 $.cyc.pagetop = {
	init: function() {
		$('a[href*=#]').click(function() {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			&& location.hostname == this.hostname) {
			  var $target = $(this.hash);
			  $target = $target.length && $target
			  || $('[name=' + this.hash.slice(1) +']');
			  if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body')
				.animate({scrollTop: targetOffset}, 1000);
			   return false;
			  }
			}
		});	 
	 }
 };
 
 
 /**
 *	headerSWF
 */

$.cyc.headerSwfWrite = {
	init: function() {
		var bodyid = $('body').attr('id');
		var swfURL = '../movies/header.swf';
		if(bodyid=='toppage') swfURL = 'movies/header.swf';
		$('#headerSWF').flash(
			{ src: swfURL , width: '100%', height:150 ,wmode:'transparent'}, 
			 { version: '6.0.65' }
		);
		$('.alt').css("display","none");
	}
	
};
