

var url = location.href;
var ua = navigator.userAgent;
var path = "";
var page = "";
//_________________________________________________________
//                                           汎用関数

function setPath(num) {
	
	if(num == 0 || num == undefined) {
		path = "./";
	}else {
		for(i = 0; i < num; i++) {
			path += "../";
		}
	}
	
	getPageName(num);
	
	delete num;
	
}

function getPageName(num) {
	
	if(url.match("/concept/")) page = "concept";
	else if(url.match("/products/")) page = "products";
	else if(url.match("/topics/")) page = "topics";
	else if(url.match("/shop/")) page = "shop";
	else if(num == 0)  page = "home";
	
	delete num;
}

//_________________________________________________________
//                                           アクセス解析
document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');
function analytics() {
	_uacct = "UA-1491266-1";
	urchinTracker();
}

//_________________________________________________________
//                                           ヘッダメニュー

function attachHeaderNav(num) {
	var mainNav = new Array("logo", "btn1_off", "btn2_off", "btn3_off", "btn4_off", "btn5_off");
	
	if(url.match("/concept/")) mainNav[2] = "btn2_on";
	else if(url.match("/products/")) mainNav[3] = "btn3_on";
	else if(url.match("/topics/")) mainNav[4] = "btn4_on";
	else if(url.match("/shop/")) mainNav[5] = "btn5_on";
	else if(num == 0) mainNav[1] = "btn1_on";
	document.write('<a id="top" name="top"></a>');
	document.write('<ul>');
	document.write('<li><a href="' + path + 'index.html" alt="SUSIE N.Y." id="logo"><img src="' + path + 'common/' + mainNav[0] + '.gif" alt="SUSIE N.Y." id="logoimg" /></a></li>');
	document.write('<li><a href="' + path + 'index.html" alt="HOME" id="homebtn"><img src="' + path + 'common/' + mainNav[1] + '.gif" alt="Home" id="homeimg" /></a></li>');
	document.write('<li><a href="' + path + 'concept/index.html" alt="Brand Concept" id="conceptbtn"><img src="' + path + 'common/' + mainNav[2] + '.gif" alt="Brand Concept" id="conceptimg" /></a></li>');
	document.write('<li><a href="' + path + 'products/index.html" alt="Products" id="productsbtn"><img src="' + path + 'common/' + mainNav[3] + '.gif" alt="Products" id="productsimg" /></a></li>');
	document.write('<li><a href="http://susie.weblogs.jp/" alt="Beauty Topics" id="topicsbtn"><img src="' + path + 'common/' + mainNav[4] + '.gif" alt="Beauty Topics" id="topicsimg" /></a></li>');
	document.write('<li><a href="' + path + 'shop/index.html" alt="Shop List" id="shopbtn"><img src="' + path + 'common/' + mainNav[5] + '.gif" alt="Shop List" id="shopimg" /></a></li>');
	document.write('</ul>');
	
	delete num;
}

function attachFootNav(num) {
	var footNav = new Array("sub1_off", "sub2_off", "sub3_off", "sub4_off", "sub5_off");
	
	document.write('<ul>');
	document.write('<li><a href="' + path + 'expert/index.html"><img src="' + path + 'common/' + footNav[0] + '.gif" /></a></li>');
	document.write('<li><a href="' + path + 'mobile/index.html"><img src="' + path + 'common/' + footNav[1] + '.gif" /></a></li>');
	document.write('<li><a href="' + path + 'friends/index.php"><img src="' + path + 'common/' + footNav[2] + '.gif" /></a></li>');
	document.write('<li><a href="' + path + 'contact/index.html"><img src="' + path + 'common/' + footNav[3] + '.gif" /></a></li>');
	document.write('<li id="mailpop">');
	document.write('<a href="javascript:void(0);" onclick="mailFromPopup()"><img src="' + path + 'common/' + footNav[4] + '.gif" /></a>');
	document.write('<div id="mail-area">&nbsp;</div>');
	document.write('<div id="form-area">');
	document.write('<a href="javascript:void(0);" onclick="mailFormClose()" id="mailclose"><img src="' + path + 'common/mail_close.gif" /></a>');
	document.write('<iframe src="' + path + 'magazine/addaddress2.html" scrolling="no" frameborder="0" width="253" height="82"></iframe>');
	document.write('</div>')
	document.write('</li>');
	document.write('</ul>');
	
	delete num;
}

