/*
▼サイト全体のjavaScript
*/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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];}}
}

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


/*　ウィンドウを開く　*/
function winOpen(popupURL) {
  window.open(popupURL,'','status=no,scrollbars=yes,menubar=no,resizable=no,width=800,height=600');
}


/*　親ウィンドウの遷移と子ウィンドウを閉じる　*/
function jumpParentWin(ParentWinURL){
var ParentWinURL;
window.opener.parent.location.href=ParentWinURL;
window.close();
}

/*　親ウィンドウの遷移のみ　*/
function jumpParentWinOnly(ParentWinURL){
var ParentWinURL;
window.opener.parent.location.href=ParentWinURL;
}

/*　新着情報の更新（NEW）マーク自動削除　*/

function updateMark(yy,mm,dd){
    var date = yy+"/"+mm+"/"+dd;//ログの年月日
    var interval ="14" //表示期限（日）
    a = new Date();
    b = Date.parse(date)+ (parseInt(interval) * 24 * 3600 * 1000);
    c = a.getTime();
    neIcon = "<img src='/img000/icon/new.gif' alt='NEW' class='whatsnew' />";  // 新規項目の画像
    usIcon = "<img src='/img000/icon/usual.gif' alt='USUAL' class='whatsnew' />";   // 更新項目の画像
    if(b>=c) document.write(neIcon);
    else document.write(usIcon);
}

/* 　コピーライト表記　 */
var nowDt=new Date();
var numberYear=nowDt.getFullYear();
var copyrightText = 'alt=copyright &copy; 2008-'+numberYear+' アトリエぽるか All Rights Resereved.';
var copyrightUnited = '<img src=http://www.polka.jp/img000/footer/copyright.gif ' + copyrightText + ' />';
function copyright()
{
document.write(copyrightUnited);
}

/* iframeタイプの新着情報関連
var scrSize = 2;
var scrSpeed = 10;
var timeId;
function scrDown(){scrWin.scrollBy(0,scrSize);timeId = setTimeout("scrDown()",scrSpeed);}
function scrUp(){scrWin.scrollBy(0,-1*scrSize);timeId = setTimeout("scrUp()",scrSpeed);}
function scrStop(){clearTimeout(timeId);}
function scrBackToTop(){
scrWin.document.location.href="http://www.polka.jp/whatsnew.html";
}
 */



/* divタイプの新着情報関連 */
var timeout;
var NewsPosY = 0;
var NewsStep = 2;

function upScroll(){
if (NewsPosY < 0){NewsPosY=0;}
var e=document.getElementById("scrWin");
if(e.scrollTop<e.scrollHeight-e.offsetHeight){
e.scrollTop = NewsPosY;
window.status = NewsPosY;
NewsPosY = NewsPosY - NewsStep;
timeout=setTimeout("upScroll()",2);
}
}

function downScroll(){
if (NewsPosY < 0){NewsPosY=0;}
var e=document.getElementById("scrWin");
if(e.scrollTop<e.scrollHeight-e.offsetHeight){
e.scrollTop = NewsPosY;
window.status = NewsPosY;
NewsPosY = NewsPosY + NewsStep;
timeout=setTimeout("downScroll()",2);
}
}

function stopScroll(){
clearTimeout(timeout);
}

function scrollBackToTop() {
y=0;
document.getElementById("scrWin").scrollTop = 0;
}





/* 　文字サイズ変更　 */
function fontSizeChange(fsize){

numBig = "116.6%";
numMedium ="100%";
numSmall ="83.3%";

srcBig = "http://www.polka.jp/img000/fontsize_controler/big.jpg";
srcMedium = "http://www.polka.jp/img000/fontsize_controler/medium.jpg";
srcSmall = "http://www.polka.jp/img000/fontsize_controler/small.jpg";

if( fsize == "big" ){
document.body.style.fontSize = numBig;
document.fontsize_controler.src= srcBig;
}
else if( fsize == "medium" ){
document.body.style.fontSize = numMedium;
document.fontsize_controler.src= srcMedium;
}
else{
document.body.style.fontSize = numSmall;
document.fontsize_controler.src= srcSmall;
}

}


/* 　ブックマーク　 */
function bookmarkYahoo(){
window.open('http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t='+encodeURIComponent(document.title)+'&u='+encodeURIComponent(window.location.href)+'&opener=bm&ei=UTF-8','popup','width=550px,height=480px,status=1,location=0,resizable=1,scrollbars=0,left=100,top=50',0);
}
function bookmarkDel(){
url='http://www.polka.jp/';
title='［大阪府和泉市・泉大津市］ホームページ制作・DTPデザイン　個人デザイン事務所（SOHO） アトリエぽるか';
newWin=window.open();
newWin.location.href='http://del.icio.us/post?url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title);
}
function bookmarkFC2(){
location.href='http://bookmark.fc2.com/user/post?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);
}
function bookmarkNewsing(){
window.location='http://newsing.jp/nbutton?title='+encodeURIComponent('［大阪府和泉市・泉大津市］ホームページ制作・DTPデザイン　個人デザイン事務所（SOHO） アトリエぽるか')+'&url='+encodeURIComponent('http://www.polka.jp');
}

