
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(q){try{var S=YAHOO.util.Event.getTarget(q);if(S.type.toLowerCase()=="submit"){YAHOO.util.Connect._submitElementValue=encodeURIComponent(S.name)+"="+encodeURIComponent(S.value);}}catch(q){}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(S){this._msxml_progid.unshift(S);},setDefaultPostHeader:function(S){if(typeof S=="string"){this._default_post_header=S;}else{if(typeof S=="boolean"){this._use_default_post_header=S;}}},setDefaultXhrHeader:function(S){if(typeof S=="string"){this._default_xhr_header=S;}else{this._use_default_xhr_header=S;}},setPollingInterval:function(S){if(typeof S=="number"&&isFinite(S)){this._polling_interval=S;}},createXhrObject:function(w){var m,S;try{S=new XMLHttpRequest();m={conn:S,tId:w};}catch(R){for(var q=0;q<this._msxml_progid.length;++q){try{S=new ActiveXObject(this._msxml_progid[q]);m={conn:S,tId:w};break;}catch(R){}}}finally{return m;}},getConnectionObject:function(S){var R;var m=this._transaction_id;try{if(!S){R=this.createXhrObject(m);}else{R={};R.tId=m;R.isUpload=true;}if(R){this._transaction_id++;}}catch(q){}finally{return R;}},asyncRequest:function(w,q,m,S){var R=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();if(!R){return null;}else{if(m&&m.customevents){this.initCustomEvents(R,m);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(R,m,q,S);return R;}if(w.toUpperCase()=="GET"){if(this._sFormData.length!==0){q+=((q.indexOf("?")==-1)?"?":"&")+this._sFormData;}else{q+="?"+this._sFormData;}}else{if(w.toUpperCase()=="POST"){S=S?this._sFormData+"&"+S:this._sFormData;}}}R.conn.open(w,q,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if(this._isFormSubmit==false&&this._use_default_post_header){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(R);}this.handleReadyState(R,m);R.conn.send(S||null);this.startEvent.fire(R);if(R.startEvent){R.startEvent.fire(R);}return R;}},initCustomEvents:function(S,R){for(var q in R.customevents){if(this._customEvents[q][0]){S[this._customEvents[q][0]]=new YAHOO.util.CustomEvent(this._customEvents[q][1],(R.scope)?R.scope:null);S[this._customEvents[q][0]].subscribe(R.customevents[q]);}}},handleReadyState:function(q,R){var S=this;if(R&&R.timeout){this._timeOut[q.tId]=window.setTimeout(function(){S.abort(q,R,true);},R.timeout);}this._poll[q.tId]=window.setInterval(function(){if(q.conn&&q.conn.readyState===4){window.clearInterval(S._poll[q.tId]);delete S._poll[q.tId];if(R&&R.timeout){window.clearTimeout(S._timeOut[q.tId]);delete S._timeOut[q.tId];}S.completeEvent.fire(q);if(q.completeEvent){q.completeEvent.fire(q);}S.handleTransactionResponse(q,R);}},this._polling_interval);},handleTransactionResponse:function(w,V,S){var R,q;try{if(w.conn.status!==undefined&&w.conn.status!==0){R=w.conn.status;}else{R=13030;}}catch(m){R=13030;}if(R>=200&&R<300||R===1223){q=this.createResponseObject(w,(V&&V.argument)?V.argument:undefined);if(V){if(V.success){if(!V.scope){V.success(q);}else{V.success.apply(V.scope,[q]);}}}this.successEvent.fire(q);if(w.successEvent){w.successEvent.fire(q);}}else{switch(R){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:q=this.createExceptionObject(w.tId,(V&&V.argument)?V.argument:undefined,(S?S:false));if(V){if(V.failure){if(!V.scope){V.failure(q);}else{V.failure.apply(V.scope,[q]);}}}break;default:q=this.createResponseObject(w,(V&&V.argument)?V.argument:undefined);if(V){if(V.failure){if(!V.scope){V.failure(q);}else{V.failure.apply(V.scope,[q]);}}}}this.failureEvent.fire(q);if(w.failureEvent){w.failureEvent.fire(q);}}this.releaseObject(w);q=null;},createResponseObject:function(S,d){var m={};var T={};try{var R=S.conn.getAllResponseHeaders();var V=R.split("\n");for(var w=0;w<V.length;w++){var q=V[w].indexOf(":");if(q!=-1){T[V[w].substring(0,q)]=V[w].substring(q+2);}}}catch(N){}m.tId=S.tId;m.status=(S.conn.status==1223)?204:S.conn.status;m.statusText=(S.conn.status==1223)?"No Content":S.conn.statusText;m.getResponseHeader=T;m.getAllResponseHeaders=R;m.responseText=S.conn.responseText;m.responseXML=S.conn.responseXML;if(typeof d!==undefined){m.argument=d;}return m;},createExceptionObject:function(N,m,S){var V=0;var d="communication failure";var R=-1;var q="transaction aborted";var w={};w.tId=N;if(S){w.status=R;w.statusText=q;}else{w.status=V;w.statusText=d;}if(m){w.argument=m;}return w;},initHeader:function(S,m,R){var q=(R)?this._default_headers:this._http_headers;q[S]=m;if(R){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(S){if(this._has_default_headers){for(var q in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,q)){S.conn.setRequestHeader(q,this._default_headers[q]);}}}if(this._has_http_headers){for(var q in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,q)){S.conn.setRequestHeader(q,this._http_headers[q]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(M,w,q){this.resetFormState();var f;if(typeof M=="string"){f=(document.getElementById(M)||document.forms[M]);}else{if(typeof M=="object"){f=M;}else{return ;}}if(w){var V=this.createFrame(q?q:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=f;return ;}var S,T,d,p;var N=false;for(var m=0;m<f.elements.length;m++){S=f.elements[m];p=f.elements[m].disabled;T=f.elements[m].name;d=f.elements[m].value;if(!p&&T){switch(S.type){case "select-one":case "select-multiple":for(var R=0;R<S.options.length;R++){if(S.options[R].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(T)+"="+encodeURIComponent(S.options[R].attributes["value"].specified?S.options[R].value:S.options[R].text)+"&";}else{this._sFormData+=encodeURIComponent(T)+"="+encodeURIComponent(S.options[R].hasAttribute("value")?S.options[R].value:S.options[R].text)+"&";}}}break;case "radio":case "checkbox":if(S.checked){this._sFormData+=encodeURIComponent(T)+"="+encodeURIComponent(d)+"&";}break;case "file":case undefined:case "reset":case "button":break;case "submit":if(N===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(T)+"="+encodeURIComponent(d)+"&";}N=true;}break;default:this._sFormData+=encodeURIComponent(T)+"="+encodeURIComponent(d)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(S){var q="yuiIO"+this._transaction_id;var R;if(window.ActiveXObject){R=document.createElement("<iframe id=\""+q+"\" name=\""+q+"\" />");if(typeof S=="boolean"){R.src="javascript:false";}else{if(typeof secureURI=="string"){R.src=S;}}}else{R=document.createElement("iframe");R.id=q;R.name=q;}R.style.position="absolute";R.style.top="-1000px";R.style.left="-1000px";document.body.appendChild(R);},appendPostData:function(S){var m=[];var q=S.split("&");for(var R=0;R<q.length;R++){var w=q[R].indexOf("=");if(w!=-1){m[R]=document.createElement("input");m[R].type="hidden";m[R].name=q[R].substring(0,w);m[R].value=q[R].substring(w+1);this._formNode.appendChild(m[R]);}}return m;},uploadFile:function(m,p,w,R){var N="yuiIO"+m.tId;var T="multipart/form-data";var f=document.getElementById(N);var U=this;var q={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",w);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",N);if(this._formNode.encoding){this._formNode.setAttribute("encoding",T);}else{this._formNode.setAttribute("enctype",T);}if(R){var M=this.appendPostData(R);}this._formNode.submit();this.startEvent.fire(m);if(m.startEvent){m.startEvent.fire(m);}if(p&&p.timeout){this._timeOut[m.tId]=window.setTimeout(function(){U.abort(m,p,true);},p.timeout);}if(M&&M.length>0){for(var d=0;d<M.length;d++){this._formNode.removeChild(M[d]);}}for(var S in q){if(YAHOO.lang.hasOwnProperty(q,S)){if(q[S]){this._formNode.setAttribute(S,q[S]);}else{this._formNode.removeAttribute(S);}}}this.resetFormState();var V=function(){if(p&&p.timeout){window.clearTimeout(U._timeOut[m.tId]);delete U._timeOut[m.tId];}U.completeEvent.fire(m);if(m.completeEvent){m.completeEvent.fire(m);}var v={};v.tId=m.tId;v.argument=p.argument;try{v.responseText=f.contentWindow.document.body?f.contentWindow.document.body.innerHTML:f.contentWindow.document.documentElement.textContent;v.responseXML=f.contentWindow.document.XMLDocument?f.contentWindow.document.XMLDocument:f.contentWindow.document;}catch(u){}if(p&&p.upload){if(!p.scope){p.upload(v);}else{p.upload.apply(p.scope,[v]);}}U.uploadEvent.fire(v);if(m.uploadEvent){m.uploadEvent.fire(v);}YAHOO.util.Event.removeListener(f,"load",V);setTimeout(function(){document.body.removeChild(f);U.releaseObject(m);},100);};YAHOO.util.Event.addListener(f,"load",V);},abort:function(m,V,S){var R;if(m.conn){if(this.isCallInProgress(m)){m.conn.abort();window.clearInterval(this._poll[m.tId]);delete this._poll[m.tId];if(S){window.clearTimeout(this._timeOut[m.tId]);delete this._timeOut[m.tId];}R=true;}}else{if(m.isUpload===true){var q="yuiIO"+m.tId;var w=document.getElementById(q);if(w){YAHOO.util.Event.removeListener(w,"load",uploadCallback);document.body.removeChild(w);if(S){window.clearTimeout(this._timeOut[m.tId]);delete this._timeOut[m.tId];}R=true;}}else{R=false;}}if(R===true){this.abortEvent.fire(m);if(m.abortEvent){m.abortEvent.fire(m);}this.handleTransactionResponse(m,V,true);}return R;},isCallInProgress:function(q){if(q&&q.conn){return q.conn.readyState!==4&&q.conn.readyState!==0;}else{if(q&&q.isUpload===true){var S="yuiIO"+q.tId;return document.getElementById(S)?true:false;}else{return false;}}},releaseObject:function(S){if(S.conn){S.conn=null;}S=null;}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.3.1",build:"541"});
var _ok_for_jax = function() {
if(!window.XMLHttpRequest && !window.ActiveXObject){
return false;
}
if(navigator.appVersion.toLowerCase().indexOf("mac")>0&&navigator.userAgent.indexOf("MSIE")>0&&navigator.userAgent.indexOf("Opera")==-1){
return false;
}
return true;
};
String.prototype.trim = function() {
return this.ph_replace(/^\s + |\s + $/g, "");
};
String.prototype.nl2br = function() {
return this.split("\n").join("<br />\n");
};
String.prototype.ph_replace = function( search, replace ) {
return this.split(search).join(replace);
};
String.prototype.strip_tags = function() {
return this.ph_replace(/<[^>]*>/g, " ");
};
var unescape_for_text = function(cut_string){
return cut_string.ph_replace("&quot;", "\"").ph_replace("&lt;", "<").ph_replace("&gt;", ">").ph_replace("&#39;", "'").ph_replace("&amp;", "&").ph_replace("&#92;", "\\");
};
var escape_for_text = function(cut_string){
return cut_string.ph_replace("&quot;", "\"").ph_replace("&", "&amp;").ph_replace("&amp;#", "&#").ph_replace("<", "&lt;").ph_replace(">", "&gt;").ph_replace("\"", "&quot;");
};
var escape_for_js = function(cut_string){
return cut_string.ph_replace("&quot;", "\"").ph_replace("&", "&amp;").ph_replace("<", "&lt;").ph_replace(">", "&gt;").ph_replace("\"", "&quot;");
};
var _ge = function(id) {
el = document.getElementById(id);
return el;
};
var _d = YAHOO.util.Dom;
function short_strimwidth( str, byte ) {
if ( str=='' ){ return str; }
var str = unescape_for_text( str );
if ( byte != 0 ){
str = getSubstr(str, byte);
}
return insert_wbr( str );
}
function insert_wbr( str ) {
var str_length = str.length;
var num_per_wbr = 5;
var count = Math.ceil(str_length / num_per_wbr);
var cut_array = new Array();
for(var i = 0; i < count; i++){
cut_array.push(escape_for_text(str.substr(i * num_per_wbr, num_per_wbr)));
}
str_rtn = cut_array.join('<wbr>');
return str_rtn;
}
function checkIsZenkaku( value )
{
for( var i=0; i<value.length; ++i )
{
var _c = value.charCodeAt(i);
if( _c < 256 ) // || (_c >= 0xff61 && _c <= 0xff9f)
{
return false;
}
}
return true;
}
function getSubstr( str, value ){
var _count = 0;
var _str = "";
var _str_minus1 = "";
for( var i=0; i<str.length; ++i )
{
var sub = str.substring(i, i + 1);
if( checkIsZenkaku(sub) )
{
_count += 2;
}
else
{
_count += 1;
}
if(_count <= value -1){
_str_minus1 = _str_minus1 + sub;
}
_str = _str + sub;
}
if ( _count > value ){
_rtn_str = _str_minus1 + '…';
} else {
_rtn_str = _str;
}
return _rtn_str;
}
function getStringWidth( str ) {
if ( typeof str != 'string' || str == '' || str == null ) {
return 0;
}
var _str_arr = [];
for( var i=0; i<str.length; i++ ) {
_str_arr.push( str.charAt(i) );
};
var _length = 0;
for( var i=0; i<_str_arr.length; i++ ) {
if( !checkIsZenkaku(_str_arr[i]) ) {
if ( _str_arr[i] == '\n' ) { continue; }
_length++;
} else {
_length += 3; // UTF-8
}
}
return _length;
}
function inInvalidCharForTags( str ) {
if( str.match(/[\"\'\<\>]/) ){
return false;
}
return true;
}
function getPagerSub( total, count, page, func_name, mode ){
var pagerSubStr = '';
var total_pages = Math.ceil(total/count);
var current_page = page;
var page_width = 10;
var PHOTOS_PAGER_PREV = 5;
var PHOTOS_PAGER_NEXT = 5;
var modeStr = '';
if ( mode != '' ){
modeStr = ',' + mode;
}
var first = 1;
var last = total_pages;
if( total_pages <= page_width ){
} else if ( current_page - PHOTOS_PAGER_PREV <= 0 ) {
first = 1;
if(PHOTOS_PAGER_PREV + PHOTOS_PAGER_NEXT + first > total_pages){
last = total_pages;
} else {
last = PHOTOS_PAGER_PREV + PHOTOS_PAGER_NEXT;
}
} else {
first = current_page - (PHOTOS_PAGER_PREV - 1);
if(current_page + PHOTOS_PAGER_NEXT < total_pages){
last = current_page + PHOTOS_PAGER_NEXT;
} else {
last = total_pages;
if(last - first < PHOTOS_PAGER_PREV + PHOTOS_PAGER_NEXT){
first = first - (PHOTOS_PAGER_PREV - (last - current_page));
}
}
}
if(last > 1){
pagerSubStr +=
' <div class="pagenationMain">' +
' 全'+ total_pages +'ページ&nbsp;<span class="pageBrace">［&nbsp;</span>';
for( var i = first; i <= last; i++ ){
if ( i != current_page ){
pagerSubStr += '<a href="#" onClick="' + func_name + '('+ i + modeStr +');return false;">'+ i +'</a>'; } else {
pagerSubStr += '<em class="crnt">'+ i +'</em>';
}
if ( i != last ){
pagerSubStr += '&nbsp;,&nbsp;';
}
}
pagerSubStr +=
'&nbsp;<span class="pageBrace">］</span>' +
' </div>';
pagerSubStr += '<div class="pagenationSub">';
if ( (current_page-1)<= 0 ){
pagerSubStr += '[&nbsp;<span class="atstart">前のページ</span>&nbsp;|';
} else {
var prev_page = current_page-1;
pagerSubStr += '[&nbsp;<a href="#" onClick="' + func_name + '('+ prev_page + modeStr +');return false;">前のページ</a>&nbsp;|';
}
if ( (current_page+1)>total_pages ){
pagerSubStr += '&nbsp;<span class="atend">次のページ</span>&nbsp;]';
} else {
var next_page = current_page+1;
pagerSubStr += '&nbsp;<a href="#" onClick="' + func_name + '('+ next_page + modeStr +');return false;">次のページ</a>&nbsp;]';
}
pagerSubStr += '</div>';
}
return pagerSubStr;
}
function getImageInfo( images_info, type ){
var return_array = {
url:global_default_album_cover['url'],
width:global_default_album_cover['width'],
height:global_default_album_cover['height']
}
if ( images_info.image === undefined ){
return return_array;
}
for ( var i = 0; i < images_info.image.length; i++ ){
if ( images_info.image[i].type === type ){
return_array.url = images_info.image[i].url;
return_array.width = images_info.image[i].width;
return_array.height = images_info.image[i].height;
}
}
return return_array;
}
var global_maxlength = {};
global_maxlength['photo_title'] = 64;
global_maxlength['photo_desc'] = 256;
global_maxlength['photo_tags'] = 20;
global_maxlength['photo_tags_string'] = 400;
global_maxlength['album_title'] = 64;
global_maxlength['album_desc'] = 1000;
global_maxlength['album_comment'] = 500;
global_maxlength['album_tags'] = 20;
var global_helpurl = {};
global_helpurl['tag'] = 'http://help.yahoo.co.jp/help/jp/album/edit/edit-01.html';
global_helpurl['tag_invalid_char'] = 'http://help.yahoo.co.jp/help/jp/album/edit/edit-02.html';
global_helpurl['keitai_mail'] = 'http://help.yahoo.co.jp/help/jp/album/upload/upload-01.html';
global_helpurl['photo_acl'] = 'http://help.yahoo.co.jp/help/jp/album/album-01.html';
global_helpurl['wiki'] = 'http://help.yahoo.co.jp/help/jp/blog/blog-47.html';
global_helpurl['blog'] = 'http://help.yahoo.co.jp/help/jp/blog/blog-05.html';
global_helpurl['flash_inst'] = 'http://help.yahoo.co.jp/help/jp/common/sys/sys-10.html';
var global_str_width = {};
global_str_width['album'] = 36;
global_str_width['photo_thumb'] = 46;
var global_default_album_cover = {};
global_default_album_cover['url'] = 'http://i.yimg.jp/images/socialproducts/album/albumBlank.gif';
global_default_album_cover['width'] = 100;
global_default_album_cover['height'] = 100;
var global_albums = {};
global_albums['attach'] = 1;
global_albums['detach'] = 0;
global_albums['attach_str'] = '入れる';
global_albums['detach_str'] = '外す';
var global_limit = {};
global_limit['one_photo_attach_albums'] = 10;
global_limit['one_album_photos'] = 300;
var global_max = {};
global_max['max_tags'] = 30;
global_max['max_tags_all'] = 100;
var CallApiRequestWithYUI = function(param, success_method, method, crumb_string, uri_path, uri_domain){
var query_string = "";
if(typeof param!="object"){
query_string = param;
}else{
flag = 0;
for(var index in param){
if(flag == 0 ){
query_string = index + "=" + escape_utf8(param[index]);
flag++;
}
else{
query_string += "&" + index + "=" + escape_utf8(param[index]);
}
}
}
if(crumb_string){
query_string += "&crumb=" + crumb_string;
}
else{
query_string += "&crumb=" + crumb;
}
var bcrumb_string=(bcrumb==undefined)?"":bcrumb;
query_string += "&bcrumb=" + escape_utf8(bcrumb);
var uri=(uri_path==undefined)?"/rest/":uri_path;
if(uri_domain){
uri = '/' + uri + '/';
uri = uri.ph_replace("//","/");
uri = "http://" + uri_domain + uri;
}
var query_method=(method==undefined)?"POST":method;
if ( query_method == 'POST' ){
var request = YAHOO.util.Connect.asyncRequest(query_method, uri, success_method, query_string);
} else {
uri = uri + "?" + query_string;
var request = YAHOO.util.Connect.asyncRequest(query_method, uri, success_method);
}
};
var escape_utf8=function(_41){
if(_41==""||_41==null){
return "";
}
_41=_41.toString();
var _42="";
for(var i=0;i<_41.length;i++){
var c=_41.charCodeAt(i);
var bs=new Array();
if(c>65536){
bs[0]=240|((c&1835008)>>>18);
bs[1]=128|((c&258048)>>>12);
bs[2]=128|((c&4032)>>>6);
bs[3]=128|(c&63);
}else{
if(c>2048){
bs[0]=224|((c&61440)>>>12);
bs[1]=128|((c&4032)>>>6);
bs[2]=128|(c&63);
}else{
if(c>128){
bs[0]=192|((c&1984)>>>6);
bs[1]=128|(c&63);
}else{
bs[0]=c;
}
}
}
if(bs.length>1){
for(var j=0;j<bs.length;j++){
var b=bs[j];
var hex=nibble_to_hex((b&240)>>>4)+nibble_to_hex(b&15);
_42+="%"+hex;
}
}else{
_42+=encodeURIComponent(String.fromCharCode(bs[0]));
}
}
return _42;
};
var nibble_to_hex=function(_48){
var _49="0123456789ABCDEF";
return _49.charAt(_48);
};
var global_message = {};
var global_substitute_word = '###SUBSTITUTE###';
global_message['photo'] = {};
global_message['photo']['confirm_delete'] = '写真「'+ global_substitute_word +'」を削除します。ほかのYahoo!サービスでも公開している場合、\nそのサービス上でも写真は削除されます。よろしいですか？';
global_message['photo_title'] = {};
global_message['photo_title']['empty'] = 'タイトルを全角64文字以内で入力してください。' ;
global_message['photo_title']['too_long'] = 'タイトルが長すぎます。全角64文字以内で入力してください。' ;
global_message['photo_title']['saving'] = '保存中';
global_message['photo_title']['api_error'] = 'タイトルを変更できませんでした。';
global_message['photo_title']['blank_string'] = 'クリックしてタイトルを編集できます。';
global_message['photo_title']['save_button'] = '決定';
global_message['photo_title']['cancel_button'] = 'キャンセル';
global_message['photo_description'] = {};
global_message['photo_description']['too_long'] = '説明が長すぎます。全角256文字以内で入力してください。';
global_message['photo_description']['saving'] = '保存中';
global_message['photo_description']['api_error'] = '説明文を変更できませんでした。';
global_message['photo_description']['blank_string'] = 'クリックして説明文を全角256文字以内で編集できます。';
global_message['album_description'] = {};
global_message['album_description']['too_long'] = '説明が長すぎます。全角1000文字以内で入力してください。';
global_message['album_description']['blank_string'] = 'クリックして説明文を全角1000文字以内で編集できます。';
global_message['photo_upload'] = {};
global_message['photo_upload']['select_file_error'] = 'アップロードしたいファイルを選択してください。';
global_message['photo_upload']['select_file_invalid'] = '選択したファイルが不正です。';
global_message['photo_yightbox'] = {};
global_message['photo_yightbox']['select_album_error'] = 'アルバムを選択してください。';
global_message['photo_yightbox']['get_albumlist_error'] = 'Myアルバム一覧を表示できませんでした。しばらく時間をおいて再度おためしください。';
global_message['photo_yightbox']['albumlist_empty'] = 'Myアルバムが作成されていません。';
global_message['photo_yightbox_p'] = {};
global_message['photo_yightbox_p']['select_photo_error'] = '写真を選択してください。';
global_message['photo_yightbox_p']['get_photolist_error'] = '写真を表示できませんでした。しばらく時間をおいて再度お試しください。';
global_message['photo_yightbox_p']['photolist_empty'] = '写真がありません。';
global_message['photo_page_tag'] = {};
global_message['photo_page_tag']['tag_is_null'] = 'タグを入力してください。';
global_message['photo_page_tag']['invalid_tag'] = 'タグに使用できない文字があります。[<a href="' + global_substitute_word + '">タグに使用できない文字</a>]';
global_message['photo_page_tag']['too_long_tags'] = 'タグが長すぎます。半角1文字以上、全角20文字以内で入力してください。';
global_message['photo_page_tag']['too_long_tags_string'] = '一度につけられたタグの文字数が400文字を超えています。あわせて400文字以内でタグをつけてください。';
global_message['photo_page_tag']['too_many_tags'] = 'タグの数が上限の300個を超えるため、新しいタグをつけることはできません。';
global_message['photo_page_tag']['too_many_tags_for_photo'] = '1つの写真につけられるタグは20個までです。';
global_message['photo_page_tag']['add_api_error'] = 'タグが追加できませんでした。';
global_message['photo_page_tag']['remove_api_error'] = 'タグを削除できませんでした。';
global_message['photo_page_tag']['confirm_delete'] = 'タグ「'+ global_substitute_word +'」をこの写真から削除します。';
global_message['photo_page_tag']['black_tag'] = '不正なタグが含まれています。';
global_message['photo_page_tag']['loading'] = '読み込み中';
global_message['photo_page_tag']['read_api_error'] = 'タグが読み込めませんでした。';
global_message['photo_page_tag']['no_tag_data'] = 'タグがありません。';
global_message['photo_page_tag']['select_tags'] = '選択';
global_message['photo_page_tag']['display_all_tags'] = '一覧';
global_message['photo_acl'] = {};
global_message['photo_acl']['api_error'] = '公開範囲を変更できませんでした。';
global_message['photo_acl']['done'] = '写真の公開範囲を変更しました。';
global_message['albums'] = {};
global_message['albums']['confirm_delete'] = 'アルバム「'+ global_substitute_word +'」を削除するとアルバム、コメントは削除され元に戻せません。\n写真は投稿した人の写真一覧に残ります。';
global_message['albums']['confirm_delete_comment'] = 'このコメントを削除します。';
global_message['albums']['title_empty'] = 'アルバムタイトルを入力してください。';
global_message['albums']['title_too_long'] = 'アルバムタイトルが長すぎます。全角64文字以内で入力してください。';
global_message['albums']['desc_too_long'] = 'アルバムの説明が長すぎます。全角1000文字以内で入力してください。';
global_message['albums']['photo_not_found'] = 'アルバムの中に写真がありません。';
global_message['albums']['detach_photo_done'] = 'アルバムから写真を外しました。';
global_message['albums']['attach_photo_done'] = 'アルバムに写真を入れました。';
global_message['batch'] = {}
global_message['batch']['nocheck'] = '写真が選択されていません。';
global_message['batch']['detach_photo'] = '選択した写真をアルバムから外します。よろしいですか？';
global_message['batch']['attach_photo_album'] = '選択した写真をアルバムに追加します。よろしいですか？';
global_message['batch']['attach_photo_community'] = '「共有アルバム」「合い言葉制共有アルバム」に写真を入れると、写真の公開範囲にかかわらず、アルバムを見れる\n人は誰でも写真を見られます。選択した写真をこのアルバムに入れます。';
global_message['batch']['delete_photo'] = '選択した写真を削除します。ほかのYahoo!サービスでも公開している場合、\nそのサービス上でも写真は削除されます。よろしいですか？';
global_message['photo']['confirm_atach_photo'] = 'この写真をアルバム「' + global_substitute_word + '」に入れます。';
global_message['photo']['confirm_atach_photo2'] = '写真をこのアルバムに入れます。';
global_message['photo']['confirm_community_atach_photo'] = '「共有アルバム」「合い言葉制共有アルバム」に写真を入れると、写真の公開範囲にかかわらず、アルバムを見れる\n人は誰でも写真を見られます。';
global_message['photo']['confirm_detach_photo'] = 'この写真をアルバム「' + global_substitute_word + '」から外します。';
global_message['photo']['confirm_detach_photo2'] = 'この写真をアルバムから外します。';
global_message['photo']['detach_photo_done'] = '写真をアルバムから外しました。';
global_message['photo']['attach_photo_done'] = '写真をアルバムに入れました。';
global_message['photo']['remove_tag_done'] = '写真のタグを削除しました。';
global_message['photo']['remove_photo_api_error'] = 'アルバムから写真を削除できませんでした。';
global_message['photo']['attach_photo_api_error'] = 'アルバムに写真を追加できません。';
global_message['account'] = {};
global_message['account']['confirm_mobile_edit'] = '投稿先メールアドレスを変更します。' ;
global_message['account']['confirm_mobile_get'] = '投稿先メールアドレスを取得します。' ;
global_message['rotatebox'] = {};
global_message['rotatebox']['rotate_error'] = '写真を回転できませんでした。';
global_message['common_error'] = {};
global_message['common_error']['connection_failure'] = 'エラーが発生しました。';
global_message['api_error_code_common_message'] = {};
var global_done = {};
global_done['photo'] = {};
global_done['photo']['attach_photo_done'] = 211;
global_done['photo']['detach_photo_done'] = 212;
global_done['albums'] = {};
global_done['albums']['attach_photo_done'] = 250;
global_done['albums']['detach_photo_done'] = 251;
global_done['albums']['rotate_photo_done'] = 219;
function _message_substitute(raw_message,substitute_data){
return raw_message.replace( global_substitute_word, substitute_data );
}
function _api_error_message(api_name,error_code){
call_api_error_message_hash = api_name.split(".").join("_");
return global_message[call_api_error_message_hash][error_code];
}
YAHOO.namespace('disp');
YAHOO.disp.pullDown = function( type ) {
if(document.getElementById(type + "_list").style.display == "none")
{
document.getElementById(type + "_list").style.display = "block";
document.getElementById("more_" + type).style.display = "none";
}
}
YAHOO.disp.getEmbed = function(url,x,y)
{
var str = "";
var image_tag = '<img src="' + url + '" width="' + y + '" height="' + x + '">';
var y_blog_tag = '[[img(' + url + ',' + y + ',' + x + ')]]';
var wiki_url = global_helpurl['wiki'];
var blog_url = global_helpurl['blog'];
str += '<div class="jsAttach moduleTypeJ">';
str += '<div class="jsTitle">';
str += '<strong>ブログやホームページにはろう！</strong>';
str += '</div>';
str += '<div class="containerMain">';
str += '<dl class="normal">';
str += '<dt>';
str += '<span class="square">■</span>はり付け用URL';
str += '</dt>';
str += '<dd>';
str += '<span class="item">写真サイズ：</span><span class="data">幅' + y + 'px×縦' + x + 'px</span>';
str += '</dd>';
str += '<dd>';
str += '※Yahoo!ブログには対応していません。';
str += '</dd>';
str += '<dd>';
str += '<input type="text" name="" value=\'' + image_tag + '\' size="30" class="inputTextAttach" onclick="this.focus();this.select();">';
str += '</dd>';
str += '</dl>';
str += '<dl class="blog">';
str += '<dt>';
str += '<span class="square">■</span>Yahoo!ブログ対応URL';
str += '</dt>';
str += '<dd>';
str += '<span class="item">写真サイズ：</span><span class="data">幅' + y + 'px×縦' + x + 'px</span>';
str += '</dd>';
str += '<dd>';
str += 'Wiki文法で投稿してください。';
str += '</dd>';
str += '<dd class="helpLink">';
str += '<a href="' + wiki_url + '" target="new"><img src="http://i.yimg.jp/images/common/helpicon.gif" alt="ヘルプ" width="13" height="15" class="helpIcon">Wiki文法について</a><br>';
str += '<a href="' + blog_url + '" target="new"><img src="http://i.yimg.jp/images/common/helpicon.gif" alt="ヘルプ" width="13" height="15" class="helpIcon">Yahoo!ブログの推奨環境</a>';
str += '</dd>';
str += '<input type="text" name="" value="' + y_blog_tag + '" size="30" class="inputTextAttach" onclick="this.focus();this.select();">';
str += '</dd>';
str += '</dl>';
str += '</div>';
str += "<div class=\"closeWindow\"><a href=\"#\" onclick=\"document.getElementById('embed').style.display = 'none';return false;\"><img src=\"http://i.yimg.jp/images/socialproducts/album/jsCloseBtn_61x19.gif\" alt=\"閉じる\" width=\"61\" height=\"19\"></a></div>";
str += '</div>';
var div = document.createElement("div");
div.innerHTML = str;
div.id = "embed";
div.style.position = "absolute";
div.style.overflow = "visible";
div.style.display = "block";
div.style.backgroundColor = "#ffffff";
return div;
}
YAHOO.disp.showEmbed = function(url, x, y)
{
var emb = document.getElementById("embed");
var objBody = document.getElementById("stick");
var embed = YAHOO.disp.getEmbed ( url, x, y );
if(emb)
{
if(emb.style.display == "block")
{
emb.style.display = "none";
return;
}
else
{
emb.style.display = "block";
return;
}
}
objBody.appendChild(embed);
}
YAHOO.disp.showDoneMessage = function(id, message, column)
{
var top = '';
var bottom = '';
if(column == 'left'){
top = 'roundCorner634Top';
bottom = 'roundCorner634Bottom';
} else {
top = 'roundCorner716Top';
bottom = 'roundCorner716Bottom';
}
var str = '<div class="' + top + '">';
str += '<span class="message">'+message+'</span>';
str += '</div>';
str += '<div class="' + bottom + '"></div>';
var obj = document.getElementById("topDoneMessage");
if ( obj ){
div = obj;
} else {
var div = document.createElement("div");
div.className = "doneMessage";
div.id = "topDoneMessage";
var subObj = document.getElementById(id);
subObj.insertBefore(div, subObj.firstChild);
}
div.innerHTML = str;
}
YAHOO.disp.setCripBord = function(txt)
{
if(navigator.appName.indexOf("Microsoft Internet Explorer") > -1){
window.clipboardData.setData("text",txt);
}
}
YAHOO.namespace('input');
YAHOO.input.is_photo = true;
YAHOO.input.init_page_title_div = function(item_id, is_photo) {
YAHOO.input.is_photo = is_photo;
var div = YAHOO.input.init_generic_title_div(item_id, global_items);
div.getInput = function() {
if ( YAHOO.input.is_photo ) {
return "<input type=\"text\" name=\"content\" value=\"" + escape_for_text(this.form_content) + "\" size=\"50\" class=\"inputText\">";
} else {
return "<input type=\"text\" name=\"content\" value=\"" + escape_for_text(this.form_content) + "\" size=\"20\" class=\"inputText\">";
}
};
if(div.hideTimer){
clearTimeout(div.hideTimer);
}
div.hideTimer = setTimeout("var el = document.getElementById(\"" + div.id + "\"); if (el) el.unhighlight();", 2000);
return true;
};
YAHOO.input.init_generic_title_div = function(item_id, global_items) {
var div = document.getElementById("title_div" + item_id);
div.hash_id = item_id;
if (!global_items[div.hash_id]) {
return false;
}
div.form_content = global_items[div.hash_id].title.toString();
div.emptyText = "<i>" + global_message['photo_title']['blank_string'] + "</i>&nbsp;";
if(!_ok_for_jax()){
div.title = "";
div.emptyText = "&nbsp;";
}
div.saveChanges = function(val) {
var length = getStringWidth(val.content.value);
var is_invalid = false;
var validate_msg = '';
if (length == 0){
is_invalid = true;
validate_msg = global_message['photo_title']['empty'];
}
var title_max = (YAHOO.input.is_photo) ? global_maxlength['photo_title']:global_maxlength['album_title'];
if (length/3 > title_max){
is_invalid = true;
validate_msg = global_message['photo_title']['too_long'];
}
if (is_invalid){
var form_inner_el = (YAHOO.input.is_photo) ? this.form_div.firstChild.firstChild : this.form_div.firstChild;
form_inner_el.childNodes[0].innerHTML = validate_msg;
form_inner_el.childNodes[0].style.display = "block";
form_inner_el.content.focus();
return false;
}
var div_tmp = (YAHOO.input.is_photo) ? this: this.firstChild;
global_items[this.hash_id].title = val.content.value;
div_tmp.innerHTML = "<i><span style=\"color:#AAA;font-size:10pt;\">" + global_message['photo_title']['saving'] + "</span></i>&nbsp;";
this.endEditing();
if (!global_items[this.hash_id]) {
return false;
}
editing_item_id = this.hash_id;
var vaitality_store_flag = YAHOO.input.checkVitalityLimit(global_items[this.hash_id].create);
if (YAHOO.input.is_photo){
var pars = {
method:"photos.setMeta"
,photo_id:this.hash_id
,title:global_items[this.hash_id].title
,title_o:global_items[this.hash_id].title_o
,desc:global_items[this.hash_id].description
,vitality:vaitality_store_flag
,owner_id:global_items[this.hash_id].owner_id
,acl:global_items[this.hash_id].acl_read
};
} else {
var album_type = 'my';
if(global_items[this.hash_id].type != 'my'){
album_type = global_items[this.hash_id].acl_join == 0 ? 'community' : 'password';
}
var method_name = (global_items[this.hash_id].type == 'my') ? 'albums':'community';
var pars = {
method:method_name+".setMeta"
,album_id:this.hash_id
,title:global_items[this.hash_id].title
,title_o:global_items[this.hash_id].title_o
,desc:global_items[this.hash_id].description
,vitality:vaitality_store_flag
,owner_id:global_items[this.hash_id].owner_id
,acl_join:global_items[this.hash_id].acl_join
,type:album_type
};
}
CallApiRequestWithYUI(pars, YAHOO.input.title_setMeta_onLoad);
};
return YAHOO.input.init_editable_div(div);
};
YAHOO.input.init_editable_div = function(div) {
div.startEditing = function() {
if(!_ok_for_jax()){return;}
window.should_I_ignore_stuff_because_of_editable_div_action = 1;
this.isEditing = true;
this.unhighlight();
this.style.display = "none";
var form_div_el = this.getForm_div();
form_div_el.style.display = "block";
if (YAHOO.input.is_photo){
var txtarea_el = form_div_el.firstChild.firstChild;
input_editing++;
} else {
var txtarea_el = form_div_el.firstChild;
if( div.id == 'title_div'+ div.hash_id ){
YAHOO.util.Dom.removeClass(form_div_el.parentNode,'title');
YAHOO.util.Dom.addClass(form_div_el.parentNode,'titleWide');
document.getElementById("editAlbum").style.display = "none";
}
}
txtarea_el.content.focus();
};
div.endEditing = function() {
window.should_I_ignore_stuff_because_of_editable_div_action = 0;
this.isEditing = false;
var form_div_el = this.getForm_div();
form_div_el.innerHTML = "";
form_div_el.style.display = "none";
this.style.display = "block";
if (YAHOO.input.is_photo){
input_editing--;
}
else if (div.id == 'title_div'+ div.hash_id){
YAHOO.util.Dom.removeClass(form_div_el.parentNode,'titleWide');
YAHOO.util.Dom.addClass(form_div_el.parentNode,'title');
document.getElementById("editAlbum").style.display = "block";
}
};
div.getForm_div = function() {
if (!this.form_div) {
this.form_div = document.createElement("div");
this.parentNode.insertBefore(this.form_div, this);
this.form_div.display_div = this;
}
var str = "";
if (YAHOO.input.is_photo){
str += "<h1>";
parent_node = 'parentNode.parentNode';
} else {
if( div.id == 'description_div'+ div.hash_id ){
YAHOO.util.Dom.addClass(this.form_div, 'albumDescription');
}
parent_node = 'parentNode';
}
str += "<form onsubmit=\"this." + parent_node + ".display_div.saveChanges(this); return false;\" class=\"actionForm\">";
str += "<p class=\"formErrorMessage\" style=\"display: none;\"></p>";
str += this.getInput();
str += "<div class=\"buttonContainer\">";
str += "<input type=\"submit\" class=\"submit\" value=\"" + global_message['photo_title']['save_button'] + "\" />";
str += "<input type=\"reset\" class=\"reset\" value=\"" + global_message['photo_title']['cancel_button'] + "\" onclick=\"this.form." + parent_node + ".display_div.endEditing();\" /></div></form>";
if (YAHOO.input.is_photo){
str += "</h1>";
}
this.form_div.innerHTML = str;
return this.form_div;
};
div.onclick = div.startEditing;
div.onmouseover = function() {
this.highlight();
};
div.onmouseout = function() {
if (this.hideTimer) {
clearTimeout(this.hideTimer);
} this.hideTimer = setTimeout("var el = document.getElementById(\"" + this.id + "\"); if (el) el.unhighlight();", 1000);
};
div.highlight = function() {
if (this.hideTimer) {
clearTimeout(this.hideTimer);
}
var highlight_col = '#ffffd3';
if (!YAHOO.input.is_photo){
if (global_items[div.hash_id].type == 'my'){
highlight_col = '#e4f0fc';
} else {
highlight_col = (global_items[div.hash_id].acl_join == 1) ? '#ffedeb':'#fde8cd';
}
}
var div_tmp = div;
if (!YAHOO.input.is_photo){
div_tmp = div.firstChild;
}
div_tmp.style.backgroundColor = highlight_col;
if (this.emptyText && (div_tmp.innerHTML == "&nbsp;" || div_tmp.innerHTML == "" || div_tmp.innerHTML.charCodeAt(0) == 160)) {
div_tmp.style.color = "#888";
div_tmp.innerHTML = this.emptyText;
}
};
div.unhighlight = function() {
if (this.hideTimer) {
clearTimeout(this.hideTimer);
}
var div_tmp = div;
if (!YAHOO.input.is_photo){
div_tmp = div.firstChild;
}
div_tmp.style.backgroundColor = "";
if (this.emptyText && div_tmp.innerHTML.toUpperCase() == this.emptyText.toUpperCase()) {
div_tmp.innerHTML = "&nbsp;";
div_tmp.style.color = "#000";
}
};
return div;
};
YAHOO.input.init_page_description_div = function(item_id, is_photo){
YAHOO.input.is_photo = is_photo;
var div = YAHOO.input.init_generic_description_div(item_id, global_items);
var cols = (YAHOO.input.is_photo) ? 50 : 20;
div.getInput = function() {
return "<textarea name=\"content\" cols=\"" + cols + "\" rows=\"6\" class=\"textarea\">" + escape_for_text(this.form_content) + "</textarea>";
};
if(div.hideTimer){
clearTimeout(div.hideTimer);
}
div.hideTimer = setTimeout("var el = document.getElementById(\"" + div.id + "\"); if (el) el.unhighlight();", 2000);
return true;
};
YAHOO.input.init_generic_description_div = function(pid, global_items) {
var div = document.getElementById("description_div" + pid);
div.hash_id = pid;
if (!global_items[div.hash_id]) {
return false;
}
div.form_content = global_items[div.hash_id].description.toString();
div.emptyText = "<i>" + global_message['photo_description']['blank_string'] + "</i>&nbsp;";
if (!YAHOO.input.is_photo){
div.emptyText = "<i>" + global_message['album_description']['blank_string'] + "</i>&nbsp;";
}
if(!_ok_for_jax()){
div.title = "";
div.emptyText = "<i></i>&nbsp;";
}
var div_tmp = (YAHOO.input.is_photo) ? div: div.firstChild;
if (div_tmp.innerHTML == "&nbsp;" || div_tmp.innerHTML == "" || div_tmp.innerHTML.charCodeAt(0) == 160){
div_tmp.style.color = "#888";
div_tmp.innerHTML = div.emptyText;
}
div.saveChanges = function(val) {
var length = getStringWidth(val.content.value);
var is_invalid = false;
var validate_msg = '';
var desc_max = (YAHOO.input.is_photo) ? global_maxlength['photo_desc']:global_maxlength['album_desc'];
if (length/3 > desc_max){
is_invalid = true;
validate_msg = (YAHOO.input.is_photo) ? global_message['photo_description']['too_long']
: global_message['album_description']['too_long'];
}
if (is_invalid){
var form_inner_el = (YAHOO.input.is_photo) ? this.form_div.firstChild.firstChild : this.form_div.firstChild;
form_inner_el.childNodes[0].innerHTML = validate_msg;
form_inner_el.childNodes[0].style.display = "block";
form_inner_el.content.focus();
return false;
}
global_items[this.hash_id].description = val.content.value;
var div_tmp = (YAHOO.input.is_photo) ? this: this.firstChild;
div_tmp.innerHTML = "<i><span style=\"color:#AAA;\">" + global_message['photo_description']['saving'] + "</span></i>&nbsp;";
this.endEditing();
if (!global_items[this.hash_id]) {
return false;
}
editing_item_id = this.hash_id;
if (YAHOO.input.is_photo){
var pars = {
method:"photos.setMeta"
,photo_id:this.hash_id
,title:global_items[this.hash_id].title
,desc:global_items[this.hash_id].description
,vitality:0
,owner_id:global_items[this.hash_id].owner_id
,acl:global_items[this.hash_id].acl_read
};
} else {
var method_name = (global_items[this.hash_id].type == 'my') ? 'albums':'community';
var pars = {
method:method_name+".setMeta"
,album_id:this.hash_id
,title:global_items[this.hash_id].title
,desc:global_items[this.hash_id].description
,vitality:0
,owner_id:global_items[this.hash_id].owner_id
,acl_join:global_items[this.hash_id].acl_join
};
}
CallApiRequestWithYUI(pars, YAHOO.input.description_setMeta_onLoad);
};
return YAHOO.input.init_editable_div(div);
};
YAHOO.input.title_setMeta_onLoad = {
success:function(_Req) {
var div = document.getElementById("title_div" + editing_item_id );
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if (stat == 'ok') {
if (YAHOO.input.is_photo){
var pars = {
method:"photos.getInfo"
,photo_id:editing_item_id
};
} else {
var method_name = (global_items[editing_item_id].type == 'my') ? 'albums':'community';
var pars = {
method:method_name + ".getInfo"
,album_id:editing_item_id
};
}
CallApiRequestWithYUI(pars, YAHOO.input.getInfo_onLoad);
} else {
alert(global_message['photo_title']['api_error']);
YAHOO.input.title_setMeta_onLoad_failure(div);
}
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
YAHOO.input.title_setMeta_onLoad_failure(div);
}
}
YAHOO.input.title_setMeta_onLoad_failure = function(div) {
global_items[div.hash_id].title = div.form_content;
if (YAHOO.input.is_photo){
div.innerHTML = short_strimwidth(div.form_content);
} else {
div.innerHTML = '<strong>' + short_strimwidth(div.form_content) + '</strong>';
}
}
YAHOO.input.description_setMeta_onLoad = {
success:function(_Req){
var div = document.getElementById("description_div" + editing_item_id );
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if (stat == 'ok') {
if (YAHOO.input.is_photo){
var pars = {
method:"photos.getInfo"
,photo_id:editing_item_id
};
} else {
var method_name = (global_items[editing_item_id].type == 'my') ? 'albums':'community';
var pars = {
method:method_name + ".getInfo"
,album_id:editing_item_id
};
}
CallApiRequestWithYUI(pars, YAHOO.input.getInfo_onLoad);
} else {
alert(global_message['photo_description']['api_error']);
YAHOO.input.description_setMeta_onLoad_failure(div);
}
},
failure:function(){
alert(global_message['common_error']['connection_failure']);
YAHOO.input.description_setMeta_onLoad_failure(div);
}
}
YAHOO.input.description_setMeta_onLoad_failure = function(div) {
if (YAHOO.input.is_photo){
div.innerHTML = short_strimwidth(div.form_content).nl2br();
} else {
div.innerHTML = '<p>' + short_strimwidth(div.form_content).nl2br() + '&nbsp;</p>';
}
}
YAHOO.input.getInfo_onLoad = {
success:function(_Req) {
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
var title_div = document.getElementById("title_div" + editing_item_id);
var title_div_tmp = title_div;
var description_div = document.getElementById("description_div" + editing_item_id);
var description_div_tmp = description_div;
if (!YAHOO.input.is_photo){
description_div_tmp = description_div.firstChild;
title_div_tmp = title_div.firstChild;
}
if ( stat == 'ok' ){
if (YAHOO.input.is_photo){
req_title = Req.photo.title;
req_desc = Req.photo.desc;
} else {
if ( global_items[editing_item_id].type === 'my' ){
req_title = Req.album.title;
req_desc = Req.album.description;
} else {
req_title = Req.community.title;
req_desc = Req.community.description;
}
}
if(req_title._content){
global_items[editing_item_id].title = req_title._content;
var title_wbr = short_strimwidth(global_items[editing_item_id].title,0);
title_div_tmp.innerHTML = title_wbr + "&nbsp;";
}
else{
global_items[editing_item_id].title = "";
title_div_tmp.innerHTML = global_items[editing_item_id].title + "&nbsp;";
}
if(req_desc._content){
global_items[editing_item_id].description = req_desc._content;
description_div_tmp.style.color = "#000";
var description_wbr = short_strimwidth(global_items[editing_item_id].description,0);
description_div_tmp.innerHTML = description_wbr.nl2br() + "&nbsp;";
}
else{
global_items[editing_item_id].description = "";
description_div_tmp.innerHTML = global_items[editing_item_id].description + "&nbsp;";
}
if (title_div.emptyText && (title_div_tmp.innerHTML == "&nbsp;" || title_div_tmp.innerHTML == "" || title_div_tmp.innerHTML.charCodeAt(0) == 160)) {
title_div_tmp.style.color = "#888";
title_div_tmp.innerHTML = title_div.emptyText;
}
if (description_div.emptyText && (description_div_tmp.innerHTML == "&nbsp;" || description_div_tmp.innerHTML == "" || description_div_tmp.innerHTML.charCodeAt(0) == 160)) {
description_div_tmp.style.color = "#888";
description_div_tmp.innerHTML = description_div.emptyText;
}
title_div.form_content = global_items[editing_item_id].title;
description_div.form_content = global_items[editing_item_id].description;
}
else{
alert(global_message['common_error']['connection_failure']);
title_div_tmp.innerHTML = escape_for_text(title_div.form_content);
description_div_tmp.innerHTML = description_div.form_content.nl2br();
}
},
failure:function(){
alert(global_message['common_error']['connection_failure']);
}
}
YAHOO.input.start_acl_editing = function(pid) {
var div = _ge("acl_div");
div.hash_id = pid;
div.style.display = "none";
_ge("acl_edit_div").style.display = "";
input_editing++;
}
YAHOO.input.end_acl_editing = function() {
_ge("acl_div").style.display = "";
_ge("acl_edit_div").style.display = "none";
input_editing--;
}
YAHOO.input.acl_read = {};
YAHOO.input.acl_read['type'] = {};
YAHOO.input.acl_read['type'][0] = '公開しない';
YAHOO.input.acl_read['type'][2] = '友だちまで';
YAHOO.input.acl_read['type'][3] = '友だちの友だちまで';
YAHOO.input.acl_read['type'][4] = 'ログインしている人';
YAHOO.input.acl_read['type'][5] = 'インターネット全体';
YAHOO.input.acl_read['img'] = {};
YAHOO.input.acl_read['img'][0] = 'http://i.yimg.jp/images/socialproducts/common/aclPrivate_15.gif';
YAHOO.input.acl_read['img'][2] = 'http://i.yimg.jp/images/socialproducts/common/aclFriends_15.gif';
YAHOO.input.acl_read['img'][3] = 'http://i.yimg.jp/images/socialproducts/common/aclFriends_15.gif';
YAHOO.input.acl_read['img'][4] = 'http://i.yimg.jp/images/socialproducts/common/aclFriends_15.gif';
YAHOO.input.acl_read['img'][5] = 'http://i.yimg.jp/images/socialproducts/common/aclPublic_15.gif';
YAHOO.input.save_acl_changes = function(val) {
var acl_val = val.acl_read.value;
if ( YAHOO.input.acl_read['type'][acl_val] == undefined ){
return false;
}
var div = _ge("acl_div");
div.acl_val = acl_val;
div.innerHTML = "<i><span style=\"color:#AAA;font-size:10pt;\">" + global_message['photo_title']['saving'] + "</span></i>";
YAHOO.input.end_acl_editing();
var vaitality_store_flag = YAHOO.input.checkVitalityLimit(global_items[div.hash_id].create);
var pars = {
method:"photos.setPerms"
,photo_id:div.hash_id
,acl_read:acl_val
,acl_read_o:global_items[div.hash_id].acl_read
,owner_id:global_items[div.hash_id].owner_id
,title:global_items[div.hash_id].title
,vitality:vaitality_store_flag
};
CallApiRequestWithYUI(pars, YAHOO.input.acl_setPerms_onLoad);
}
YAHOO.input.acl_setPerms_onLoad = {
success:function(_Req) {
var div = _ge("acl_div");
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if (stat == 'ok') {
YAHOO.input.rebuild_acl(div.acl_val);
global_items[div.hash_id].acl_read = div.acl_val;
YAHOO.disp.showDoneMessage("main", global_message['photo_acl']['done'], 'left');
} else {
alert(global_message['photo_acl']['api_error']);
YAHOO.input.rebuild_acl(global_items[div.hash_id].acl_read);
}
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
}
YAHOO.input.rebuild_acl = function(acl_val) {
var div = _ge("acl_div");
var str = '<img src="' + YAHOO.input.acl_read['img'][acl_val] + '" alt="' + YAHOO.input.acl_read['type'][acl_val] + '" width="15" height="15" class="aclIcon">' + YAHOO.input.acl_read['type'][acl_val];
str += "<span class=\"edit\">［ <a href=\"/photos/" + div.hash_id + "/acl/\" onclick=\"YAHOO.input.start_acl_editing('" + div.hash_id + "');return false;\">変更</a> ］</span>";
div.innerHTML = str;
}
YAHOO.input.checkVitalityLimit = function(create) {
var vitality_limit = 604800000; // 60*60*24*7*1000
var vaitality_store_flag = 0;
var nowDate = new Date();
if ( (nowDate.getTime() - Date.parse(create)) <= vitality_limit ){
vaitality_store_flag = 1;
}
return vaitality_store_flag;
}
YAHOO.namespace('albums');
YAHOO.albums.pid = '';
YAHOO.albums.aid = '';
YAHOO.albums.action = '';
YAHOO.albums.editing = false;
YAHOO.albums.is_album_select = false;
YAHOO.albums.detachPhoto = function(pid, aid, type, album, redirect_url) {
if (window.confirm(_message_substitute(global_message['photo']['confirm_detach_photo'],album))) {
if (!_ok_for_jax()) {
return true;
}
else{
YAHOO.albums.pid = pid;
YAHOO.albums.aid = aid;
if(type == 'my'){
method = 'albums.detachPhoto';
} else {
method = 'community.detachPhoto';
}
var pars = {
method:method
,album_id:aid
,photo_id:pid
};
CallApiRequestWithYUI(
pars,
{
success:function(_Req) {
var flag = false;
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ){
flag = true;
}
if (flag) {
location.href = redirect_url;
}
else {
alert(global_message['photo']['remove_photo_api_error']);
}
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
}
);
return false;
}
}
else {
return false;
}
}
YAHOO.albums.attachDetachPhoto = function(pid, aid, type, action, is_album_select ) {
YAHOO.albums.is_album_select = is_album_select;
if (!_ok_for_jax()) {
return true;
}
else{
if ( YAHOO.albums.editing ) {
return false;
}
YAHOO.albums.editing = true;
YAHOO.albums.pid = pid;
YAHOO.albums.aid = aid;
var name = (type == 'my') ? 'albums' : 'community';
var action_name = (action == global_albums['attach']) ? 'attach' : 'detach';
YAHOO.albums.action = action;
var method = name + '.' + action_name + 'Photo';
var pars = {
method:method
,album_id:aid
,photo_id:pid
};
CallApiRequestWithYUI(pars,YAHOO.albums.attachDetachPhoto_onLoad);
return false;
}
}
YAHOO.albums.attachDetachPhoto_onLoad = {
success:function(_Req) {
var flag = false;
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ){
flag = true;
}
if (flag) {
YAHOO.albums.attachedDetachedPhotoSelect();
}
else {
YAHOO.albums.editing = false;
var msg = (YAHOO.albums.action == global_albums['attach']) ? 'attach_photo_api_error' : 'remove_photo_api_error';
alert(global_message['photo'][msg]);
}
},
failure:function() {
YAHOO.albums.editing = false;
alert(global_message['common_error']['connection_failure']);
}
}
YAHOO.albums.attachedDetachedPhotoSelect = function() {
var el_id = YAHOO.albums.pid;
var msg = 'photo';
var max = global_limit['one_album_photos'];
var count_photo_js = 1;
if ( YAHOO.albums.is_album_select ){
el_id = YAHOO.albums.aid;
msg = 'albums';
max = global_limit['one_photo_attach_albums'];
var count_photo_js = parseInt(document.getElementById("count_photo_"+YAHOO.albums.aid).innerHTML);
}
var str = global_albums['attach_str'];
var msg2 = 'detach_photo_done';
var val = global_albums['attach'];
var count_js_pre = count_js;
if ( YAHOO.albums.action == global_albums['attach'] ){
count_js +=1;
count_photo_js +=1;
str = global_albums['detach_str'];
msg2 = 'attach_photo_done';
val = global_albums['detach'];
} else {
count_js -=1;
count_photo_js -=1;
}
event_ids[el_id] = val;
document.getElementById("str_" + el_id).innerHTML = str;
YAHOO.disp.showDoneMessage("sub", global_message[msg][msg2], 'right');
YAHOO.albums.editing = false;
if ( !YAHOO.albums.is_album_select ){
document.getElementById("count_photo").innerHTML = count_js + '枚';
} else {
document.getElementById("count_photo_"+YAHOO.albums.aid).innerHTML = count_photo_js;
}
if ( count_js == max || count_js_pre == max ){
var d = ( list_url.indexOf('?') == -1 ) ? '?' : '&' ;
location.href = list_url + d + 'n=' + global_done[msg][msg2];
}
}
YAHOO.namespace('tagrs');
YAHOO.tagrs.clearForm = function() {
document.forms.tagadderform.tag.value = "";
var validate_msg_el = _ge("validateMsgAddTag");
validate_msg_el.innerHTML = "";
validate_msg_el.style.display = "none";
}
YAHOO.tagrs.global_i = 0;
YAHOO.tagrs.global_tagval_arr = null;
YAHOO.tagrs.addTag = function(pid, tagval) {
if (!_ok_for_jax()) {
return true;
}
YAHOO.tagrs.global_i = 0;
YAHOO.tagrs.global_tagval_arr = null;
var tagval_nodelim = tagval.ph_replace(" ", "").ph_replace(",", "").ph_replace("　", "");
var length = getStringWidth(tagval_nodelim);
var is_invalid = false;
var validate_msg = '';
if (length/3 > global_maxlength['photo_tags_string']){
is_invalid = true;
validate_msg = global_message['photo_page_tag']['too_long_tags_string'];
}
if ( !is_invalid && tagval == "" ){
is_invalid = true;
validate_msg = global_message['photo_page_tag']['tag_is_null'];
document.forms.tagadderform.tag.focus();
}
if ( !is_invalid ){
YAHOO.tagrs.global_tagval_arr = tagval.ph_replace("　", ",").ph_replace(" ", ",").split(",");
for ( var i=0; i<YAHOO.tagrs.global_tagval_arr.length; i++ ){
if ( getStringWidth(YAHOO.tagrs.global_tagval_arr[i])/3 > global_maxlength['photo_tags'] ){
is_invalid = true;
validate_msg = global_message['photo_page_tag']['too_long_tags'];
}
}
}
if ( !is_invalid ){
if ( !inInvalidCharForTags(tagval) ) {
is_invalid = true;
validate_msg = _message_substitute(global_message['photo_page_tag']['invalid_tag'], global_helpurl['tag_invalid_char']);
}
}
if (is_invalid){
var validate_msg_el = _ge("validateMsgAddTag");
validate_msg_el.innerHTML = validate_msg;
validate_msg_el.style.display = "block";
return false;
}
YAHOO.tagrs.clearForm();
var tagadder = _ge("tagadder");
tagadder.photos_addTags_onLoad_noaction = {
success:function(){},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
}
tagadder.photos_addTags_onLoad = {
success:function(_Req) {
var flag = false;
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ){
flag = true;
}
if (!flag){
var err_code = Req.err.code;
if ( err_code === 2009 ){ // black tag
alert(global_message['photo_page_tag']['black_tag']);
} else {
alert(global_message['photo_page_tag']['add_api_error']);
}
}
var pars = {
method:"photos.getInfo"
,photo_id:pid
};
CallApiRequestWithYUI(pars,_ge("tagadder").photos_getInfo_onLoad);
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
};
YAHOO.tagrs.addTagAction(pid, YAHOO.tagrs.global_tagval_arr);
return false;
}
YAHOO.tagrs.addTagAction = function(pid) {
if (YAHOO.tagrs.global_i+1 <= YAHOO.tagrs.global_tagval_arr.length) {
var tagadder = _ge("tagadder");
var func = tagadder.photos_addTags_onLoad_noaction;
if ( YAHOO.tagrs.global_i+1 == YAHOO.tagrs.global_tagval_arr.length ){
func = tagadder.photos_addTags_onLoad;
}
tags = YAHOO.tagrs.global_tagval_arr[YAHOO.tagrs.global_i];
var pars = {
method:"photos.addTags"
,photo_id:pid
,tags:tags
};
CallApiRequestWithYUI(pars, func);
YAHOO.tagrs.global_i++;
setTimeout(function() {YAHOO.tagrs.addTagAction(pid);}, 100);
}
}
YAHOO.tagrs.rebuildTagsHTML = function(pid, tid, tag, can_delete) {
var wbr_tag = short_strimwidth(tag, 0);
var html_txt = "<li id=\"tagdiv" + tid + "\"><span class=\"tagLink\"><a href=\"/photos/" + global_items[pid].owner_id + "/tags/" + tid + "/?view=photos\">" + wbr_tag + "</a></span>";
if (can_delete) {
html_txt += "<span class=\"deleteLink\"><a href=\"\" onClick=\"return YAHOO.tagrs.removeTag('" + pid + "', '" + tid + "', '" + escape_for_js(tag) + "');\">［×］</a></span>";
}
return html_txt;
}
YAHOO.tagrs.removeTag = function(pid, tid, tag) {
if (window.confirm(_message_substitute( global_message['photo_page_tag']['confirm_delete'], unescape_for_text(tag) ) )) {
if (!_ok_for_jax()) {
return true;
}
else{
var tagadder = _ge("tagadder");
tagadder.photos_removeTag_onLoad = {
success:function(_Req) {
var flag = false;
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ){
flag = true;
}
if (flag) {
YAHOO.tagrs.removedTag(pid, tid, tag);
}
else {
alert(global_message['photo_page_tag']['remove_api_error']);
}
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
};
var pars = {
method:"photos.removeTag"
,tag_id:tid
,photo_id:pid
};
CallApiRequestWithYUI(pars,_ge("tagadder").photos_removeTag_onLoad);
return false;
}
}
else {
return false;
}
}
YAHOO.tagrs.removedTag = function(id, tid, tag) {
_ge("tagdiv" + tid).style.display = "none";
YAHOO.tagrs.setPopularUnUsedIfNotInInput(tag);
var A = YAHOO.tagrs.whereIsThisTagInHere(global_items[id].tagsA, tag);
for (var r = 0; r < A.length; r++) {
global_items[id].tagsA.splice(A[r], 1);
}
YAHOO.disp.showDoneMessage("main", global_message['photo']['remove_tag_done'], 'left');
}
YAHOO.tagrs.whereIsThisTagInHere = function(_tagsA, _tag) {
var A =[];
for (var t = 0; t < _tagsA.length; t++) {
var tag = _tagsA[t];
if (_tag == tag) {
A.unshift(t);
}
}
return A;
}
YAHOO.tagrs.write = function(pid) {
var tagadder = _ge("tagadder");
if (tagadder) {
tagadder.photos_getInfo_onLoad = {
success:function(_Req) {
var flag = false;
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ){
flag = true;
}
if (flag) {
if ( Req.photo.tags.tag == undefined ){
return false;
}
var tags = Req.photo.tags.tag;
YAHOO.tagrs.rebuild_tags_for_photos(pid, tags);
var gphotos = global_items[pid];
var html_txt = "";
for (var t = 0; t < gphotos.tagsA.length; t++) {
html_txt += YAHOO.tagrs.rebuildTagsHTML(pid, gphotos.tags_idA[t], gphotos.tagsA[t], gphotos.can_edit_tag);
}
html_txt += "<br>";
var div = _ge("thetags");
div.innerHTML = html_txt;
} else {
alert(global_message['common_error']['connection_failure']);
}
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
};
}
}
YAHOO.tagrs.rebuild_tags_for_photos = function(pid, tags)
{
if (global_items[pid] == undefined) {
return;
}
global_items[pid].tagsA =[];
global_items[pid].tags_idA =[];
for (var t = 0; t < tags.length; t++) {
var node = tags[t];
var tag = node._content;
var tid = node.id;
global_items[pid].tagsA.push(tag);
global_items[pid].tags_idA.push(tid);
}
YAHOO.tagrs.updatePopularList(pid);
};
tagrs_popularA =[];
YAHOO.tagrs.showPopular = function(pid, max_tags) {
if (!_ok_for_jax()) {
return false;
}
var addtagbox_el = _ge("addtagbox");
max_tags = (max_tags == undefined) ? global_max['max_tags'] : max_tags;
var div = _ge("tagpopular");
div.innerHTML = "<div class=\"selectTagLink\"><i>" + global_message['photo_page_tag']['loading'] + "</i></div>";
div.tags_getListUserPopular_onLoad = {
success:function(_Req) {
var flag = false;
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ){
flag = true;
}
if (flag) {
tagrs_popularA =[];
var reqtags = Req.tags;
var str = "<div class=\"selectTagList clearFix\">";
var str_showall = '';
if (reqtags.total <= 0) {
str += global_message['photo_page_tag']['no_tag_data'];
}
else {
str += "<div class=\"text\">" + global_message['photo_page_tag']['select_tags'] + "</div>";
var reqtag = reqtags.tag
for (var t = 0; t < reqtag.length; t++) {
var tag = reqtag[t]._content;
tagrs_popularA.push(tag);
str += " <div class=\"addTag\"><a href=\"#\" id=\"popTags" + escape_for_js(tag) + "\" onclick=\"YAHOO.tagrs.toggleTagInInput('" + escape_for_js(tag) + "', '" + pid + "'); return false;\">" + short_strimwidth(tag) + "</a></div>";
}
if (max_tags != global_max['max_tags_all'] && reqtags.total > max_tags) {
str_showall += "<div class=\"seeAll\"><a href=\"#\" onclick=\"YAHOO.tagrs.showPopular('" + pid + "'," + global_max['max_tags_all'] + ");return false;\"><img src=\"http://i.yimg.jp/images/socialproducts/common/seeAll_14.gif\" alt=\"" + global_message['photo_page_tag']['display_all_tags'] + "\" width=\"14\" height=\"14\"></a><a href=\"#\" onclick=\"YAHOO.tagrs.showPopular('" + pid + "'," + global_max['max_tags_all'] + ");return false;\">" + global_message['photo_page_tag']['display_all_tags'] + "</a></div>";
}
}
str += "</div>" + str_showall;
div.innerHTML = str;
YAHOO.tagrs.updatePopularList(pid);
}
else {
div.innerHTML = "";
alert(global_message['photo_page_tag']['read_api_error']);
}
},
failure:function() {
alert(global_message['common_error']['connection_failure']);
}
};
var pars = {
method:"tags.getUserList"
,count:max_tags
};
CallApiRequestWithYUI(pars,_ge("tagpopular").tags_getListUserPopular_onLoad);
}
YAHOO.tagrs.getTagsInInput = function(addtagbox_el) {
var tagval = addtagbox_el.value.trim();
if (tagval == "") {
return[];
}
tagval = escape_for_text(tagval);
var tagval_arr = tagval.ph_replace("\\", "&#92;").ph_replace("　", ",").ph_replace(" ", ",").split(",");
var tag_arr =[];
for (var i = 0; i < tagval_arr.length; i++) {
var bit = tagval_arr[i].trim();
if (bit != "") {
tag_arr.push(bit);
}
}
return tag_arr;
}
YAHOO.tagrs.updatePopularList = function(pid) {
if (!_ok_for_jax()) {
return false;
}
var addtagbox_el = _ge("addtagbox");
var tag_arr = YAHOO.tagrs.getTagsInInput(addtagbox_el);
var tagsA = ((typeof global_items != "undefined") && global_items[pid] && global_items[pid].tagsA) ? global_items[pid].tagsA :[];
for (var t = 0; t < tagrs_popularA.length; t++) {
var tag = tagrs_popularA[t];
var i_tagsA = YAHOO.tagrs.whereIsThisTagInHere(tagsA, tag);
var i_tag_arr = YAHOO.tagrs.whereIsThisTagInHere(tag_arr, tag);
if (i_tagsA.length == 0 && i_tag_arr.length == 0) {
YAHOO.tagrs.setPopularUnUsed(tag);
} else {
YAHOO.tagrs.setPopularUsed(tag);
}
}
}
YAHOO.tagrs.setPopularUsed = function(tag) {
var t = _ge("popTags" + tag);
if (!t) {
return;
}
_d.removeClass(t.parentNode,'addTag');
_d.addClass(t.parentNode,'addedTag');
}
YAHOO.tagrs.setPopularUnUsed = function(tag) {
var t = _ge("popTags" + tag);
if (!t) {
return;
}
_d.removeClass(t.parentNode,'addedTag');
_d.addClass(t.parentNode,'addTag');
}
YAHOO.tagrs.toggleTagInInput = function(tag, pid) {
var tagsA = ((typeof global_items != "undefined") && global_items[pid] && global_items[pid].tagsA) ? global_items[pid].tagsA :[];
var addtagbox_el = _ge("addtagbox");
var tag_arr = YAHOO.tagrs.getTagsInInput(addtagbox_el);
var i_tag_arr = YAHOO.tagrs.whereIsThisTagInHere(tag_arr, tag);
if (i_tag_arr.length == 0) {
if (YAHOO.tagrs.whereIsThisTagInHere(tagsA, tag).length == 0) {
tag_arr.push(tag);
}
YAHOO.tagrs.setPopularUsed(tag);
} else {
for (var r = 0; r < i_tag_arr.length; r++) {
tag_arr.splice(i_tag_arr[r], 1);
}
YAHOO.tagrs.setPopularUnUsed(tag);
}
var popTags_el = _ge("popTags" + tag);
if (popTags_el) {
popTags_el.blur();
}
var tag_str = "";
for (var t = 0; t < tag_arr.length; t++) {
tag_str += tag_arr[t];
if (t + 1 < tag_arr.length) {
tag_str += " ";
}
}
addtagbox_el.value = unescape_for_text(tag_str);
}
YAHOO.tagrs.setPopularUnUsedIfNotInInput = function(tag) {
var t = _ge("popTags" + tag);
if (!t) {
return;
}
var addtagbox_el = _ge("addtagbox");
var tag_arr = YAHOO.tagrs.getTagsInInput(addtagbox_el);
var i_tag_arr = YAHOO.tagrs.whereIsThisTagInHere(tag_arr, tag);
if (i_tag_arr.length > 0) {
return;
}
YAHOO.tagrs.setPopularUnUsed(tag);
};
(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}if(!D){}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(E,H){var G,D,F;if(H){F={};for(G in E){if(B.hasOwnProperty(E,G)){F[G.toLowerCase()]=E[G];}}this.initialConfig=F;}for(G in E){if(B.hasOwnProperty(E,G)){this.queueProperty(G,E[G]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=("<div class=\""+G.CSS_HEADER+"\"></div><div class=\""+G.CSS_BODY+"\"></div><div class=\""+G.CSS_FOOTER+"\"></div>");O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}return H;}function J(){if(!O){K();}return(O.cloneNode(false));}function B(){if(!N){K();}return(N.cloneNode(false));}function C(){if(!E){K();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);
this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(V,U){var R,T,W;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof V=="string"){R=V;V=document.getElementById(V);if(!V){V=(K()).cloneNode(false);V.id=R;}}this.element=V;if(V.id){this.id=V.id;}W=this.element.firstChild;if(W){var Q=false,P=false,S=false;do{if(1==W.nodeType){if(!Q&&F.hasClass(W,G.CSS_HEADER)){this.header=W;Q=true;}else{if(!P&&F.hasClass(W,G.CSS_BODY)){this.body=W;P=true;}else{if(!S&&F.hasClass(W,G.CSS_FOOTER)){this.footer=W;S=true;}}}}}while((W=W.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(U){this.cfg.applyConfig(U,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var P,Q,S;function T(){G.textResizeEvent.fire();}if(!YAHOO.env.ua.opera){Q=F.get("_yuiResizeMonitor");if(!Q){Q=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){Q.src=G.RESIZE_MONITOR_SECURE_URL;}if(YAHOO.env.ua.gecko){S="<html><head><script type=\"text/javascript\">window.onresize=function(){window.parent.YAHOO.widget.Module.textResizeEvent.fire();};window.parent.YAHOO.widget.Module.textResizeEvent.fire();</script></head><body></body></html>";Q.src="data:text/html;charset=utf-8,"+encodeURIComponent(S);}Q.id="_yuiResizeMonitor";Q.style.position="absolute";Q.style.visibility="hidden";var R=document.body.firstChild;if(R){document.body.insertBefore(Q,R);}else{document.body.appendChild(Q);}Q.style.width="10em";Q.style.height="10em";Q.style.top=(-1*Q.offsetHeight)+"px";Q.style.left=(-1*Q.offsetWidth)+"px";Q.style.borderWidth="0";Q.style.visibility="visible";if(YAHOO.env.ua.webkit){P=Q.contentWindow.document;P.open();P.close();}}if(Q&&Q.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(!M.on(Q.contentWindow,"resize",T)){M.on(Q,"resize",T);}G.textResizeInitialized=true;}this.resizeMonitor=Q;}}},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(typeof Q=="string"){P.innerHTML=Q;}else{P.innerHTML="";P.appendChild(Q);}this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(typeof Q=="string"){P.innerHTML=Q;}else{P.innerHTML="";P.appendChild(Q);}this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(typeof Q=="string"){P.innerHTML=Q;}else{P.innerHTML="";P.appendChild(Q);}this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!P){P=this.element;}if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);}else{P.appendChild(this.body);}}if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);
P=this.element.parentNode;}if(P){P.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(Q in this){if(Q instanceof L){Q.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(L,K){YAHOO.widget.Overlay.superclass.constructor.call(this,L,K);};var F=YAHOO.lang,I=YAHOO.util.CustomEvent,E=YAHOO.widget.Module,J=YAHOO.util.Event,D=YAHOO.util.Dom,C=YAHOO.util.Config,B=YAHOO.widget.Overlay,G,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},H={"X":{key:"x",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:F.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:F.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:F.isBoolean,supercedes:["zindex"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.windowScrollEvent=new I("windowScroll");B.windowResizeEvent=new I("windowResize");B.windowScrollHandler=function(K){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}};B.windowResizeHandler=function(K){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){J.on(window,"scroll",B.windowScrollHandler);J.on(window,"resize",B.windowResizeHandler);B._initialized=true;}YAHOO.extend(B,E,{init:function(L,K){B.superclass.init.call(this,L);this.beforeInitEvent.fire(B);D.addClass(this.element,B.CSS_OVERLAY);if(K){this.cfg.applyConfig(K,true);}if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var K=I.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=K;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=K;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.X.key,{handler:this.configX,validator:H.X.validator,suppressEvent:H.X.suppressEvent,supercedes:H.X.supercedes});this.cfg.addProperty(H.Y.key,{handler:this.configY,validator:H.Y.validator,suppressEvent:H.Y.suppressEvent,supercedes:H.Y.supercedes});this.cfg.addProperty(H.XY.key,{handler:this.configXY,suppressEvent:H.XY.suppressEvent,supercedes:H.XY.supercedes});this.cfg.addProperty(H.CONTEXT.key,{handler:this.configContext,suppressEvent:H.CONTEXT.suppressEvent,supercedes:H.CONTEXT.supercedes});this.cfg.addProperty(H.FIXED_CENTER.key,{handler:this.configFixedCenter,value:H.FIXED_CENTER.value,validator:H.FIXED_CENTER.validator,supercedes:H.FIXED_CENTER.supercedes});this.cfg.addProperty(H.WIDTH.key,{handler:this.configWidth,suppressEvent:H.WIDTH.suppressEvent,supercedes:H.WIDTH.supercedes});this.cfg.addProperty(H.HEIGHT.key,{handler:this.configHeight,suppressEvent:H.HEIGHT.suppressEvent,supercedes:H.HEIGHT.supercedes});this.cfg.addProperty(H.ZINDEX.key,{handler:this.configzIndex,value:H.ZINDEX.value});this.cfg.addProperty(H.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:H.CONSTRAIN_TO_VIEWPORT.value,validator:H.CONSTRAIN_TO_VIEWPORT.validator,supercedes:H.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(H.IFRAME.key,{handler:this.configIframe,value:H.IFRAME.value,validator:H.IFRAME.validator,supercedes:H.IFRAME.supercedes});},moveTo:function(K,L){this.cfg.setProperty("xy",[K,L]);},hideMacGeckoScrollbars:function(){D.removeClass(this.element,"show-scrollbars");D.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){D.removeClass(this.element,"hide-scrollbars");D.addClass(this.element,"show-scrollbars");},configVisible:function(N,K,T){var M=K[0],O=D.getStyle(this.element,"visibility"),U=this.cfg.getProperty("effect"),R=[],Q=(this.platform=="mac"&&YAHOO.env.ua.gecko),b=C.alreadySubscribed,S,L,a,Y,X,W,Z,V,P;if(O=="inherit"){a=this.element.parentNode;while(a.nodeType!=9&&a.nodeType!=11){O=D.getStyle(a,"visibility");if(O!="inherit"){break;}a=a.parentNode;}if(O=="inherit"){O="visible";}}if(U){if(U instanceof Array){V=U.length;
for(Y=0;Y<V;Y++){S=U[Y];R[R.length]=S.effect(this,S.duration);}}else{R[R.length]=U.effect(this,U.duration);}}if(M){if(Q){this.showMacGeckoScrollbars();}if(U){if(M){if(O!="visible"||O===""){this.beforeShowEvent.fire();P=R.length;for(X=0;X<P;X++){L=R[X];if(X===0&&!b(L.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){L.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}L.animateIn();}}}}else{if(O!="visible"||O===""){this.beforeShowEvent.fire();D.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(Q){this.hideMacGeckoScrollbars();}if(U){if(O=="visible"){this.beforeHideEvent.fire();P=R.length;for(W=0;W<P;W++){Z=R[W];if(W===0&&!b(Z.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){Z.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}Z.animateOut();}}else{if(O===""){D.setStyle(this.element,"visibility","hidden");}}}else{if(O=="visible"||O===""){this.beforeHideEvent.fire();D.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(O,M,P){var Q=M[0],L=C.alreadySubscribed,N=B.windowResizeEvent,K=B.windowScrollEvent;if(Q){this.center();if(!L(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}if(!L(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}if(!L(K,this.doCenterOnDOMEvent,this)){K.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);N.unsubscribe(this.doCenterOnDOMEvent,this);K.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(N,L,O){var K=L[0],M=this.element;D.setStyle(M,"height",K);this.cfg.refireEvent("iframe");},configWidth:function(N,K,O){var M=K[0],L=this.element;D.setStyle(L,"width",M);this.cfg.refireEvent("iframe");},configzIndex:function(M,K,N){var O=K[0],L=this.element;if(!O){O=D.getStyle(L,"zIndex");if(!O||isNaN(O)){O=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(O<=0){O=1;}}D.setStyle(L,"zIndex",O);this.cfg.setProperty("zIndex",O,true);if(this.iframe){this.stackIframe();}},configXY:function(M,L,N){var P=L[0],K=P[0],O=P[1];this.cfg.setProperty("x",K);this.cfg.setProperty("y",O);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configX:function(M,L,N){var K=L[0],O=this.cfg.getProperty("y");this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setX(this.element,K,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configY:function(M,L,N){var K=this.cfg.getProperty("x"),O=L[0];this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setY(this.element,O,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},showIframe:function(){var L=this.iframe,K;if(L){K=this.element.parentNode;if(K!=L.parentNode){this._addToParent(K,L);}L.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var K=this.iframe,M=this.element,O=B.IFRAME_OFFSET,L=(O*2),N;if(K){K.style.width=(M.offsetWidth+L+"px");K.style.height=(M.offsetHeight+L+"px");N=this.cfg.getProperty("xy");if(!F.isArray(N)||(isNaN(N[0])||isNaN(N[1]))){this.syncPosition();N=this.cfg.getProperty("xy");}D.setXY(K,[(N[0]-O),(N[1]-O)]);}},stackIframe:function(){if(this.iframe){var K=D.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(K)&&!isNaN(K)){D.setStyle(this.iframe,"zIndex",(K-1));}}},configIframe:function(N,M,O){var K=M[0];function P(){var R=this.iframe,S=this.element,U,T;if(!R){if(!G){G=document.createElement("iframe");if(this.isSecure){G.src=B.IFRAME_SRC;}if(YAHOO.env.ua.ie){G.style.filter="alpha(opacity=0)";G.frameBorder=0;}else{G.style.opacity="0";}G.style.position="absolute";G.style.border="none";G.style.margin="0";G.style.padding="0";G.style.display="none";}R=G.cloneNode(false);U=S.parentNode;var Q=U||document.body;this._addToParent(Q,R);this.iframe=R;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function L(){P.call(this);this.beforeShowEvent.unsubscribe(L);this._iframeDeferred=false;}if(K){if(this.cfg.getProperty("visible")){P.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(L);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},configConstrainToViewport:function(L,K,M){var N=K[0];if(N){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(M,L,O){var Q=L[0],N,P,K;if(Q){N=Q[0];P=Q[1];K=Q[2];if(N){if(typeof N=="string"){this.cfg.setProperty("context",[document.getElementById(N),P,K],true);}if(P&&K){this.align(P,K);}}}},align:function(L,K){var Q=this.cfg.getProperty("context"),P=this,O,N,R;function M(S,T){switch(L){case B.TOP_LEFT:P.moveTo(T,S);break;case B.TOP_RIGHT:P.moveTo((T-N.offsetWidth),S);break;case B.BOTTOM_LEFT:P.moveTo(T,(S-N.offsetHeight));break;case B.BOTTOM_RIGHT:P.moveTo((T-N.offsetWidth),(S-N.offsetHeight));break;}}if(Q){O=Q[0];N=this.element;P=this;if(!L){L=Q[1];}if(!K){K=Q[2];}if(N&&O){R=D.getRegion(O);switch(K){case B.TOP_LEFT:M(R.top,R.left);
break;case B.TOP_RIGHT:M(R.top,R.right);break;case B.BOTTOM_LEFT:M(R.bottom,R.left);break;case B.BOTTOM_RIGHT:M(R.bottom,R.right);break;}}}},enforceConstraints:function(S,R,O){var U=R[0],W=U[0],V=U[1],L=this.element.offsetHeight,Q=this.element.offsetWidth,T=D.getViewportWidth(),N=D.getViewportHeight(),Z=D.getDocumentScrollLeft(),X=D.getDocumentScrollTop(),M=X+10,P=Z+10,K=X+N-L-10,Y=Z+T-Q-10;if(W<P){W=P;}else{if(W>Y){W=Y;}}if(V<M){V=M;}else{if(V>K){V=K;}}this.cfg.setProperty("x",W,true);this.cfg.setProperty("y",V,true);this.cfg.setProperty("xy",[W,V],true);},center:function(){var Q=D.getDocumentScrollLeft(),O=D.getDocumentScrollTop(),L=D.getClientWidth(),P=D.getClientHeight(),N=this.element.offsetWidth,M=this.element.offsetHeight,K=(L/2)-(N/2)+Q,R=(P/2)-(M/2)+O;this.cfg.setProperty("xy",[parseInt(K,10),parseInt(R,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var K=D.getXY(this.element);this.cfg.setProperty("x",K[0],true);this.cfg.setProperty("y",K[1],true);this.cfg.setProperty("xy",K,true);},onDomResize:function(M,L){var K=this;B.superclass.onDomResize.call(this,M,L);setTimeout(function(){K.syncPosition();K.cfg.refireEvent("iframe");K.cfg.refireEvent("context");},0);},bringToTop:function(){var N=[],M=this.element;function P(T,S){var V=D.getStyle(T,"zIndex"),U=D.getStyle(S,"zIndex"),R=(!V||isNaN(V))?0:parseInt(V,10),Q=(!U||isNaN(U))?0:parseInt(U,10);if(R>Q){return -1;}else{if(R<Q){return 1;}else{return 0;}}}function L(S){var Q=D.hasClass(S,B.CSS_OVERLAY),R=YAHOO.widget.Panel;if(Q&&!D.isAncestor(M,Q)){if(R&&D.hasClass(S,R.CSS_PANEL)){N[N.length]=S.parentNode;}else{N[N.length]=S;}}}D.getElementsBy(L,"DIV",document.body);N.sort(P);var K=N[0],O;if(K){O=D.getStyle(K,"zIndex");if(!isNaN(O)&&K!=M){this.cfg.setProperty("zindex",(parseInt(O,10)+2));}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){if(H!=K){if(H){H.blur();}this.bringToTop(K);H=K;E.addClass(H.element,A.CSS_FOCUSED);K.focusEvent.fire();}}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}M.focusEvent.unsubscribeAll();M.blurEvent.unsubscribeAll();M.focusEvent=null;M.blurEvent=null;M.focus=null;M.blur=null;}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._onOverlayBlur=function(K,J){H=null;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},register:function(G){var K=this,L,I,H,J;if(G instanceof D){G.cfg.addProperty("manager",{value:this});G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focus=function(){K.focus(this);};G.blur=function(){if(K.getActive()==this){E.removeClass(this.element,A.CSS_FOCUSED);this.blurEvent.fire();}};G.blurEvent.subscribe(K._onOverlayBlur);G.hideEvent.subscribe(G.blur);G.destroyEvent.subscribe(this._onOverlayDestroy,G,this);C.on(G.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,G);L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){G.cfg.setProperty("zIndex",parseInt(L,10));}else{G.cfg.setProperty("zIndex",0);}this.overlays.push(G);this.bringToTop(G);return true;}else{if(G instanceof Array){I=0;J=G.length;for(H=0;H<J;H++){if(this.register(G[H])){I++;}}if(I>0){return true;}}else{return false;}}},bringToTop:function(K){var H=this.find(K),J,G,I;if(H){I=this.overlays;I.sort(this.compareZIndexDesc);G=I[0];if(G){J=E.getStyle(G.element,"zIndex");if(!isNaN(J)&&G!=H){H.cfg.setProperty("zIndex",(parseInt(J,10)+2));}I.sort(this.compareZIndexDesc);}}},find:function(G){var I=this.overlays,J=I.length,H;if(J>0){H=J-1;if(G instanceof D){do{if(I[H]==G){return I[H];}}while(H--);}else{if(typeof G=="string"){do{if(I[H].id==G){return I[H];}}while(H--);}}return null;}},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].show();}while(G--);}},hideAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].hide();}while(G--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(L,K){YAHOO.widget.Tooltip.superclass.constructor.call(this,L,K);};var D=YAHOO.lang,J=YAHOO.util.Event,B=YAHOO.util.Dom,F=YAHOO.widget.Tooltip,E,G={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:D.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:D.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:D.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:D.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"}};
F.CSS_TOOLTIP="yui-tt";function H(L,K,M){var P=M[0],N=M[1],O=this.cfg,Q=O.getProperty("width");if(Q==N){O.setProperty("width",P);}this.unsubscribe("hide",this._onHide,M);}function C(L,K){var M=document.body,Q=this.cfg,P=Q.getProperty("width"),N,O;if((!P||P=="auto")&&(Q.getProperty("container")!=M||Q.getProperty("x")>=B.getViewportWidth()||Q.getProperty("y")>=B.getViewportHeight())){O=this.element.cloneNode(true);O.style.visibility="hidden";O.style.top="0px";O.style.left="0px";M.appendChild(O);N=(O.offsetWidth+"px");M.removeChild(O);O=null;Q.setProperty("width",N);Q.refireEvent("xy");this.subscribe("hide",H,[(P||""),N]);}}function A(L,K,M){this.render(M);}function I(){J.onDOMReady(A,this.cfg.getProperty("container"),this);}YAHOO.extend(F,YAHOO.widget.Overlay,{init:function(L,K){F.superclass.init.call(this,L);this.beforeInitEvent.fire(F);B.addClass(this.element,F.CSS_TOOLTIP);if(K){this.cfg.applyConfig(K,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",C);this.subscribe("init",I);this.subscribe("render",this.onRender);this.initEvent.fire(F);},initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);this.cfg.addProperty(G.PREVENT_OVERLAP.key,{value:G.PREVENT_OVERLAP.value,validator:G.PREVENT_OVERLAP.validator,supercedes:G.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(G.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:G.SHOW_DELAY.validator});this.cfg.addProperty(G.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:G.AUTO_DISMISS_DELAY.value,validator:G.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(G.HIDE_DELAY.key,{handler:this.configHideDelay,value:G.HIDE_DELAY.value,validator:G.HIDE_DELAY.validator});this.cfg.addProperty(G.TEXT.key,{handler:this.configText,suppressEvent:G.TEXT.suppressEvent});this.cfg.addProperty(G.CONTAINER.key,{handler:this.configContainer,value:document.body});},configText:function(L,K,M){var N=K[0];if(N){this.setBody(N);}},configContainer:function(M,L,N){var K=L[0];if(typeof K=="string"){this.cfg.setProperty("container",document.getElementById(K),true);}},_removeEventListeners:function(){var N=this._context,K,M,L;if(N){K=N.length;if(K>0){L=K-1;do{M=N[L];J.removeListener(M,"mouseover",this.onContextMouseOver);J.removeListener(M,"mousemove",this.onContextMouseMove);J.removeListener(M,"mouseout",this.onContextMouseOut);}while(L--);}}},configContext:function(P,L,Q){var O=L[0],R,K,N,M;if(O){if(!(O instanceof Array)){if(typeof O=="string"){this.cfg.setProperty("context",[document.getElementById(O)],true);}else{this.cfg.setProperty("context",[O],true);}O=this.cfg.getProperty("context");}this._removeEventListeners();this._context=O;R=this._context;if(R){K=R.length;if(K>0){M=K-1;do{N=R[M];J.on(N,"mouseover",this.onContextMouseOver,this);J.on(N,"mousemove",this.onContextMouseMove,this);J.on(N,"mouseout",this.onContextMouseOut,this);}while(M--);}}}},onContextMouseMove:function(L,K){K.pageX=J.getPageX(L);K.pageY=J.getPageY(L);},onContextMouseOver:function(M,L){var K=this;if(L.hideProcId){clearTimeout(L.hideProcId);L.hideProcId=null;}J.on(K,"mousemove",L.onContextMouseMove,L);if(K.title){L._tempTitle=K.title;K.title="";}L.showProcId=L.doShow(M,K);},onContextMouseOut:function(M,L){var K=this;if(L._tempTitle){K.title=L._tempTitle;L._tempTitle=null;}if(L.showProcId){clearTimeout(L.showProcId);L.showProcId=null;}if(L.hideProcId){clearTimeout(L.hideProcId);L.hideProcId=null;}L.hideProcId=setTimeout(function(){L.hide();},L.cfg.getProperty("hidedelay"));},doShow:function(M,K){var N=25,L=this;if(YAHOO.env.ua.opera&&K.tagName&&K.tagName.toUpperCase()=="A"){N+=12;}return setTimeout(function(){if(L._tempTitle){L.setBody(L._tempTitle);}else{L.cfg.refireEvent("text");}L.moveTo(L.pageX,L.pageY+N);if(L.cfg.getProperty("preventoverlap")){L.preventOverlap(L.pageX,L.pageY);}J.removeListener(K,"mousemove",L.onContextMouseMove);L.show();L.hideProcId=L.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var K=this;return setTimeout(function(){K.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(O,N){var K=this.element.offsetHeight,M=new YAHOO.util.Point(O,N),L=B.getRegion(this.element);L.top-=5;L.left-=5;L.right+=5;L.bottom+=5;if(L.contains(M)){this.cfg.setProperty("y",(N-K-5));}},onRender:function(O,N){function P(){var S=this.element,R=this._shadow;if(R){R.style.width=(S.offsetWidth+6)+"px";R.style.height=(S.offsetHeight+1)+"px";}}function L(){B.addClass(this._shadow,"yui-tt-shadow-visible");}function K(){B.removeClass(this._shadow,"yui-tt-shadow-visible");}function Q(){var T=this._shadow,S,R,V,U;if(!T){S=this.element;R=YAHOO.widget.Module;V=YAHOO.env.ua.ie;U=this;if(!E){E=document.createElement("div");E.className="yui-tt-shadow";}T=E.cloneNode(false);S.appendChild(T);this._shadow=T;L.call(this);this.subscribe("beforeShow",L);this.subscribe("beforeHide",K);if(V==6||(V==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){P.call(U);},0);this.cfg.subscribeToConfigEvent("width",P);this.cfg.subscribeToConfigEvent("height",P);this.subscribe("changeContent",P);R.textResizeEvent.subscribe(P,this,true);this.subscribe("destroy",function(){R.textResizeEvent.unsubscribe(P,this);});}}}function M(){Q.call(this);this.unsubscribe("beforeShow",M);}if(this.cfg.getProperty("visible")){Q.call(this);}else{this.subscribe("beforeShow",M);}},destroy:function(){this._removeEventListeners();F.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(U,T){YAHOO.widget.Panel.superclass.constructor.call(this,U,T);};var G=YAHOO.lang,N=YAHOO.util.DD,A=YAHOO.util.Dom,S=YAHOO.util.Event,I=YAHOO.widget.Overlay,L=YAHOO.util.CustomEvent,J=YAHOO.util.Config,O=YAHOO.widget.Panel,H,Q,D,E={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},M={"CLOSE":{key:"close",value:true,validator:G.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(N?true:false),validator:G.isBoolean,supercedes:["visible"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:G.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};
O.CSS_PANEL="yui-panel";O.CSS_PANEL_CONTAINER="yui-panel-container";function K(U,T){if(!this.header){this.setHeader("&#160;");}}function R(U,T,V){var Y=V[0],W=V[1],X=this.cfg,Z=X.getProperty("width");if(Z==W){X.setProperty("width",Y);}this.unsubscribe("hide",R,V);}function C(U,T){var Y=YAHOO.env.ua.ie,X,W,V;if(Y==6||(Y==7&&document.compatMode=="BackCompat")){X=this.cfg;W=X.getProperty("width");if(!W||W=="auto"){V=(this.element.offsetWidth+"px");X.setProperty("width",V);this.subscribe("hide",R,[(W||""),V]);}}}function F(){this.blur();}function P(V,U){var W=this;function T(Z){var Y=Z.tagName.toUpperCase(),X=false;switch(Y){case"A":case"BUTTON":case"SELECT":case"TEXTAREA":if(!A.isAncestor(W.element,Z)){S.on(Z,"focus",F,Z,true);X=true;}break;case"INPUT":if(Z.type!="hidden"&&!A.isAncestor(W.element,Z)){S.on(Z,"focus",F,Z,true);X=true;}break;}return X;}this.focusableElements=A.getElementsBy(T);}function B(V,U){var Y=this.focusableElements,T=Y.length,W,X;for(X=0;X<T;X++){W=Y[X];S.removeListener(W,"focus",F);}}YAHOO.extend(O,I,{init:function(U,T){O.superclass.init.call(this,U);this.beforeInitEvent.fire(O);A.addClass(this.element,O.CSS_PANEL);this.buildWrapper();if(T){this.cfg.applyConfig(T,true);}this.subscribe("showMask",P);this.subscribe("hideMask",B);if(this.cfg.getProperty("draggable")){this.subscribe("beforeRender",K);}this.initEvent.fire(O);},initEvents:function(){O.superclass.initEvents.call(this);var T=L.LIST;this.showMaskEvent=this.createEvent(E.SHOW_MASK);this.showMaskEvent.signature=T;this.hideMaskEvent=this.createEvent(E.HIDE_MASK);this.hideMaskEvent.signature=T;this.dragEvent=this.createEvent(E.DRAG);this.dragEvent.signature=T;},initDefaultConfig:function(){O.superclass.initDefaultConfig.call(this);this.cfg.addProperty(M.CLOSE.key,{handler:this.configClose,value:M.CLOSE.value,validator:M.CLOSE.validator,supercedes:M.CLOSE.supercedes});this.cfg.addProperty(M.DRAGGABLE.key,{handler:this.configDraggable,value:M.DRAGGABLE.value,validator:M.DRAGGABLE.validator,supercedes:M.DRAGGABLE.supercedes});this.cfg.addProperty(M.UNDERLAY.key,{handler:this.configUnderlay,value:M.UNDERLAY.value,supercedes:M.UNDERLAY.supercedes});this.cfg.addProperty(M.MODAL.key,{handler:this.configModal,value:M.MODAL.value,validator:M.MODAL.validator,supercedes:M.MODAL.supercedes});this.cfg.addProperty(M.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:M.KEY_LISTENERS.suppressEvent,supercedes:M.KEY_LISTENERS.supercedes});},configClose:function(V,T,X){var Y=T[0],U=this.close;function W(a,Z){Z.hide();}if(Y){if(!U){if(!D){D=document.createElement("span");D.innerHTML="&#160;";D.className="container-close";}U=D.cloneNode(true);this.innerElement.appendChild(U);S.on(U,"click",W,this);this.close=U;}else{U.style.display="block";}}else{if(U){U.style.display="none";}}},configDraggable:function(U,T,V){var W=T[0];if(W){if(!N){this.cfg.setProperty("draggable",false);return ;}if(this.header){A.setStyle(this.header,"cursor","move");this.registerDragDrop();}if(!J.alreadySubscribed(this.beforeRenderEvent,K,null)){this.subscribe("beforeRender",K);}this.subscribe("beforeShow",C);}else{if(this.dd){this.dd.unreg();}if(this.header){A.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeRender",K);this.unsubscribe("beforeShow",C);}},configUnderlay:function(c,b,X){var a=YAHOO.env.ua,Z=(this.platform=="mac"&&a.gecko),d=b[0].toLowerCase(),T=this.underlay,U=this.element;function V(){var e;if(!T){if(!Q){Q=document.createElement("div");Q.className="underlay";}T=Q.cloneNode(false);this.element.appendChild(T);this.underlay=T;e=a.ie;if(e==6||(e==7&&document.compatMode=="BackCompat")){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}}}function Y(){V.call(this);this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(Y);}function W(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(Y);this._underlayDeferred=false;}if(T){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(T);this.underlay=null;}}switch(d){case"shadow":A.removeClass(U,"matte");A.addClass(U,"shadow");break;case"matte":if(!Z){W.call(this);}A.removeClass(U,"shadow");A.addClass(U,"matte");break;default:if(!Z){W.call(this);}A.removeClass(U,"shadow");A.removeClass(U,"matte");break;}if((d=="shadow")||(Z&&!T)){if(this.cfg.getProperty("visible")){V.call(this);}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(Y);this._underlayDeferred=true;}}}},configModal:function(U,T,W){var V=T[0];if(V){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);I.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);I.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var U=this.mask,T;if(U){this.hideMask();T=U.parentNode;if(T){T.removeChild(U);}this.mask=null;}},configKeyListeners:function(W,T,Z){var V=T[0],Y,X,U;if(V){if(V instanceof Array){X=V.length;for(U=0;U<X;U++){Y=V[U];if(!J.alreadySubscribed(this.showEvent,Y.enable,Y)){this.showEvent.subscribe(Y.enable,Y,true);}if(!J.alreadySubscribed(this.hideEvent,Y.disable,Y)){this.hideEvent.subscribe(Y.disable,Y,true);this.destroyEvent.subscribe(Y.disable,Y,true);
}}}else{if(!J.alreadySubscribed(this.showEvent,V.enable,V)){this.showEvent.subscribe(V.enable,V,true);}if(!J.alreadySubscribed(this.hideEvent,V.disable,V)){this.hideEvent.subscribe(V.disable,V,true);this.destroyEvent.subscribe(V.disable,V,true);}}}},configHeight:function(W,U,X){var T=U[0],V=this.innerElement;A.setStyle(V,"height",T);this.cfg.refireEvent("iframe");},configWidth:function(W,T,X){var V=T[0],U=this.innerElement;A.setStyle(U,"width",V);this.cfg.refireEvent("iframe");},configzIndex:function(U,T,W){O.superclass.configzIndex.call(this,U,T,W);if(this.mask||this.cfg.getProperty("modal")===true){var V=A.getStyle(this.element,"zIndex");if(!V||isNaN(V)){V=0;}if(V===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var V=this.element.parentNode,T=this.element,U=document.createElement("div");U.className=O.CSS_PANEL_CONTAINER;U.id=T.id+"_c";if(V){V.insertBefore(U,T);}U.appendChild(T);this.element=U;this.innerElement=T;A.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var U=this.underlay,T;if(U){T=this.element;U.style.width=T.offsetWidth+"px";U.style.height=T.offsetHeight+"px";}},registerDragDrop:function(){var T=this;if(this.header){if(!N){return ;}this.dd=new N(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var V,Z,a,X,d,b,W,Y,U,c;if(YAHOO.env.ua.ie==6){A.addClass(T.element,"drag");}if(T.cfg.getProperty("constraintoviewport")){V=T.element.offsetHeight;Z=T.element.offsetWidth;a=A.getViewportWidth();X=A.getViewportHeight();d=A.getDocumentScrollLeft();b=A.getDocumentScrollTop();W=b+10;Y=d+10;U=b+X-V-10;c=d+a-Z-10;this.minX=Y;this.maxX=c;this.constrainX=true;this.minY=W;this.maxY=U;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}T.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){T.syncPosition();T.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}T.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){A.removeClass(T.element,"drag");}T.dragEvent.fire("endDrag",arguments);T.moveEvent.fire(T.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var T=this.mask;if(!T){if(!H){H=document.createElement("div");H.className="mask";H.innerHTML="&#160;";}T=H.cloneNode(true);T.id=this.id+"_mask";document.body.insertBefore(T,document.body.firstChild);this.mask=T;this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();A.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){A.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=A.getDocumentHeight()+"px";this.mask.style.width=A.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var T=A.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(T)&&!isNaN(T)){A.setStyle(this.mask,"zIndex",T-1);}}},render:function(T){return O.superclass.render.call(this,T,this.innerElement);},destroy:function(){I.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){S.purgeElement(this.close);}O.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(L,K){YAHOO.widget.Dialog.superclass.constructor.call(this,L,K);};var J=YAHOO.util.Event,I=YAHOO.util.CustomEvent,D=YAHOO.util.Dom,B=YAHOO.util.KeyListener,H=YAHOO.util.Connect,F=YAHOO.widget.Dialog,E=YAHOO.lang,A={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},G={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"}};F.CSS_DIALOG="yui-dialog";function C(){var N=this._aButtons,L,M,K;if(E.isArray(N)){L=N.length;if(L>0){K=L-1;do{M=N[K];if(YAHOO.widget.Button&&M instanceof YAHOO.widget.Button){M.destroy();}else{if(M.tagName.toUpperCase()=="BUTTON"){J.purgeElement(M);J.purgeElement(M,false);}}}while(K--);}}}YAHOO.extend(F,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(G.POST_METHOD.key,{handler:this.configPostMethod,value:G.POST_METHOD.value,validator:function(K){if(K!="form"&&K!="async"&&K!="none"&&K!="manual"){return false;}else{return true;}}});this.cfg.addProperty(G.BUTTONS.key,{handler:this.configButtons,value:G.BUTTONS.value});},initEvents:function(){F.superclass.initEvents.call(this);var K=I.LIST;this.beforeSubmitEvent=this.createEvent(A.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=K;this.submitEvent=this.createEvent(A.SUBMIT);this.submitEvent.signature=K;this.manualSubmitEvent=this.createEvent(A.MANUAL_SUBMIT);this.manualSubmitEvent.signature=K;this.asyncSubmitEvent=this.createEvent(A.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=K;this.formSubmitEvent=this.createEvent(A.FORM_SUBMIT);this.formSubmitEvent.signature=K;this.cancelEvent=this.createEvent(A.CANCEL);this.cancelEvent.signature=K;},init:function(L,K){F.superclass.init.call(this,L);this.beforeInitEvent.fire(F);D.addClass(this.element,F.CSS_DIALOG);this.cfg.setProperty("visible",false);if(K){this.cfg.applyConfig(K,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(F);},doSubmit:function(){var Q=this.form,O=false,N=false,P,K,M,L;switch(this.cfg.getProperty("postmethod")){case"async":P=Q.elements;K=P.length;if(K>0){M=K-1;do{if(P[M].type=="file"){O=true;break;}}while(M--);}if(O&&YAHOO.env.ua.ie&&this.isSecure){N=true;}L=(Q.getAttribute("method")||"POST").toUpperCase();
H.setForm(Q,O,N);H.asyncRequest(L,Q.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var M=this.element.getElementsByTagName("form")[0],L=this,K,N;if(this.form){if(this.form==M&&D.isAncestor(this.element,this.form)){return ;}else{J.purgeElement(this.form);this.form=null;}}if(!M){M=document.createElement("form");M.name="frm_"+this.id;this.body.appendChild(M);}if(M){this.form=M;J.on(M,"submit",function(O){J.stopEvent(O);this.submit();this.form.blur();},this,true);this.firstFormElement=function(){var Q,P,O=M.elements.length;for(Q=0;Q<O;Q++){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();this.lastFormElement=function(){var Q,P,O=M.elements.length;for(Q=O-1;Q>=0;Q--){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();if(this.cfg.getProperty("modal")){K=this.firstFormElement||this.firstButton;if(K){this.preventBackTab=new B(K,{shift:true,keys:9},{fn:L.focusLast,scope:L,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}N=this.lastButton||this.lastFormElement;if(N){this.preventTabOut=new B(N,{shift:false,keys:9},{fn:L.focusFirst,scope:L,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(M,K,N){var O=K[0];function L(Q,P){P.cancel();}if(O){if(!this.close){this.close=document.createElement("div");D.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);J.on(this.close,"click",L,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(U,T,O){var P=YAHOO.widget.Button,W=T[0],M=this.innerElement,V,R,L,S,Q,K,N;C.call(this);this._aButtons=null;if(E.isArray(W)){Q=document.createElement("span");Q.className="button-group";S=W.length;this._aButtons=[];for(N=0;N<S;N++){V=W[N];if(P){L=new P({label:V.text,container:Q});R=L.get("element");if(V.isDefault){L.addClass("default");this.defaultHtmlButton=R;}if(E.isFunction(V.handler)){L.set("onclick",{fn:V.handler,obj:this,scope:this});}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){L.set("onclick",{fn:V.handler.fn,obj:((!E.isUndefined(V.handler.obj))?V.handler.obj:this),scope:(V.handler.scope||this)});}}this._aButtons[this._aButtons.length]=L;}else{R=document.createElement("button");R.setAttribute("type","button");if(V.isDefault){R.className="default";this.defaultHtmlButton=R;}R.innerHTML=V.text;if(E.isFunction(V.handler)){J.on(R,"click",V.handler,this,true);}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){J.on(R,"click",V.handler.fn,((!E.isUndefined(V.handler.obj))?V.handler.obj:this),(V.handler.scope||this));}}Q.appendChild(R);this._aButtons[this._aButtons.length]=R;}V.htmlButton=R;if(N===0){this.firstButton=R;}if(N==(S-1)){this.lastButton=R;}}this.setFooter(Q);K=this.footer;if(D.inDocument(this.element)&&!D.isAncestor(M,K)){M.appendChild(K);}this.buttonSpan=Q;}else{Q=this.buttonSpan;K=this.footer;if(Q&&K){K.removeChild(Q);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var K=this._aButtons;if(K){return K;}},focusFirst:function(N,L,P){var M=this.firstFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(M){try{M.focus();}catch(O){}}else{this.focusDefaultButton();}},focusLast:function(N,L,P){var Q=this.cfg.getProperty("buttons"),M=this.lastFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(Q&&E.isArray(Q)){this.focusLastButton();}else{if(M){try{M.focus();}catch(O){}}}},focusDefaultButton:function(){var K=this.defaultHtmlButton;if(K){try{K.focus();}catch(L){}}},blurButtons:function(){var P=this.cfg.getProperty("buttons"),M,O,L,K;if(P&&E.isArray(P)){M=P.length;if(M>0){K=(M-1);do{O=P[K];if(O){L=O.htmlButton;if(L){try{L.blur();}catch(N){}}}}while(K--);}}},focusFirstButton:function(){var N=this.cfg.getProperty("buttons"),M,K;if(N&&E.isArray(N)){M=N[0];if(M){K=M.htmlButton;if(K){try{K.focus();}catch(L){}}}}},focusLastButton:function(){var O=this.cfg.getProperty("buttons"),L,N,K;if(O&&E.isArray(O)){L=O.length;if(L>0){N=O[(L-1)];if(N){K=N.htmlButton;if(K){try{K.focus();}catch(M){}}}}}},configPostMethod:function(M,L,N){var K=L[0];this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var a=this.form,M,T,W,O,U,R,Q,L,X,N,Y,b,K,P,c,Z,V;function S(e){var d=e.tagName.toUpperCase();return((d=="INPUT"||d=="TEXTAREA"||d=="SELECT")&&e.name==O);}if(a){M=a.elements;T=M.length;W={};for(Z=0;Z<T;Z++){O=M[Z].name;U=D.getElementsBy(S,"*",a);R=U.length;if(R>0){if(R==1){U=U[0];Q=U.type;L=U.tagName.toUpperCase();switch(L){case"INPUT":if(Q=="checkbox"){W[O]=U.checked;}else{if(Q!="radio"){W[O]=U.value;}}break;case"TEXTAREA":W[O]=U.value;break;case"SELECT":X=U.options;N=X.length;Y=[];for(V=0;V<N;V++){b=X[V];if(b.selected){K=b.value;if(!K||K===""){K=b.text;}Y[Y.length]=K;}}W[O]=Y;break;}}else{Q=U[0].type;switch(Q){case"radio":for(V=0;V<R;V++){P=U[V];if(P.checked){W[O]=P.value;break;}}break;case"checkbox":Y=[];for(V=0;V<R;V++){c=U[V];if(c.checked){Y[Y.length]=c.value;}}W[O]=Y;break;}}}}}return W;},destroy:function(){C.call(this);this._aButtons=null;var K=this.element.getElementsByTagName("form"),L;if(K.length>0){L=K[0];if(L){J.purgeElement(L);if(L.parentNode){L.parentNode.removeChild(L);}this.form=null;}}F.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());
(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML="&#160;";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(F,I,H,E,G){if(!G){G=YAHOO.util.Anim;}this.overlay=F;this.attrIn=I;this.attrOut=H;this.targetElement=E||F.element;this.animClass=G;};var B=YAHOO.util.Dom,D=YAHOO.util.CustomEvent,C=YAHOO.util.Easing,A=YAHOO.widget.ContainerEffect;A.FADE=function(E,F){var G=new A(E,{attributes:{opacity:{from:0,to:1}},duration:F,method:C.easeIn},{attributes:{opacity:{to:0}},duration:F,method:C.easeOut},E.element);G.handleStartAnimateIn=function(I,H,J){B.addClass(J.overlay.element,"hide-select");if(!J.overlay.underlay){J.overlay.cfg.refireEvent("underlay");}if(J.overlay.underlay){J.initialUnderlayOpacity=B.getStyle(J.overlay.underlay,"opacity");J.overlay.underlay.style.filter=null;}B.setStyle(J.overlay.element,"visibility","visible");B.setStyle(J.overlay.element,"opacity",0);};G.handleCompleteAnimateIn=function(I,H,J){B.removeClass(J.overlay.element,"hide-select");if(J.overlay.element.style.filter){J.overlay.element.style.filter=null;}if(J.overlay.underlay){B.setStyle(J.overlay.underlay,"opacity",J.initialUnderlayOpacity);}J.overlay.cfg.refireEvent("iframe");J.animateInCompleteEvent.fire();};G.handleStartAnimateOut=function(I,H,J){B.addClass(J.overlay.element,"hide-select");if(J.overlay.underlay){J.overlay.underlay.style.filter=null;}};G.handleCompleteAnimateOut=function(I,H,J){B.removeClass(J.overlay.element,"hide-select");if(J.overlay.element.style.filter){J.overlay.element.style.filter=null;}B.setStyle(J.overlay.element,"visibility","hidden");B.setStyle(J.overlay.element,"opacity",1);J.overlay.cfg.refireEvent("iframe");J.animateOutCompleteEvent.fire();};G.init();return G;};A.SLIDE=function(G,I){var F=G.cfg.getProperty("x")||B.getX(G.element),K=G.cfg.getProperty("y")||B.getY(G.element),J=B.getClientWidth(),H=G.element.offsetWidth,E=new A(G,{attributes:{points:{to:[F,K]}},duration:I,method:C.easeIn},{attributes:{points:{to:[(J+25),K]}},duration:I,method:C.easeOut},G.element,YAHOO.util.Motion);E.handleStartAnimateIn=function(M,L,N){N.overlay.element.style.left=((-25)-H)+"px";N.overlay.element.style.top=K+"px";};E.handleTweenAnimateIn=function(O,N,P){var Q=B.getXY(P.overlay.element),M=Q[0],L=Q[1];if(B.getStyle(P.overlay.element,"visibility")=="hidden"&&M<F){B.setStyle(P.overlay.element,"visibility","visible");}P.overlay.cfg.setProperty("xy",[M,L],true);P.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateIn=function(M,L,N){N.overlay.cfg.setProperty("xy",[F,K],true);N.startX=F;N.startY=K;N.overlay.cfg.refireEvent("iframe");N.animateInCompleteEvent.fire();};E.handleStartAnimateOut=function(N,M,Q){var O=B.getViewportWidth(),R=B.getXY(Q.overlay.element),P=R[1],L=Q.animOut.attributes.points.to;Q.animOut.attributes.points.to=[(O+25),P];};E.handleTweenAnimateOut=function(N,M,O){var Q=B.getXY(O.overlay.element),L=Q[0],P=Q[1];O.overlay.cfg.setProperty("xy",[L,P],true);O.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateOut=function(M,L,N){B.setStyle(N.overlay.element,"visibility","hidden");N.overlay.cfg.setProperty("xy",[F,K]);N.animateOutCompleteEvent.fire();};E.init();return E;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=D.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=D.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=D.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=D.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);
},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(F,E,G){},handleTweenAnimateIn:function(F,E,G){},handleCompleteAnimateIn:function(F,E,G){},handleStartAnimateOut:function(F,E,G){},handleTweenAnimateOut:function(F,E,G){},handleCompleteAnimateOut:function(F,E,G){},toString:function(){var E="ContainerEffect";if(this.overlay){E+=" ["+this.overlay.toString()+"]";}return E;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.3.1",build:"541"});
YAHOO.namespace('rotatebox');
YAHOO.rotatebox.photo_id = 0;
YAHOO.rotatebox.angle = 0;
YAHOO.rotatebox.no_flash_mode = false;
YAHOO.rotatebox.opened = false;
YAHOO.rotatebox.init = function(photo_id)
{
YAHOO.rotatebox.photo_id = photo_id;
YAHOO.rotatebox.Rotate_Photo = new YAHOO.widget.Panel( "Rotate_Photo",
{
width:"315px",
height:"215px",
close:false,
underlay:"none",
modal:true,
visible:false,
draggable:false
}
);
var templateStr =
'<div id="wrapper" style="width:300px; height:215px; font-size:75.4%"></div>';
YAHOO.rotatebox.Rotate_Photo.setBody( templateStr );
YAHOO.rotatebox.Rotate_Photo.render( document.body );
var E = YAHOO.util.Event;
E.addListener( 'showRotatePanel', 'click', YAHOO.rotatebox.open );
E.addListener( document, 'keypress', function(evt) {
if( evt.keyCode == 27 ){
YAHOO.rotatebox.close();
}
});
YAHOO.rotatebox.rotating();
}
YAHOO.rotatebox.submit = function()
{
if( YAHOO.rotatebox.angle == 0 ) {
YAHOO.rotatebox.close();
return false;
}
YAHOO.rotatebox.close();
YAHOO.rotatebox.rotating_open();
var angle = YAHOO.rotatebox.angle;
if(angle < 0)
{
angle = 360 + angle;
}
var vaitality_store_flag = YAHOO.input.checkVitalityLimit(global_items[YAHOO.rotatebox.photo_id].create);
var pars = {
method: "photos.rotate"
,photo_id: YAHOO.rotatebox.photo_id
,angle: angle
,owner_id: global_items[YAHOO.rotatebox.photo_id].owner_id
,title: global_items[YAHOO.rotatebox.photo_id].title
,acl: global_items[YAHOO.rotatebox.photo_id].acl_read
,vitality:vaitality_store_flag
};
CallApiRequestWithYUI(pars, YAHOO.rotatebox.rotatePhoto_onLoad);
return false;
}
YAHOO.rotatebox.rotatePhoto_onLoad = {
success: function(_Req) {
var Req = eval("("+_Req.responseText+")");
var stat = Req.stat;
if ( stat == 'ok' ) {
window.location.href = global_items[YAHOO.rotatebox.photo_id].photo_url+"?n="+global_done['albums']['rotate_photo_done'];
} else {
alert( global_message['rotatebox']['rotate_error'] );
YAHOO.rotatebox.rotating_close();
}
},
failure: function() {
alert( global_message['common_error']['connection_failure'] );
YAHOO.rotatebox.rotating_close();
}
}
YAHOO.rotatebox.checkFlash = function()
{
var plugin = null;
try{
if( navigator.appName.indexOf('Microsoft') != -1 ) {
plugin = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.8');
return true;
} else if( navigator.plugins && navigator.mimeTypes.length ) {
plugin = navigator.plugins["Shockwave Flash"];
var v = plugin.description.match(/(\d+)\.\d/);
if(parseInt(v) > 7){
return true;
}else{
return false;
}
}
} catch(e) {
return false;
}
}
YAHOO.rotatebox.open = function()
{
YAHOO.util.Dom.getFirstChild(document).style.overflow = "hidden";
input_editing++;
YAHOO.rotatebox.opened = true;
YAHOO.rotatebox.angle = 0;
var TP = YAHOO.rotatebox.Rotate_Photo;
TP.render(document.body);
TP.center();
TP.show();
if( YAHOO.rotatebox.checkFlash() ) {
YAHOO.rotatebox.no_flash_mode = false;
YAHOO.rotatebox.showFlash();
var E = YAHOO.util.Event;
E.addListener( 'lightBoxSubmitNg', 'click', YAHOO.rotatebox.close );
E.addListener( 'lightBoxSubmitOk', 'click', YAHOO.rotatebox.submit );
}else{
YAHOO.rotatebox.no_flash_mode = true;
YAHOO.rotatebox.showNoFlashMessage();
var E = YAHOO.util.Event;
E.addListener( 'lightBoxSubmitNg2', 'click', YAHOO.rotatebox.close );
}
return false;
}
YAHOO.rotatebox.close = function()
{
if( !YAHOO.rotatebox.opened ) { return false; }
input_editing--;
var E = YAHOO.util.Event;
if(YAHOO.rotatebox.no_flash_mode){
E.removeListener( 'lightBoxSubmitNg2', 'click', YAHOO.rotatebox.close );
}else{
E.removeListener( 'lightBoxSubmitNg', 'click', YAHOO.rotatebox.close );
E.removeListener( 'lightBoxSubmitOk', 'click', YAHOO.rotatebox.submit );
}
YAHOO.rotatebox.opened = false;
var body_el = document.getElementById('wrapper');
body_el.innerHTML = '';
YAHOO.rotatebox.Rotate_Photo.hide();
YAHOO.util.Dom.getFirstChild(document).style.overflow = "scroll";
return false;
}
YAHOO.rotatebox.showFlash = function()
{
var body_el = document.getElementById('wrapper');
body_el.innerHTML =
'<div class="lightBoxRotatePhoto">' +
'<div class="containerMain" style="width:300px">' +
'<span class="rotateLeft"><a href="#" onClick="YAHOO.rotatebox.rotatePhoto(-1, 90);return false;"><img src="http://i.yimg.jp/images/socialproducts/album/rotateLeft.gif" alt="左に回転" width="27" height="27" id="rotateboxLeftBtn" style="display:none"></a></span>' +
'<span class="rotateRight"><a href="#" onClick="YAHOO.rotatebox.rotatePhoto(1, 90);return false;"><img src="http://i.yimg.jp/images/socialproducts/album/rotateRight.gif" alt="右に回転" width="27" height="27" id="rotateboxRightBtn" style="display:none"></a></span>' +
'<div class="rotatePhotoSwf">' +
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="120" height="120" id="rotatePhotoObj" name="rotatePhotoObj1" align="middle">' +
'<param name="allowScriptAccess" value="always" />' +
'<param name="allowFullScreen" value="false" />' +
'<param name="movie" value="http://i.yimg.jp/images/socialproducts/album/swf/rotatePhotoObj.swf?'+(new Date()).getTime()+'" />' +
'<param name="quality" value="high" />' +
'<param name="bgcolor" value="#ffffff" />' +
'<embed src="http://i.yimg.jp/images/socialproducts/album/swf/rotatePhotoObj.swf" quality="high" bgcolor="#ffffff" width="120" height="120" name="rotatePhotoObj" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
'</object>' +
'</div>' +
'</div>' +
'<div class="buttonContainer">' +
'<input type="submit" class="submit" name="#" value="決定" id="lightBoxSubmitOk" disabled>' +
'<input type="reset" class="reset" name="#" value="キャンセル" id="lightBoxSubmitNg">' +
'</div>' +
'</div>';
}
YAHOO.rotatebox.showNoFlashMessage = function()
{
var body_el = document.getElementById('wrapper');
body_el.innerHTML =
'<div class="lightBoxRotatePhoto">' +
'<div class="pluginMessage">' +
'Adobe Flash Playerを入手またはアップデートしてください。<br>' +
'詳しい情報は「<a href="'+global_helpurl['flash_inst']+'">Adobe Flash Playerをインストールするには</a>」をご覧ください。' +
'</div>' +
'<div class="buttonContainer">' +
'<input type="reset" class="reset" name="#" value="閉じる" id="lightBoxSubmitNg2">' +
'</div>' +
'</div>';
}
YAHOO.rotatebox.getPhotoInfo = function()
{
var obj = new Object();
obj.name = navigator.appName;
obj.platform = navigator.platform;
obj.url = global_items[YAHOO.rotatebox.photo_id].image_url;
return obj;
}
YAHOO.rotatebox.imgLoadInit = function()
{
document.getElementById('rotateboxLeftBtn').style.display = 'inline';
document.getElementById('rotateboxRightBtn').style.display = 'inline';
document.getElementById('lightBoxSubmitOk').disabled = false;
}
YAHOO.rotatebox.errorProcess = function()
{
}
YAHOO.rotatebox.rotatePhoto = function( type, angle )
{
if ( navigator.appName.indexOf("Microsoft") != -1 ) {
YAHOO.rotatebox.angle = document.getElementById('rotatePhotoObj').rotate(type, angle);
} else {
YAHOO.rotatebox.angle = document.rotatePhotoObj.rotate(type, angle);
}
}
YAHOO.rotatebox.rotating = function()
{
YAHOO.rotatebox.rotating_opened = false;
YAHOO.rotatebox.Rotating = new YAHOO.widget.Panel(
"Rotating",
{
width: "215px",
height: "100px",
close: false,
underlay: "none",
modal: true,
visible: false,
draggable: false
}
);
var templateStr =
'<div id="wrapper" style="width:200px; font-size:75.4%;">' +
'<!-- lightBoxNowLoadging -->' +
'<div class="lightBoxNowLoadging">' +
'<img src="http://i.yimg.jp/images/socialproducts/album/loading.gif" alt="実行中です" width="32" height="32">' +
'<div class="description">' +
'実行中です。' +
'</div>' +
'</div><!-- /lightBoxNowLoadging -->' +
'<!-- /lightBoxNowLoadging end -->' +
'</div>';
YAHOO.rotatebox.Rotating.setBody( templateStr );
var E = YAHOO.util.Event;
E.addListener( document, 'keypress', function(evt){
if (evt.keyCode == 27){
YAHOO.rotatebox.rotating_close();
}
} );
}
YAHOO.rotatebox.rotating_open = function()
{
YAHOO.util.Dom.getFirstChild(document).style.overflow = "hidden";
YAHOO.rotatebox.rotating_opened = true;
var RT = YAHOO.rotatebox.Rotating;
RT.render(document.body);
RT.center();
RT.show();
return false;
}
YAHOO.rotatebox.rotating_close = function()
{
if ( !YAHOO.rotatebox.rotating_opened ) { return false; }
YAHOO.rotatebox.rotating_opened = false;
YAHOO.rotatebox.Rotating.hide();
YAHOO.util.Dom.getFirstChild(document).style.overflow = "scroll";
return false;
}

