$j(document).ready(function(){
	window.resizeTo(1280, 895);
});

$j(document).ready(function(){
	$j("a[rel='slideshow']").colorbox({transition:"fade", height:"80%"});
	$j(function(){
    	if($j.browser.mozilla) {
        	$j(".menubutton").remove();
     	}
	})
});

$j(document).ready(function(){
	$j("#menu a").fadeTo("slow", 0.5); 
	$j("#menu a").hover(function(){
	$j(this).fadeTo("slow", 1.0); 
		},function(){
				$j(this).fadeTo("slow", 0.5); 
		});
});

$j(document).ready(function() {
    $j('.slideshow').cycle({
		fx: 'fade' 
	});
});

function chtextZero(Source){
	if(Source.value != ""){
                    var rt = "";
                    var i = 0;
                    for(i = 0; i < Source.maxLength - Source.value.length; i++){
                        rt = rt + "0";
                    }
                    Source.value = rt + Source.value;
                }
}

function setCid(cid){
	document.getElementById('cid').value = cid;
}

//開啟新視窗
function OpenWin(url, widval, heightval, topval, leftval){
    var winId
    window.open(url, 'win1', 
                'status=0,scrollbars=1,toolbar=0,resize=yes,' + 
                'width=' + widval + ',height=' + heightval + ',' + 
                'top=' + topval + ', left=' + leftval
    );
}

//複製欄位值
function CopyField(SrcField, TargetField){
	if(SrcField.type == "select-one"){
		TargetField.value = SrcField.options[SrcField.selectedIndex].text;
  }else{
  	TargetField.value = SrcField.value;
	}
}