var auth = '';var connector = '/info/public_construction/_administrator/connector.php';var cookie_first_url = 'cms_first_url';function do_action (act) { self.location.href='?q='+act; } function ajax_eval( data, async ) { if( async == null ) async = true; if( !data.match(/&q=/) ) data = '&q='+data; new Ajax.Request(connector, { method: 'post', postBody : data, asynchronous : async, onSuccess : function(obj){ if(obj.responseText){ eval(obj.responseText); } } }); } function ajax_eval_debug( data, async ) { if( async == null ) async = true; if( !data.match(/&q=/) ) data = '&q='+data; new Ajax.Request(connector, { method: 'post', postBody : data, asynchronous : async, onSuccess : function(obj){ if(obj.responseText){ alert(obj.responseText); eval(obj.responseText); } } }); } function ajax_json_eval( data ) { if( !data.match(/&q=/) ) data = '&q='+data; new Ajax.Request(connector, { method: 'post', postBody : data, onSuccess : function(obj){ if(obj.responseText){ eval('ret='+obj.responseText); if( ret.type == 'script' ) { eval(ret.data); } else { alert(obj.responseText); } } } }); } function ajax_callback( data, func, async ) { if( async == null ) async = true; if( !data.match(/&q=/) ) data = '&q='+data; new Ajax.Request(connector, { method: 'post', postBody : data, asynchronous : async, onSuccess : eval(func) }); } function ajax_update( data, elm ){ if( !data.match(/&q=/) ) data = '&q='+data; new Ajax.Updater( {success:elm}, connector, { method: "post", postBody : data, evalScripts: true, onFailure:function(httpObj){ $(elm).innerHTML = "Error!!"; } } ); } function ajax_eval_p( data, async ) { if( async == null ) async = true; if( !data.match(/&a=/) ) { data = '&a='+data; } new Ajax.Request('http://www.city.kashiba.lg.jp/info/public_construction/index.php', { method: 'get', parameters : data, asynchronous : async, onSuccess: function(obj) { if(obj.responseText){ alert(obj.responseText); eval(obj.responseText); } } }); } function ajax_update_p( data, elm ) { if( !data.match(/&q=/) ) data = '&a='+data; new Ajax.Updater( {success:elm}, 'http://www.city.kashiba.lg.jp/info/public_construction/index.php', { method: "get", parameters : data, evalScripts: true, onFailure:function(httpObj){ $(elm).innerHTML = "Error!!"; } } ); } function ajax_dialog(data,x,y) { if( !data.match(/&q=/) ) data = '&q='+data; if( !x ) x = 480; if( !y ) y = 320; Dialog.info( { url: connector, options: { method: 'post', postBody : data, asynchronous : false } }, { className:"alphacube", width:x, height:y } ); } function ajax_submit(form_obj){ post_data = Form.serialize(form_obj); new Ajax.Request(connector, { method: 'post', postBody : post_data, onSuccess : function(obj){ if(obj.responseText){ eval(obj.responseText); } } }); } function ajax_submit_update(form_obj, elm){ post_data = Form.serialize(form_obj); new Ajax.Updater( {success:elm}, connector, { method: "post", postBody : post_data, evalScripts: true, onFailure:function(httpObj){ $(elm).innerHTML = "Error!!"; } } ); } function alert_dialog(msg, h) { if( !h ) h = 100; Dialog.alert(msg, { windowParameters: {width:320, height:h, zIndex:100000}, className:"alphacube", okLabel: "OK" }); } function confirm_dialog(msg, func, h) { if( !h ) h = 100; Dialog.confirm(msg, { windowParameters: {width:320, height:h, zIndex:100000}, className:"alphacube", okLabel: "OK", ok:func, cancel:function(){Dialog.closeInfo();} }); } function confirm_dialog_update(msg, data, elm, h) { if( !h ) h = 100; Dialog.confirm(msg, { windowParameters: {width:320, height:h, zIndex:100000}, className:"alphacube", okLabel: "OK", ok:function(){ajax_update(data,elm);Dialog.closeInfo();}, cancel:function(){Dialog.closeInfo();} }); } function info_dialog(msg, w, h, progress) { if( !w ) w = 320; if( !h ) w = 100; if( progress !== false ) progress = true; Dialog.info(msg, { className:"alphacube", windowParameters: {width:w, height:h, zIndex:100000}, showProgress:progress }); } function close_dialog(msg) { Dialog.setInfoMessage(msg); setTimeout("Dialog.closeInfo()", 1500); } function set_message(msg){ Dialog.setInfoMessage(msg); } function sub_dialog(msg,x,y) { if( !x ) x = 320; if( !y ) y = 100; Dialog.info(msg, { className:"alphacube", windowParameters: {width:x, height:y, zIndex:100000}, showProgress:false }); } function set_cookie(keyname, data) { theDay = 1; setDay = new Date(); setDay.setTime(setDay.getTime()+(theDay*1000*60*60*24)); expDay = setDay.toGMTString(); document.cookie = keyname + "="+escape(data)+";expires=" + expDay + ";path=/"; } function get_cookie(keyname) { theData = ""; theName = keyname+"="; theCookie = document.cookie+";"; start = theCookie.indexOf(theName); if (start != -1) { end = theCookie.indexOf(";",start); theData = unescape(theCookie.substring(start+theName.length,end)); } return theData; } function open_dialog(url, x, y, title, status, modal, dialog_name, reload ) { if( !url ) return false; if( !x ) x = '540'; if( !y ) y = '480'; if( x.toString().match(/([0-9]+)%/) ) { ratio = RegExp.$1 / 100; x = Math.floor(get_brouser_width() * ratio); } y = eval(y)+30; if( !title ) title = ''; if( !status ) status = ''; if( !modal ) modal = true; if( !dialog_name ) dialog_name = 'admin_dialog'; if( !reload ) reload = false; skin = get_cookie(skin_cookie_name); if( !skin ) skin = 'dialog'; var win = new Window(dialog_name,{ className: skin, destroyOnClose: true, width:x, height:y, zIndex: 100000, resizable: true, minimizable: true, maximizable: true, title: title, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false }); win.setURL(url); if( status ) win.setStatusBar(status); if( !reload ) win.setCloseCallback(windowReload); win.showCenter(modal); set_cookie(cookie_first_url, url); } function windowReload() { location.reload(); } function windowClose() { return true; } var debug = { win: null, p: function(str){ if( !debug.win ) { debug.o(); } debug.win.document.write(str+"
"); }, o: function(){ debug.win = window.open('about:blank','debug','width=300,height=300,resizable=yes'); } }; var target_element=null; function showFileManager(dir, element_name){ if( !element_name ) element_name = null; target_element = element_name; url = "/info/public_construction/_administrator/editor/FCKeditor/editor/filemanager/browser/mcpuk/browser.html?Type=File&Connector=connectors/php/connector.php"; if( dir ) url += '&CurrentFolder=' + dir; x=800; y=600; OpenSubWin(url,x,y,'server_browser'); } function showImageManager(dir, element_name){ if( !element_name ) element_name = null; target_element = element_name; url = "/info/public_construction/_administrator/editor/FCKeditor/editor/filemanager/browser/mcpuk/browser.html?Type=Image&Connector=connectors/php/connector.php"; if( dir ) url += '&CurrentFolder=' + dir; x=800; y=600; OpenSubWin(url,x,y,'server_browser'); } function SetUrl( fileUrl ){ if( target_element !== null && !!$(target_element) ) { $(target_element).value = fileUrl; } else { OpenSubWin(fileUrl,0,0,"image"); return true; } } function OpenSubWin(url, x, y,winname ){ if( !url ) return false; if( !x ) x = 600; if( !y ) y = 480; wx = screen.width; wy = screen.height - 50; dx = ( wx - x ) / 2; dy = ( wy - y ) / 2; option = "top=" + dy; option += ",left=" + dx; option += ",width=" + x; option += ",height=" + y; option += ",scrollbars=yes,status=yes,resizable=yes"; w = window.open(url,winname,option); w.focus(); } function screenInfomation(){ var screen = new Object(); screen.width = parent.document.body.clientWidth || parent.document.documentElement.clientWidth; screen.nowHeight = parent.document.documentElement.clientHeight; screen.height = parent.document.body.clientHeight || parent.document.body.scrollHeight; screen.x = parent.document.body.scrollLeft || parent.document.documentElement.scrollLeft; screen.y = parent.document.body.scrollTop || parent.document.documentElement.scrollTop; return screen; } function get_brouser_height(){ if (!document.all && (document.layers || document.getElementById)) { return window.innerHeight; } else if (document.getElementById && (document.compatMode=='CSS1Compat')) { return document.documentElement.clientHeight; } else if (document.all) { return document.body.clientHeight; } else { return 800; } } function get_brouser_width(){ if (!document.all && (document.layers || document.getElementById)) { return window.innerWidth; } else if (document.getElementById && (document.compatMode=='CSS1Compat')) { return document.documentElement.clientWidth; } else if (document.all) { return document.body.clientWidth; h=document.body.clientHeight; } else { return 1024; } } function mt(name, domain, subject, body) { var encode = 'sjis-win'; if(navigator.userAgent.indexOf("Opera") >= 0){ encode = 'UTF-8'; } else if( (navigator.userAgent.indexOf("MSIE 8.") >= 0) &&(navigator.userAgent.indexOf("Windows") >= 0) ){ encode = 'SJIS'; } else if( (navigator.userAgent.indexOf("MSIE 6.") >= 0) &&(navigator.userAgent.indexOf("Windows") >= 0) ){ encode = 'sjis-win'; } else if( (navigator.userAgent.indexOf("MSIE 5.") >= 0) &&(navigator.userAgent.indexOf("Windows") >= 0) ){ encode = 'sjis-win'; } else if( (navigator.userAgent.indexOf("Windows") >= 0) ){ encode = 'sjis-win'; } else { encode = 'UTF-8'; } var data = '&subject=' + subject + '&body=' + body + '&encode=' + encodeURIComponent(encode) + '&time=4'; new Ajax.Request('/info/public_construction/_administrator/js/mailto_encode.php', { method: 'post', postBody : data, asynchronous : false, onSuccess: function(obj) { if(obj.responseText){ eval(obj.responseText); location.href = 'mailto:' + name + '@' + domain + '?subject=' + subject + '&body=' + body; } } }); }