function bookmark(){
document.write('<ol> ');
document.write('<!-- Yahoo --> ');
document.write('<li><a href="javascript:bookmarkYahoo()"><img src="http://i.yimg.jp/images/sicons/ybm16.gif" width="16" height="16" alt="" /></a></li> ');
document.write('<!-- google --> ');
document.write('<li><a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=http://www.polka.jp/&title=［大阪府和泉市・泉大津市］ホームページ制作・DTPデザイン　個人デザイン事務所（SOHO） アトリエぽるか" target="_blank"><img alt="" src="http://www.google.co.jp/favicon.ico" border="0" width="16" height="16" /></a></li> ');
document.write('<!-- はてな --> ');
document.write('<li><a href="http://b.hatena.ne.jp/append?http://www.polka.jp/" target="_blank"><img src="http://b.hatena.ne.jp/images/append.gif" alt="" width="16" height="12" border="0" /></a></li> ');
document.write('<!-- del.icio.us --> ');
document.write('<li><a href="javascript:bookmarkDel()"><img src="http://del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="" /></a></li> ');
document.write('<!-- ニフティクリップ --> ');
document.write('<li><a href="http://clip.nifty.com/create?url=http://www.polka.jp&title=［大阪府和泉市・泉大津市］ホームページ制作・DTPデザイン　個人デザイン事務所（SOHO） アトリエぽるか" rel="nofollow"><img src="http://clip.nifty.com/images/addclip_icn.gif" alt="" width="12" height="12" border="0" /></a></li> ');
document.write('<!-- Livedoorクリップ --> ');
document.write('<li><a href="http://clip.livedoor.com/clip/add?link=window.self.location.href&title=document.title&jump=myclip" target="_blank"><img src="http://parts.blog.livedoor.jp/img/cmn/clip_16_16_b.gif" width="16" height="16" alt="" /></a></li> ');
document.write('<!-- Buzzurl --> ');
document.write('<li><a href="http://buzzurl.jp/entry/http://www.polka.jp/" target="_blank"><img src="http://buzzurl.jp/static/image/api/icon/add_icon_mini_08.gif" alt="" style="border:0"></a></li> ');
document.write('<!-- FC2 --> ');
document.write('<li><a href="javascript:bookmarkFC2();" title="このページをFC2ブックマークへ追加" target="_blank"><img alt="" src="http://bookmark.fc2.com/images/add-16.gif" width="16" height="16" border="0" /></a></li> ');
document.write('<!-- newsing --> ');
document.write('<li><a href="javascript:bookmarkNewsing();" target="_blank"><img src="http://image.newsing.jp/common/images/newsingit/newsingit_s.gif" width="16" height="16" alt="" title="このページをnewsingへ追加" border="0" align="absmiddle" /></a></li> ');
document.write('</ol> ');
}


/* 　リンク　 */
function bbsSevenCom(){
document.write('<!-- BBS7.com WebRing Start --><table border="0" cellpadding="0" cellspacing="0"><tr> ');
document.write('<td colspan="3"><a href="http://bbs7.com/from.to?n=1715418&u=www%2Epolka%2Ejp" target="_top"><img src="http://bbs7.com/bbs7ring_images/bbs7head_f.gif" width="120" height="31" border="0" alt="BBS7.COM" /></a></td></tr><tr><td><a href="http://bbs7.com/webring.to?p=cont&n=1715418&u=www%2Epolka%2Ejp" target="_top"><img src="http://bbs7.com/bbs7ring_images/ring_menu_mf.gif" width="41" height="14" border="0" alt="MENU" /></a></td> ');
document.write('<td><a href="http://bbs7.com/webring.to?p=next&n=1715418&u=www%2Epolka%2Ejp&j=rnd" target="_top"><img src="http://bbs7.com/bbs7ring_images/ring_rnd_mf.gif" width="39" height="14" border="0" alt="RND" /></a></td> ');
document.write('<td><a href="http://bbs7.com/webring.to?p=next&n=1715418&u=www%2Epolka%2Ejp" target="_top"><img src="http://bbs7.com/bbs7ring_images/ring_next_mf.gif" width="40" height="14" border="0" alt="NEXT" /></a></td> ');
document.write('</tr></table><!-- BBS7.com WebRing END --> ');
}



/*
ボタンなど共用画像のプリロード
*/
function preloadCommonImages(){
MM_preloadImages('http://www.polka.jp/img000/wingbox/visual_clip/sample/j_greenfarm.jpg','http://www.polka.jp/img000/wingbox/visual_clip/sample/ko_gu.jpg','http://www.polka.jp/img000/wingbox/visual_clip/sample/nenga.jpg','http://www.polka.jp/img000/wingbox/visual_clip/sample/amitie.jpg','http://www.polka.jp/img000/wingbox/visual_clip/sample/valentine.jpg','http://www.polka.jp/img000/wingbox/visual_clip/sample/couple.jpg','http://www.polka.jp/img000/wingbox/visual_clip/sample/map.jpg','http://www.polka.jp/img000/header/minibn/blog_2.gif','http://www.polka.jp/img000/header/minibn/contact_2.gif','http://www.polka.jp/img000/menubar/top_2.jpg','http://www.polka.jp/img000/menubar/outline_2.jpg','http://www.polka.jp/img000/menubar/charge_2.jpg','http://www.polka.jp/img000/menubar/flow_2.jpg','http://www.polka.jp/img000/menubar/design_2.jpg','http://www.polka.jp/img000/menubar/contact_2.jpg','http://www.polka.jp/img000/minibn/transaction.gif','http://www.polka.jp/img000/minibn/sitemap.gif','http://www.polka.jp/img000/minibn/top.gif','http://www.polka.jp/img000/minibn/backtotop.gif')
}



