/*
 * Ext JS Library 2.2.1
 * Copyright(c) 2006-2009, Ext JS, LLC.
 * licensing@extjs.com
 *
 * http://extjs.com/license
 */
Ext.onReady(function(){
    //alert(location.pathname);
    //alert(location.pathname.split("/").length);
    
    //var pathCnt = location.pathname.split("/").length;
    var addPath = "";
    for (i = 0; i < location.pathname.split("/").length - 3; i++) {
		addPath = addPath + "../";
    }
    
    Ext.QuickTips.init();
    //    topInit();
    //		var header = Ext.get("header");
    //		var hoge = new Ext.Element("<div>aa</div>");
    //    header.appendChild(hoge);
    
    $("#footer").html("Copyright (C) 2000-2009 Piacere Yama, Inc. All Rights Reserved.");
    
    var menu = new Ext.menu.Menu({
        id: 'mainMenu',
        items: [{
            text: 'info',
            handler: function(){
            location.href = addPath + 'teamyama.html';
            }
            
            
        }, {
            text: 'blog',
            handler: function(){
window.location.target = "_blank";
            location.href = 'http://piacere-yama.cocolog-nifty.com/blog/';
            }
            
        }, {
            text: 'bbs',
            handler: function(){
window.location.target = "_blank";
            location.href = 'http://8709.teacup.com/teamyama/bbs';
            }
        }]
    });
    
    
    var tb = new Ext.Toolbar({
        id: 'bars',
        width: 750
    });
    tb.render('toolbar');
    
    tb.add({
        text: 'Top',
        handler: function(){
			location.href = addPath + 'index.html';
        }
    }, {
        text: 'greeting',
        handler: function(){
            location.href = addPath +  'greeting.html';
        }
    }, {
        text: 'Brand',
        handler: function(){
            location.href = addPath +  'brand.html';
        }
    }, {
        text: 'Team Yama',
						menu:menu
    }, {
        text: 'Access',
        handler: function(){
            location.href = addPath + 'access.html';
            
        }
    }, {
        text: 'Link',
        handler: function(){
            location.href = addPath + 'link.html';
        }
    });
    
    
});

function topInit(){


            var myPanel = new Ext.Panel({
                id: 'myPanel',
                title: 'shop info',
                width: 368,
                height: 150,
                renderTo: 'newsbox',
                contentEl: 'newscontents'
            
            });
            var myPanel2 = new Ext.Panel({
                id: 'myPanel2',
                title: 'team info',
                width: 368,
                height: 150,
                renderTo: 'teambox',
                contentEl: 'teamcontents'
            
            });
            var topimg = Ext.get('topimg');
            topimg.fadeIn({
                easing: 'easeIn',
                duration: 2
            });
 		
	
}


