/* ================= Duplicate HTML ======== */
global_count=1;

function duplicate(value, addToWhere, limit) {
	//value: value to be duplicated
	//addtoWhere: Where will it be duplicated at?
	//limit: number of duplications allowed
	if (global_count<=limit)
		addToWhere.innerHTML+=value.innerHTML;
	global_count++;

}
/* ================= Lazy link ======== */
function goTo(href) {

	location.href=href;
}

/* ================= Mouseover effect ======== */
function anim(name,type) {

	if (type==0)
		document.images[name].src="/images/"+name+".gif";
	if (type==1)
		document.images[name].src="/images/"+name+"_over.gif";
	if (type==2)
		document.images[name].src="/images/"+name+"_down.gif";
}

/* ================= For Player Form: Checks All or None ======== */

function checkAll(cbox,formObj) {
	var i=0;
	if (cbox.checked==true)
		cbox.checked==false;
	else
		cbox.checked==true;
	while (formObj.elements[i]!=null) {
		formObj.elements[i].checked=cbox.checked;
		i++;
	}
}
/* ================== For forms: Checks if Enter key is pressed ========== */

function checkEvent(formObj){
     var key = -1 ;
     var shift ;

     key = event.keyCode ;
     shift = event.shiftKey ;

     if (!shift && key == 13)
     {
          formObj.submit() ;
     }
}
/* ================= To show/hide a block of text ==================*/
function show(block) {
	theBlock=document.getElementById(block);
	if (theBlock.style.display=="none") {
		theBlock.style.display="block";
	}
	else {
		theBlock.style.display="none";
	}
}
/* ================ SetCookie ==============================*/
function setCookie()
{
     the_date = new Date("December 31, 2023");

     the_cookie_date = the_date.toGMTString();
//alert(the_cookie_date);
     the_login = document.forms['loginForm'].flogname.value;

    var the_cookie = "loginCookie=" + escape("loginName:"+the_login)+";expires="+the_cookie_date+";path=/;domain=fridayniteparty.com;";
//alert(the_cookie);
    document.cookie = the_cookie;

}
    var the_cookie = document.cookie;

    var the_cookie = unescape(the_cookie);
//alert(the_cookie);
    var broken_cookie = the_cookie.split(":");
//alert(broken_cookie[1]);
 //   the_name = broken_cookie[1];
//	lname=the_name.split(';')[0];
if (document.forms['loginForm']!=null) {
	document.forms['loginForm'].flogname.value=lname;
	document.forms['loginForm'].fpassword.focus();
}
//alert(the_name+",length:"+the_name.length);
//alert(the_name);
