montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

var testresults

//----------------------------------------------------------------------------------------
function pop(url,w,h,scroll){
  if(scroll==1) bars='yes';
	else bars='no';
  popwindow= open(url, "popwin","width=" + w + "px,height==" + h + "px,top=0,left=0;fullscreen=no,scrollbars==" + bars + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes");
}

function run(url) {
    setTimeout("top.location.href='" + url + "'",3000);
}

function obiereply(){
  if(document.guest.replycomm_name.value=='obie'){
    document.guest.replycomm_name.value='Obie';
    document.guest.replycomm_email.value='obiewebsite@yahoo.com';
    document.guest.place.value='http://obiewebsite.sf.net';
    document.guest.replycomm_message.focus();

  }
}

function checkemail(ob){
var str=ob.value
var filter=/^.+@.+\..{2,4}$/
if (filter.test(str))
testresults=true
else{
alert('ERROR: "' + ob.value + '"\nThis email address is not correct')
testresults=false
ob.style.backgroundColor = 'orange';
ob.select()
}
return (testresults)
}

function checklength(ob,charnum){
	sb = ob.value.length;
	sb = ob.value.length;
	if (sb >= charnum){testresults=true;}
	else {
	testresults = false;
	alert('ERROR: Your input data "' + ob.value + '"\n\nThis data must be over 3 charactors \nor this data has been baned');
	ob.focus();
	}
	return(testresults);
}

function mota(x)

{var follow=x
if (document.all){

	curscroll.style.visibility="visible"
	curscroll.innerHTML='<table ID=\"sample\" border=0 cellspacing=1 bgcolor=black><tr><td width=100% bgcolor=#F0F0F0>' + x + '</td></tr></table>'
	//IF YOU WANT TO ADD FADING EFFECT FOR TOOLTIPS, PLEASE REMOVE '//'. HAVE FUN
	//document.all.sample.style.filter = 'alpha(opacity=80);'
}
curscroll.style.left=document.body.scrollLeft+event.clientX-20
curscroll.style.top=document.body.scrollTop+event.clientY+20
}

function tatmota(){
	curscroll.style.visibility="hidden"
}


function showfounded(){
alert('ObieWebsite.SourceForge.net was founded at Dec 31,2002');
}
function bm(url,title){
  if (document.all) window.external.AddFavorite(url,title);
}
function writedate(){
if (navigator.appName && navigator.appName.indexOf("Netscape")>=0) {}
else {
  document.write('<a href=\"javascript:bm(\'http://obiewebsite.sourceforge.net\',\'Obie FREE scripts website\')\" ONMOUSEOVER=\"window.status=\'Add obiewebsite.sourceforge.net to your Favourite\'; return true\" ONMOUSEOUT=\"window.status=\'\'\">Add to favourite</a>');
  }
}
function countup(yr,m,d){
today=new Date()
todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
todaym=today.getMonth()
todayd=today.getDate()
todaystring=montharray[todaym]+" "+todayd+", "+todayy
paststring=montharray[m-1]+" "+d+", "+yr
difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
difference+=" days"
document.write(difference)
}

function newbg(obj,state) {
//Cach dung: (this,'over') , (this.'out')
	if (state=="over") {
		obj.style.backgroundColor ='ECF5FF';
		obj.style.cursor='default';
	}
	else {
		obj.style.backgroundColor ='white';
	}
}

//----------------------------------------------------------------------------------------

function getcode(){
pop('about:Please wait',400,250,0);
var s='<title>Code of ObieWebsite button</title><body bgcolor=#F0F0F0><font face=Arial color=black size=2><b>Thank you for link back to Obie Website<br>Please save our Button image and add below code in your webpages.</b></font><br><br><textarea cols=40 rows=10 onfocus="this.select();"><!--begin Obie button--><a href="http://obiewebsite.sourceforge.net" target="_blank" title="Free PHP scripts at obiewebsite.sourceforge.net"><img src="**ON_YOUR_SERVER**/obiewebsite.gif" border=0></a><!--End--></textarea>';
popwindow.document.write(s);
}

function addreply(){
	if (document.all.checkre.checked){
		document.all.remessage.value = document.all.remessage.value + '<br><br><b><i>Reply of <a href=mailto:' + document.all.reemail.value + '>' + document.all.rename.value + '</a></b><br>' + document.all.addre.value + '</i>';
	}
	else document.all.remessage.value = document.all.oldcomment.value;
}

function delcomm(x){
  document.all.delfr.src='func.php?action=delcomm&' + x;
}

function check(stat)
{
	var len = document.forms[0].elements.length;
	for( var i=0; i < len; i++ )
	{
		chbox = document.forms[0].elements[i];
		if(chbox.type == "checkbox")
			chbox.checked = stat;
	}
	
}



function vietbar(){
    if ((navigator.appName.indexOf("Microsoft") != -1) && (parseInt(navigator.appVersion) >= 4)) {
    document.write('<TABLE cellpadding="0" cellspacing="0 border=0><TR><TD align="right" width="30%" bgcolor="#EEEEEE"></TD><TD align="left" width="70%" bgcolor="#EEEEEE" colspan="3">');
    document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="350">');
    document.write('<TR>');
    document.write('<TD bgcolor=#0060C8 width="0"><Img src="images/blank.gif" name="u1" height="8" width="0"></TD>');
    document.write('<TD bgcolor=#F0F0F0 width="350"><Img src="images/blank.gif" name="u2" height="8" width="350"></TD>');
    document.write('</TR>');
    document.write('</TABLE>');
    document.write('</TD></TR></table>');
	}
    else document.write(' ');
}

function f1(a,num){
    mota('Max of input length = <b>'+num+'</b> chars');
    x = num - a.value.length;
    if (x < 0) { a.value = a.value.substring(0,num); x = 0; tatmota(); }
    document.u1.width=350*(num-x)/num;
    document.u1.alt=num-x+" chars used";
    document.u2.width=350*x/num;
    document.u2.alt=x+" chars available";
}


//////////////OVER7314 Including////////////////////////////////////////////////

tPopWait=0;
tPopShow=2000;
showPopStep=10;
popOpacity=99;

sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;


function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.zzzpop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.zzzpop=o.title;o.title=""};
	if(o.zzzpop!=sPop) {
			sPop=o.zzzpop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				zzzpopLayer.innerHTML="";
				zzzpopLayer.style.filter="Alpha()";
				zzzpopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		zzzpopLayer.className=popStyle;
		zzzpopLayer.innerHTML='<table bgcolor=black cellspacing=0 cellspadding=0 border=0><tr><td bgcolor=#F0F0F0>' + sPop + '</td></tr></table>';
		popWidth=zzzpopLayer.clientWidth;
		popHeight=zzzpopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		zzzpopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		zzzpopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		zzzpopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){

	if(zzzpopLayer.filters.Alpha.opacity<popOpacity) {
		zzzpopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			zzzpopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}

}

