
var add_est_count_url_base  = "/pages/est_cnt_add.php4?serial=";
var est_add_win = null
var newWin2 = null
var newWin = null

function open_add_est_count_win(s){
	open_url = add_est_count_url_base + s;
	 if(est_add_win!=null && est_add_win.closed!=true){
		est_add_win.close()
	}
	est_add_win = window.open(open_url,"est_add_win","left=0,top=0,width=380,height=160,scrollbars=no,resizable=no");
}

function open_selectsortimpression(con_url,myselect){
	location.href= con_url +'&sort_impression='+myselect.options[myselect.selectedIndex].value
}

function openWinAnserQuestion(s,cs){
	if(newWin2!=null && newWin2.closed!=true){
		newWin2.close()
	}
	newWin2 = window.open("/pages/anser_question.php4?rands="+Math.random()+"&serial="+s+"&cserial="+cs,"ContributeImpression","left=0,top=0,width=420,height=600,scrollbars=yes,resizable=yes")
}

function openWinImpression(s)
{
	if(newWin!=null && newWin.closed!=true){
		newWin.close()
	}
	newWin = window.open("/pages/cont_impression.php4?rands="+Math.random()+"&serial="+s,"ContributeImpression","left=0,top=0,width=420,height=600,scrollbars=yes,resizable=yes")
}

function lucyannCheck(name,str) {

   if( str.match( /[^A-Za-z0123456789\+\*\-\&\#]+/ ) ) {
      alert(name + "の刻印に刻印で使えない文字が入っています。");
      return 1;
   }
   return 0;
}
function CanUseScriptBrowser()
{
    var appname = navigator.appName;
    var ua = navigator.userAgent;
    if(appname == "Microsoft Internet Explorer"){
        var appver = navigator.appVersion;
        var p = appver.indexOf("MSIE",0);
        if(p >= 0){
            var p2 = appver.indexOf(";",p);
            if(p2 >= 0){
                var iever = appver.substring(p + 5, p2);
                if(iever >= 6){
                    return true;
                }
            }
        }
    }else if(ua.indexOf("Gecko/") >= 0){
        var p = ua.indexOf("Gecko/");
        var p2 = ua.indexOf(" ", p);
        if(p2 >= 0){
            var ver = ua.substring(p + 6, p2);
            if(ver >= 20060308){
                return true;
            }
        }
    }
    return false;
}

var canUseScript = CanUseScriptBrowser();


	function chg_main_img(file,link){
		if(canUseScript != true){
			return true;
		}
		img =document.getElementById('main-img');
		img.src = file;
		img =document.getElementById('damy');
		img.src = link;
		link2 =document.getElementById('main-link');
		link2.href =  img.src;
	}