window.onload = function(){ classSubwin(); classParentlink();}/*==========================================================================================例）横幅1000px 縦幅500pxのサブウィンドウでひらく<a href="http://www.whatnoise.org/main.html" class="subwin" width="1000" height="500" wname="test" scroll="yes">ひらーけひらーけ</a>==========================================================================================*/function classSubwin() { this.classs = document.getElementsByClassName("subwin"); for(i=0;i<this.classs.length;i++){ this.href = this.classs[i].getAttribute("href"); this.wsize = this.classs[i].getAttribute("width"); this.hsize = this.classs[i].getAttribute("height"); this.wname = this.classs[i].getAttribute("wname"); this.scrollflg = this.classs[i].getAttribute("scroll"); this.openTyp = this.classs[i].getAttribute("target");  if( !this.wsize ) this.wsize = 500; if( !this.hsize ) this.hsize = 400; if( !this.scrollflg ) this.scrollflg = "yes"; if( !this.openTyp | this.openTyp == "_blank" ) this.classs[i].setAttribute("target", "_self");  this.classs[i].setAttribute("href", "javascript:wopen('"+this.href+"','"+this.wname+"',"+this.wsize+","+this.hsize+",'"+this.scrollflg+"');"); }}function wopen(url,wnam,wsize,hsize,scrollflg) { if (url) { this.wstate = "width="+wsize+",height="+hsize+",scrollbars="+scrollflg; this.opwin = window.open(url,"",this.wstate); this.opwin.focus(); }}function popupOpWin(url) { if (url) { this.opwin = window.open(url,"","width=500,height=600,scrollbars=yes"); this.opwin.focus(); }}/*==========================================================================================例）サブウィンドウからそれを開いた親ウィンドウでページを遷移して、サブウィンドウを閉じる<a href="http://www.y-sunahara.com/" class="parentlink" closestate="yes" target="_blank">もどーれもどーれ</a>==========================================================================================*/function classParentlink() { this.classs = document.getElementsByClassName("parentlink"); for(i=0;i<this.classs.length;i++){ this.href = this.classs[i].getAttribute("href"); this.closeState = this.classs[i].getAttribute("closestate"); this.openTyp = this.classs[i].getAttribute("target"); if( !this.closeState ) this.closeState = "yes"; if( !this.openTyp | this.openTyp == "_blank" ) this.classs[i].setAttribute("target", "_self");  this.classs[i].setAttribute("href", "javascript:popen('"+this.href+"','"+this.closeState+"');"); }}function popen(url,clsstate) { opener.document.location.href = url; if( clsstate == "yes" ) window.close();}/*------------------------------------------------------------------------------------------  ポップアップ（flash用）------------------------------------------------------------------------------------------*/function popWin(url,name,w,h){var l=0var t=0var w=window.open(url,name,"menubar=no,scrollbars=auto,status=yas,resizable=no,fullscreen=no,left="+l+",top="+t+",width="+w+",height="+h);w.focus();if(navigator.platform.indexOf("Mac")!=-1){w.moveTo(l,t)}return w;}function pop2Win(url,name,w,h){var l=0var t=0var w=window.open(url,name,"menubar=no,scrollbars=yes,status=yes,resizable=yes,fullscreen=no,left="+l+",top="+t+",width="+w+",height="+h);w.focus();if(navigator.platform.indexOf("Mac")!=-1){w.moveTo(l,t)}return w;}function theater(){	pop2Win("theater.html","popwin",540,520)}function vote(){	popWin("vote.html","popwin",520,520)}function mobile(){	popWin("mobile.html","popwin",520,520)}
