function addfavorite(){
	window.external.AddFavorite(location.href, document.title);
}

function findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function menu() {
  var i,p,v,obj,args=menu.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
    
    if (obj = document.getElementById("blocker"))
    {
	    if (v == 'visible')
		obj.style.visibility = "hidden";
	    else
		obj.style.visibility = "visible";
    }

}

function hideall() {
	for (x=1;x<6;x++) {	
	eval("document.all.img" + x + ".style.visibility='hidden'");
	//alert(x);
	}
}

function acpopup(strURL,strType,strHeight,strWidth) {
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
window.open(strURL, 'newWin', strOptions);
}

// Time and Date

var day="";
var month="";
var myweekday="";
var year="";
newdate = new Date();
mydate = new Date();

newtime=newdate.getTime();

mydate.setTime(newtime);
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
myyear= mydate.getYear();
year = myyear;

if (year < 2000)
year = year + 1900;

myhours = mydate.getHours();
if (myhours < 10){	myhours = "0" + myhours; }

myminutes = mydate.getMinutes();
if (myminutes < 10){ myminutes = "0" + myminutes; }

arday = new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY")
armonth = new Array("JANUARY ","FEBRUARY ","MARCH ","APRIL ","MAY ","JUNE ","JULY ","AUGUST ","SEPTEMBER ", "OCTOBER ","NOVEMBER ","DECEMBER ")
ardate = new Array("0TH","1ST","2ND","3RD","4TH","5TH","6TH","7TH","8TH","9TH","10TH","11TH","12TH","13TH","14TH","15TH","16TH","17TH","18TH","19TH","20TH","21ST","22ND","23RD","24TH","25TH","26TH","27TH","28TH","29TH","30TH","31ST");

var time = (myhours + ":" + myminutes + " " +  arday[myday] + " " + ardate[myweekday] + " " + armonth[mymonth] + year );

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function GetCookie( name ) {
 var start = document.cookie.indexOf( name + "=" );
 var len = start + name.length + 1;
 if ( ( !start ) &&
 ( name != document.cookie.substring( 0, name.length ) ) )
 {
 return null;
 }
 if ( start == -1 ) return null;
 var end = document.cookie.indexOf( ";", len );
 if ( end == -1 ) end = document.cookie.length;
 return unescape( document.cookie.substring( len, end ) );
}

function forumPopup() {
	if( new String(document.location).indexOf("forums") == -1 ) return;
	if( GetCookie("forumpopup") ) return;
	SetCookie("forumpopup",1,1);
	window.open('http://www.kffl.com/static/popups/popup_forums_general.html','kfflpopup','menubar=0,toolbar=0,scrollbars=0');
}

//disabled by uri , 12/7/08 per ryan request
//forumPopup();
