/* ---------------------------------------------
  COP:MTG main scripts
------------------------------------------------
    File Name:	script.js
    Build:	2005/10/10
    Updated:	2010/01/13
    Author:	Wataru "Mr.Cid" Hosaka
--------------------------------------------- */

/* トップページ部分 */
	flag = false;
	function treemenu(tName) {
	    tMenu = document.getElementById(tName).style;
	    if (tMenu.display == 'none') tMenu.display = "block";
	    else tMenu.display = "none";
	}

/* Duel Information 部分 */
	function format(type,date) {
	    option="scrollbars=1,resizeable=0,width=630,height=480";
	    window.open("http://www.copmtg.net/material/format.php?type="+type+"&amp;date="+date+"&amp;popup=1",'format',option);
	}

/* MTG Materials 部分 */
	function cardtext(cardname) {
	    option="scrollbars=0,resizeable=0,width=630,height=320";
	    window.open("http://www.copmtg.net/material/cardlist/cardtext.php?cardname="+cardname,'cardtext',option);
	}

/* Text Storage 部分 */
	function sorting(expansion,packid) {
	    option="scrollbars=1,resizeable=0,width=630,height=600";
	    window.open("http://www.copmtg.net/text/sorting/"+expansion+".php?packid="+packid,'sorting',option);
	}

/* COP:MTG Mobile 部分 */
	function mobile_open() {
	    Wid = 300;
	    Hei = 360;
	    scrWid=screen.width;
	    scrHei=screen.height;
	    openX = ((scrWid/2) - (Wid/2));
	    openY = ((scrHei/2) - (Hei/2));

	    if (navigator.appName == "Microsoft Internet Explorer"){
		if (navigator.platform.substr(0,3) == "Mac"){
		    mainWin = window.open('http://www.copmtg.net/i/','Mobile','directories=0,menubar=0,location=0,scrollbars=1,status=0,width=' + Wid + ',height=' + Hei + ',left=' + openX + ',top=' + openY );
		}
		else {
		    mainWin = window.open('http://www.copmtg.net/i/','Mobile','directories=0,menubar=0,location=0,scrollbars=1,status=0,width=' + Wid + ',height=' + Hei + ',left=' + openX + ',top=' + openY );
		}
	    }
	    else {
		mainWin = window.open('http://www.copmtg.net/i/','Mobile','directories=0,menubar=0,location=0,scrollbars=1,status=0,width=' + Wid + ',height=' + Hei + ',screenX=' + openX + ',screenY=' + openY );
	    }
	}

/* And Etc... 部分 */
	function illusgallery(year,name) {
	    option="scrollbars=1,resizeable=0,width=630,height=600";
	    window.open(+year+"/"+name+".htm",'illus_gallery',option);
	}