function attachFooter(num) {
	
	document.write('<img src="' + path + 'common/footer_copy.gif" alt="(C)Copyright2008 ISEHAN Co.,Ltd All right reserved." width="350" height="13" id="copy" />');
	document.write('<ul>');
	document.write('<li><a href="' + path + 'privacy/index.html"  id="privacybtn"><img src="' + path + 'common/footer_privacy_off.gif" alt="Privacy Policy" width="96" height="13" id="privacyimg" /></a></li>');
	document.write('<li><a href="' + path + 'terms/index.html" id="termsbtn"><img src="' + path + 'common/footer_terms_off.gif" alt="Privacy Policy" id="termsimg" /></a></li>');
	document.write('</ul>');
	
	analytics();
	
	delete num;
}

//_______________________________________________________________________
//                                           メールマガジン　ポップアップ

function mailFromPopup() {
	
	var id = "mail-area";
	var id2 = "form-area";
	
	if(document.getElementById) {
		document.getElementById(id).style.display = "block";
		document.getElementById(id2).style.display = "block";
	}else if(document.all) {
		document.all.id.style.display = "block";
		document.all.id2.style.display = "block";	}
	
}

function mailFormClose() {
	
	var id = "mail-area";
	var id2 = "form-area";
	
	if(document.getElementById) {
		document.getElementById(id).style.display = "none";
		document.getElementById(id2).style.display = "none";
	}else if(document.all) {
		document.all.id.style.display = "none";
		document.all.id2.style.display = "none";
	}
}


//_________________________________________________________________
//                                           ニュース成分表オープン
function news_el_winOpen(theURL) { //v2.0
	var winName = "newselement";
	var features = "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=352,height=355";
	window.open(theURL,winName,features);
}

//_________________________________________________________
//                                           ロールオーバー
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_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];}
}
//_____________________________________________________
//                                     画像のプリロード
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];}}
}

//_________________________________________________________________
//                                                  EVENT LISTENERS

// イメージのプリロード
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/btn1_on.gif"));
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/btn2_on.gif"));
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/btn3_on.gif"));
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/btn4_on.gif"));
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/btn5_on.gif"));
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/footer_privacy_on.gif"));
YAHOO.util.Event.addListener(window, "load", MM_preloadImages(path + "common/footer_terms_on.gif"));

// イメージのオンマウス
YAHOO.util.Event.addListener("homebtn", "mouseover", function() {MM_swapImage("homeimg","",path + "common/btn1_on.gif",1)});
YAHOO.util.Event.addListener("conceptbtn", "mouseover", function() {MM_swapImage("conceptimg","",path + "common/btn2_on.gif",1)});
YAHOO.util.Event.addListener("productsbtn", "mouseover", function() {MM_swapImage("productsimg","",path + "common/btn3_on.gif",1)});
YAHOO.util.Event.addListener("topicsbtn", "mouseover", function() {MM_swapImage("topicsimg","",path + "common/btn4_on.gif",1)});
YAHOO.util.Event.addListener("shopbtn", "mouseover", function() {MM_swapImage("shopimg","",path + "common/btn5_on.gif",1)});
YAHOO.util.Event.addListener("privacybtn", "mouseover", function() {MM_swapImage("privacyimg","",path +"common/footer_privacy_on.gif",1)});
YAHOO.util.Event.addListener("termsbtn", "mouseover", function() {MM_swapImage("termsimg","",path + "common/footer_terms_on.gif",1)});

// イメージのロールアウト
YAHOO.util.Event.addListener("homebtn", "mouseout", function() {MM_swapImgRestore()});
YAHOO.util.Event.addListener("conceptbtn", "mouseout", function() {MM_swapImgRestore()});
YAHOO.util.Event.addListener("productsbtn", "mouseout", function() {MM_swapImgRestore()});
YAHOO.util.Event.addListener("topicsbtn", "mouseout", function() {MM_swapImgRestore()});
YAHOO.util.Event.addListener("shopbtn", "mouseout", function() {MM_swapImgRestore()});
YAHOO.util.Event.addListener("privacybtn", "mouseout", function() {MM_swapImgRestore()});
YAHOO.util.Event.addListener("termsbtn", "mouseout", function() {MM_swapImgRestore()});




