/**********************************************************************
WWCITY  : [ index.js ]

07.08.03
***********************************************************************
a variable :
	cmxxx     -> 定数
	gInd_xxx  -> グローバル変数
	gItemArys -> アイテムリスト表示用の変数
a function :
	- index_getExtrText()
**********************************************************************/


/*---------------------------------------------
 Path
---------------------------------------------*/
var gInd_strImgPath = '/index/img';
var gInd_strJsPath  = '/index/js';
var gInd_strSysPath = '/index/system';

/*---------------------------------------------
 Javascript file
---------------------------------------------*/
with(document) {

	// MainArea
	write('<script type="text/javascript" src="/common/static/index_shoplist.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_search.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_flash.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_brand.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_recommend.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_area.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_guide.js"></script>');
/*
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_event.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_item_search.js"></script>');
*/
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_pickup.js"></script>');

	// SideArea
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_member.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_whats.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_info.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_blog.js"></script>');
	write('<script type="text/javascript" src="' + gInd_strJsPath + '/index_link.js"></script>');
}


/*=============================================
 index_getExtrText()
=============================================*/
function index_getExtrText(vstrText, vintlmt){
	// vstrText : 取得テキスト ／ vintlmt : 表示制限文字数
	var intCnt = 0;
	var blnLmt = false;
	var i;
	var strEnc ='';
	var strExtrText = '';

	var intlmt = vintlmt * 2 - 1;  // 表示制限byte

	for (var i=0; i<vstrText.length; i++){
		if (intCnt >= intlmt){  // 表示制限byte数以上なら
			blnLmt = true; break;
		}
		strEnc = escape(vstrText.charAt(i));  // 抜き出した1文字をエスケープ文字に変換
		if (strEnc.length < 4){
			intCnt += 1;
		} else {
			intCnt += 2;
		}
		strExtrText += strEnc;
	}

	strExtrText = unescape(strExtrText);  // 文字列をエスケープ文字から変換
	if (blnLmt == true){  // 表示制限文字数以上なら
		strExtrText += '…';
	}
	return strExtrText;
}


/*=============================================
 index_imageOver()
=============================================*/
function index_imageOver(vstrName,vstrPath) {
	if(document.images[vstrName].src.indexOf("_ac") == -1){
		document.images[vstrName].src = vstrPath;
	}
}

/*=============================================
 index_imageLoad()
=============================================*/
function index_imageLoad() {
	var aobjImg = new Array();
	var i;
	for (i = 0; i < index_imageLoad.arguments.length; i ++) {
		aobjImg[i] = new Image();
		aobjImg[i].src = index_imageLoad.arguments[i];
		//document.write('<img src="' + aobjImg[i].src + '"><br>');
	}
}

/*=============================================
 index_imageLoad()
=============================================*/
function index_bookmark() {
	//yahoo
	document.writeln('<a href="javascript:void window.open(\'http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t=\'+encodeURIComponent(document.title)+\'&amp;u=\'+encodeURIComponent(window.location.href)+\'&amp;opener=bm&amp;ei=UTF-8\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_yahoo.gif" alt="Yahoo!ブックマークに登録" width="16" height="16" border="0"></a>');
	//はてな
	document.writeln('<a href="javascript:void window.open(\'http://b.hatena.ne.jp/append?\'+encodeURIComponent(window.location.href)+\'&amp;opener=bm&amp;ei=UTF-8\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_hatena.gif" alt="この記事をはてなブックマークに登録" width="16" height="16" border="0"></a>');
	//Buzzurl
	document.writeln('<a href="javascript:void window.open(\'http://buzzurl.jp/config/add/confirm?url=\'+encodeURIComponent(window.location.href)+\'&amp;opener=bm&amp;ei=UTF-8\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_buzzurl.gif" alt="この記事を Buzzurl に登録" width="16" height="16" border="0"></a>');
	//livedoor
	document.writeln('<a href="javascript:void window.open(\'http://clip.livedoor.com/clip/add?link=\'+encodeURIComponent(window.location.href)+\'&amp;jump=myclip&amp;ei=UTF-8&amp;title=\'+encodeURIComponent(document.title)+\'\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_livedoor.gif" alt="この記事を livedoor クリップに登録" width="16" height="16" border="0"></a>');
	//del.icio.us
	document.writeln('<a href="javascript:void window.open(\'http://del.icio.us/post?title=\'+encodeURIComponent(document.title)+\'&amp;url=\'+encodeURIComponent(window.location.href)+\'\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_delicious.gif" alt="この記事を del.icio.us に登録" width="16" height="16" border="0"></a>');
	//Google
	document.writeln('<a href="javascript:void window.open(\'http://www.google.com/bookmarks/mark?op=edit&output=popup&title=\'+encodeURIComponent(document.title)+\'&amp;bkmk=\'+encodeURIComponent(window.location.href)+\'\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_google.gif" alt="この記事をGoogleBookmark に追加" width="16" height="16" border="0"></a>');
	//nifty
	document.writeln('<a href="javascript:void window.open(\'http://clip.nifty.com/create?title=\'+encodeURIComponent(document.title)+\'&amp;url=\'+encodeURIComponent(window.location.href)+\'\',\'popup\',\'width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=1,left=100,top=50\',0);"><img src="/index/img/icn_nifty.gif" alt="niftyクリップに追加" title="niftyクリップに追加" width="16" height="16" border="0"></a>');
}

/*********************************************************************/

