﻿//Status Begin
var Writings=8;
var Reviews=0;
var Trackbacks=0;
//Status End
//LatestReviews Begin
var LatestReviews = new Array( );//LatestReviews End
//Directories Begin
var Directories = new Array(  
new Directory('f/index.html','inspiration',1,'f'),
new Directory('f_2_d2/index.html','details',5,'f_2_d2'),
new Directory('f_2_d3/index.html','icon',1,'f_2_d3'),
new Directory('f_2_d7/index.html','about us',1,'f_2_d7'));//Directories End
//Menologies Begin
var Menologies = new Array(  
new Menology('2009-11',3,'2009-11.html'),
new Menology('2009-10',5,'2009-10.html'),
new Menology('Index &amp; Tags',-1,'index.html'));//Menologies End
//Resources Begin
var Resources = new Array( );//Resources End
//Specials Begin
var Specials = new Array(  
new Special('2009-11-15','f_2_d3/p15.html','DANCER IN THE DARK [PARIS] by YIMIN'),
new Special('2009-11-11','f_2_d2/p13.html','I LOVE TOGA [Hong Kong] by SHIHO'),
new Special('2009-10-18','f_2_d2/p12.html','Second SKINS [HongKong] by SHIHO KOO'),
new Special('2009-10-15','f_2_d2/p10.html','uniqueness is more powerful than tendency [HongKong] by SHIHO KOO'));//Specials End
//RandomWritings Begin
var RandomWritings =   new Array(  
'<li><a href="../f/p11.html">BABY BABY BABY [Berlin] by Ymin</a></li>'       ,
'<li><a href="../f_2_d2/p10.html">uniqueness is more powerful than tendency [HongKong] by SHIHO KOO</a></li>'       ,
'<li><a href="../f_2_d3/p15.html">DANCER IN THE DARK [PARIS] by YIMIN</a></li>'       ,
'<li><a href="../f_2_d7/p6.html">Introducing The Team</a></li>'       ,
'<li><a href="../f_2_d2/p9.html">Kisumu [HongKong] by SHIHO KOO</a></li>'       );//RandomWritings End
//HotestWritings Begin
var HotestWritings =  new Array(  
'<li><a href="../f_2_d2/p10.html">uniqueness is more powerful than tendency [HongKong] by SHIHO KOO</a></li>'       ,
'<li><a href="../f_2_d2/p9.html">Kisumu [HongKong] by SHIHO KOO</a></li>'       );//HotestWritings End
//LastUpdateDate Begin
var LastUpdateDate=20091115;
//LastUpdateDate End
var Months = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var YunY_Calendar = "";
var Now = new Date();
var When = new Date( Now.getFullYear(),Now.getMonth(),1);
var Special ="-";
function FindSpecial(SpecialDate){for(var i=0;i<Specials.length;i++){if(Specials[i].UpdateDate==SpecialDate){return i;}}return -1;}
function setMonthYear(){YunY_Calendar.rows[0].cells[1].innerHTML=Months[When.getMonth()]+" "+When.getFullYear();for(var i=0;i<6;i++)for(var j=0;j<7;j++){YunY_Calendar.rows[2+i].cells[j].innerHTML="";}for(var i=0;i<6;i++)for(var j=0;j<7;j++){if(  (i*7+j-When.getDay()+1)>0 && (i*7+j-When.getDay()+1)<=(32-(new Date( When.getFullYear(),(When.getMonth()),32)).getDate()) ){if(FindSpecial(When.getFullYear()+"-"+(When.getMonth()+1)+"-"+(i*7+j-When.getDay()+1))>-1){YunY_Calendar.rows[2+i].cells[j].innerHTML="<a href='"+Path+Specials[FindSpecial(When.getFullYear()+"-"+(When.getMonth()+1)+"-"+(i*7+j-When.getDay()+1))].LinkID+"' title='"+Specials[FindSpecial(When.getFullYear()+"-"+(When.getMonth()+1)+"-"+(i*7+j-When.getDay()+1))].Abstract+"' ><span class='tdStrong'>"+(i*7+j-When.getDay()+1)+"</span></a>";}else{YunY_Calendar.rows[2+i].cells[j].innerHTML=i*7+j-When.getDay()+1;}}}if((Now.getMonth()==When.getMonth())&&(Now.getFullYear()==When.getFullYear())){YunY_Calendar.rows[2+Math.floor((Now.getDate()+When.getDay()-1)/7)].cells[Now.getDay()].innerHTML="<font color='red'>"+Now.getDate()+"</font>";}}
function PreviousMonth(){if((When.getMonth()-1)<0){When = new Date( When.getFullYear()-1,(When.getMonth()+11)%12,1);}else{When = new Date( When.getFullYear(),(When.getMonth()+11)%12,1);}setMonthYear();}
function NextMonth(){if((When.getMonth()+1)>11){When = new Date( When.getFullYear()+1,(When.getMonth()+1)%12,1);}else{When = new Date( When.getFullYear(),(When.getMonth()+1)%12,1);}setMonthYear();}
function Directory(ID,Name,Quantity,Alias){this.ID=ID;this.Name=Name;this.Quantity=Quantity;this.Alias=Alias;}
function Menology(Name,Quantity,LinkID){this.Name=Name;this.Quantity=Quantity;this.LinkID=LinkID;}
function Special(UpdateDate,LinkID,Abstract){this.UpdateDate=UpdateDate;this.LinkID=LinkID;this.Abstract=Abstract;}
function DeleteReviewLink(ReviewID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'Process/ReviewDelete.asp?ID='+ReviewID+'">Delete</a>');}}
function DeleteReviewLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'Process/ReviewDelete.asp?ID='+ID+'">Delete</a>');}}
function indexOfD(dir){for(var i=0;i<Directories.length;i++){if(('/'+Directories[i].ID).indexOf('/'+dir+'/index.')==0)return i;}return -1;}
function E(ID){return document.getElementById(ID);}
function OKReviewLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'process/reviewaction.asp?id='+ID+'">OK?</a>');}}
function ShowReviewLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'process/reviewaction.asp?id='+ID+'">Show</a>');}}
function HideReviewLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'process/reviewaction.asp?a=hide&id='+ID+'">Hide</a> ');}}
function EditLink(WritingID,AllowReview){if(AllowReview==1){document.write(' <span style="cursor:pointer" onclick="if(E(\'reviews\').style.display!=\'none\') {E(\'reviews\').style.display=\'none\';document.reviewform.author.focus();} else E(\'reviews\').style.display=\'block\';">[<strong>Review</strong>]</span>');} if (getCookie("blogwhooshYunY")!=""){document.write(' <a href="'+Path+'process/writingedit.asp?id='+WritingID+'">[Edit]</a>');}}
function Quote(ID){var qstr = E('C'+ID).innerHTML.replace(/<.*?>/mg,'').replace(/\[.*\]/mg,''); if(qstr.length>10)qstr = qstr.substring(0,10) +'...'; document.reviewform.content.value+= '['+E('A'+ID).innerHTML.replace(/<.*?>/mg,'')+':'+qstr+']\r\n'; document.reviewform.content.focus();}
function WriteDirectories(){document.write('<ul class="mul" id="muldirectories">');for(var i=0;i<Directories.length;i++){document.write('<li><a href="'+Path+Directories[i].ID+'">'+Directories[i].Name+'</a> <span class="smallfont">['+Directories[i].Quantity+']</span></li>');}document.write('</ul>');}
function WriteResources(){document.write('<ul class="mul" id="mulresources">');for(var i=0;i<Resources.length;i++){document.write(Resources[i]);}document.write('</ul>');}
function WriteMenologies(){document.write('<ul class="mul" id="mulmenologies">');for(var i=0;i<Menologies.length;i++){document.write('<li><a href="'+Path+'m/'+Menologies[i].LinkID+'">'+Menologies[i].Name+'</a>'+(Menologies[i].Quantity>-1?' <span class="smallfont">['+Menologies[i].Quantity+']</span>':'')+'</li>');}document.write('</ul>');}
function WriteLastestReviews(){document.write('<ul class="mul" id="mullatestreviews">');for(var i=0;i<LatestReviews.length;i++){document.write(LatestReviews[i]);}document.write('</ul>');}
function WriteRandomWritings(){document.write('<ul class="mul" id="mulrandomwritings">');for(var i=0;i<RandomWritings.length;i++){document.write(RandomWritings[i]);}document.write('</ul>');}
function WriteHotestWritings(){document.write('<ul class="mul" id="mulhotestwritings">');for(var i=0;i<HotestWritings.length;i++){document.write(HotestWritings[i]);}document.write('</ul>');}
function ResizeImg(imgID){if(imgID.width>500)imgID.width=500;}
function getCookie(arg_CookieName){fromN=document.cookie.indexOf(arg_CookieName+"=")+0;if((fromN)!=-1){		fromN+=arg_CookieName.length+1; toN=document.cookie.indexOf(";",fromN)+0;	if(toN==-1){		toN=document.cookie.length}	return unescape(decodeURI(document.cookie.substring(fromN,toN)))	}	return ""	}
function Search(event,oInput){var keyCode=(event)?event.keyCode:keyStroke.which;if(keyCode==13){top.location=Path+"Process/Search.asp?Keywords="+oInput.value;return false;}return true;}function Search2(oInputId){var oInput=E(oInputId);top.location=Path+"Process/Search.asp?Keywords="+oInput.value;return false;}
function Showdadv(){if(E('dadv').style.display=='none'){E('dadv').style.display='inline';E('code').src='../process/code.asp';}}
function LoadLastUser(){if((getCookie('YunYNickName')!='')&&(getCookie('YunYHomePage')!='')){document.reviewform.author.value=getCookie('YunYNickName');document.reviewform.link.value=getCookie('YunYHomePage');}}
function CheckSearchCache(key,N){if(LastUpdateDate==0) return; if(LastUpdateDate>N) location.href='../process/search.asp?keywords='+key;}
function MenologiesChart(){var maxy = 0;	var total = 12;	for(var i=Menologies.length-2;(i>-1 && i>Menologies.length-2-total);i--){	if(Menologies[i].Quantity>maxy) maxy=Menologies[i].Quantity;	}	 	var width = parseInt((Menologies.length-1)*45); 	var height = 100; 	var chd=""; 	var xl = ""; 	var chm=""; 	 	var t = 0; 	var totalv=0; 	for(var i=Menologies.length-2;(i>-1 && i>Menologies.length-2-total);i--){ 		var v = parseFloat(Menologies[i].Quantity*100/maxy).toFixed(4); 		chd +=v+','; 		xl +=Menologies[i].Name+'|'; 		chm +='o,FF9900,0,'+(Menologies.length-2-i)+',5.0|'; 		t++; 		totalv = totalv+parseFloat(Menologies[i].Quantity*100/maxy); 	} 	totalv = totalv/t/100; 	chm = 'h,dddddd,0,'+totalv.toFixed(4)+',1|'+chm; 	  	 	if(chd.length>0) chd = chd.substring(0,chd.length-1); 	if(xl.length>0) xl = xl.substring(0,xl.length-1);	 	if(chm.length>0) chm = chm.substring(0,chm.length-1); 	 	 	var yl = '|'+maxy/2+'|'+maxy; 	var chtt = 'Writings in the past months';	 	 	var url = 'http://chart.apis.google.com/chart?chs='+width+'x'+height+'&chd=t:'+chd+'&chtt='+chtt+'&chf=bg,s,f5f5f5&chm='+chm+'&cht=lc&chxt=x,y&chxl=0:|'+xl+'|1:|'+yl; 	if(t>5)document.write('<p><img src="'+url+'" /></p>');	 }function ShowCalendar(){document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0" id="YunY_Calendar"><tr><td><div onclick="javascript:PreviousMonth()" style="cursor:pointer">«</div></td><td colspan="5" align="center"></td><td ><div onclick="javascript:NextMonth()" style="cursor:pointer;">»</div></td></tr><tr class="tdStrong"><td >Su</td><td >M</td><td >Tu</td><td >W</td><td >Th</td><td >F</td><td >Sa</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>');YunY_Calendar=E("YunY_Calendar");setMonthYear();}function OKMessageLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'process/p_messageaction.asp?id='+ID+'">OK?</a>');}}
function ShowMessageLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'process/p_messageaction.asp?id='+ID+'">Show</a>');}}
function ShowReplyLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<span style="cursor:pointer;text-decoration: underline;" onclick="if(E(\'replyform'+ID+'\').style.display!=\'none\') E(\'replyform'+ID+'\').style.display=\'none\';else E(\'replyform'+ID+'\').style.display=\'block\';">Reply</span> ');}}
function HideMessageLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'process/p_messageaction.asp?a=hide&id='+ID+'">Hide</a> ');}}
function DeleteMessageLink(ID){if (getCookie("blogwhooshYunY")!=""){document.write('<a href="'+Path+'Process/p_messageDelete.asp?ID='+ID+'">Delete</a>');}}