function fadeIn(){

	if(zzzpopLayer.filters.Alpha.opacity>0) {
		zzzpopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}

}
document.onmouseover=showPopupText;


function updownshadow(){
if (event.srcElement.effect=="popshadow"){
shadowobj=event.srcElement
if (event.type=="mousedown"){
shadowobj.filters[0].color=shadowobj.mousedowncolor
shadowobj.style.left=shadowobj.style.top=0
}
else if (event.type=="mouseout" && event.fromElement.effect=="popshadow" || event.type=="mouseup"){
shadowobj.filters[0].color=shadowobj.mouseupcolor
shadowobj.style.left=shadowobj.style.top=shadowobj.filters[0].OffX*(-1)
}
}
}

if (document.attachEvent){
document.attachEvent("onmousedown", updownshadow)
document.attachEvent("onmouseup", updownshadow)
document.attachEvent("onmouseout", updownshadow)
}


//////////////HTMLarea including////////////////////////////////////////////////

_editor_url = "inc/htmlarea/";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

var config = new Object();    // create new config object

config.width = "100%";
config.height = "250px";
config.bodyStyle = 'background-color: white; font-family: "Verdana"; font-size: x-small;';
config.debug = 0;

// NOTE:  You can remove any of these blocks and use the default config!

config.toolbar = [
    ['fontname'],
    ['fontsize'],
    ['fontstyle'],
    ['linebreak'],
    ['bold','italic','underline','separator'],
//  ['strikethrough','subscript','superscript','separator'],
    ['justifyleft','justifycenter','justifyright','separator'],
    ['OrderedList','UnOrderedList','Outdent','Indent','separator'],
    ['forecolor','backcolor','separator'],
    ['HorizontalRule','Createlink','InsertImage','htmlmode','separator'],
    ['about','help','popupeditor'],
];

config.fontnames = {
    "Arial":           "arial, helvetica, sans-serif",
    "Courier New":     "courier new, courier, mono",
    "Georgia":         "Georgia, Times New Roman, Times, Serif",
    "Tahoma":          "Tahoma, Arial, Helvetica, sans-serif",
    "Times New Roman": "times new roman, times, serif",
    "Verdana":         "Verdana, Arial, Helvetica, sans-serif",
    "impact":          "impact",
    "WingDings":       "WingDings"
};
config.fontsizes = {
    "1 (8 pt)":  "1",
    "2 (10 pt)": "2",
    "3 (12 pt)": "3",
    "4 (14 pt)": "4",
    "5 (18 pt)": "5",
    "6 (24 pt)": "6",
    "7 (36 pt)": "7"
  };

//config.stylesheet = "http://www.domain.com/sample.css";
  
config.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
  { name: "headline",     className: "headline",  classStyle: "font-family: arial black, arial; font-size: 28px; letter-spacing: -2px;" },
  { name: "arial red",    className: "headline2", classStyle: "font-family: arial black, arial; font-size: 12px; letter-spacing: -2px; color:red" },
  { name: "verdana blue", className: "headline4", classStyle: "font-family: verdana; font-size: 18px; letter-spacing: -2px; color:blue" }

// leave classStyle blank if it's defined in config.stylesheet (above), like this:
//  { name: "verdana blue", className: "headline4", classStyle: "" }  
];
