//////////////////////////////////////////////////////////////////////////////
//  Birdsoft.net Script
//  Copyright 2001-2004 by Birdsoft (Brian Heilman)
//
//  This code can only be used under license. Any unauthorized use is strictly
//  prohibited. This is not Freeware or Shareware!!! 
//



function GetCookie (name) 
{  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) 
	{
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) 
			break;   
	}  
	return null;
}

function SetCookie (name, value) 
{  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) 
{  
//	SetCookie (name,null);
	var exp = new Date();  
	exp.setTime (exp.getTime() - 100);   
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function getCookieVal(offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}


//Formatting to 0.00 form

function formatCurrency(num) 
{

	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num)) num = "0";
		cents = Math.floor((num*100+0.5)%100);
//		cents = Math.floor((num*10+0.5)%10);

	num = Math.floor((num*100+0.5)/100).toString();
//	num = Math.floor((num*100+0.5)/10).toString();

	if(cents < 10) 
		cents = "0" + cents;

	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));

	return (num + '.' + cents);
}




//Writes name for next time to cookie
function setPersonalizedName(value)
{
	var expIs = new Date(); 
	expIs.setTime(expIs.getTime() + (60*24*60*60*1000));//60 days

	SetCookie('PzdNameBS1',value ,expIs)
}

//Reads name outta the cookie, to personalize the page
function GetPersonalizedName()
{
	var result = GetCookie('PzdNameBS1')	
    if(result == null) 
	{
		return null;
	}
	else
	{
		return result;
	}

}

function setPersonalize(value)
{
	var expIs = new Date(); 
	expIs.setTime(expIs.getTime() + (60*24*60*60*1000));//10 days

	SetCookie('PersonalBS1',value ,expIs)
}

function getPersonalize()
{
    var result = GetCookie('PersonalBS1')	
    if(result == null) 
	{
		return null;
	}
	else
	{
		return result;
	}
}

function NewPerson()
{
	DeleteCookie('PersonalBS1');
	
	pbu = getPersonalize();
	
//	alert("in this god foresaken place its " + pbu);
	window.history.go(0);

}

function setPersonalizePW(value)
{
	var expIs = new Date(); 
	expIs.setTime(expIs.getTime() + (30*24*60*60*1000));//30 days

	SetCookie('PW',value ,expIs)
}

function getPersonalizePW()
{
    var result = GetCookie('PW')	
    if(result == null) 
	{
		return null;
	}
	else
	{
		return result;
	}
}


function personalize()
{
	var name = document.pzd.pname.value;
	setPersonalizedName(name);


	//just setting to a value!!
	setPersonalize("Dog");




	//verifying matched password
//        if(document.pzd.pword.value != document.pzd.pword2.value)
//	{
           //alert("The passwords you entered do not match, please retype!");
	   //document.pzd.pword.focus();
	   //return;
//	}
//	var pw = document.pzd.pword.value;
//	setPersonalizePW(pw);

	window.history.go(0);
}


function DrawPersonalize()
{
	//Need to fill in blanks from previous results if ya can

	if(navigator.cookieEnabled != true)
	  {
	  return;
	  }
	   
	var DrawData;

	var theRet = getPersonalize();
//	alert(" in here its value is:" + theRet);

	if(theRet == null)
	{
		puname = GetPersonalizedName();
		if(puname == null)
			puname = "";
		//<!-- Lil Personalize Box -->
		DrawData ="<BR><BR><BR><BR>";
		DrawData += "<center><table border=1 bordercolor='#D3D3D3' bgcolor='#A9A9A9' width='90%'><tr><td><form name='pzd'>";
		DrawData += "<center><font size='-2' color='#FFFFFF'>Personalize</font><br></center>"; 
		DrawData += "<font size='-3' color='#FFFFFF'>Name:</font><br><input type='text' size=10 name='pname' value='" + puname + "'>";
		
		DrawData += "<br><br><center><input type=Image src='images//submitbtn.gif'  width='58' height='20' onclick='javascript:personalize()'></center>";
		DrawData += "</form></td></tr></table></center>";
	}
	else
	{	
		DrawData ="<BR><BR><BR><BR>";
		DrawData += "&nbsp; <img name='ptimg100' src='images//bluept.gif' width='9' height='10'><a href='javascript:NewPerson();' onmouseover='ShowLinkImg(100)' onmouseout='HideLinkImg(100)'><font size='2' color='#00008B'>Personalize</font></a></font><br>";
	}

	document.write(DrawData);

}





function ShowLinkImg(image)
{
var name = "ptimg" + image;

document.images[name].src = "images//silverpt.gif";
}

function HideLinkImg(image)
{
var name = "ptimg" + image;

document.images[name].src = "images//bluept.gif";
}

function drawNavLinks2()
{
    var string = "";

    string += "&nbsp; <img name='ptimg1' src='images//bluept.gif' width= 9 height=10><a href='index.htm' onmouseover='ShowLinkImg(1)' onmouseout='HideLinkImg(1)'><font size='2' color='#00008B'>Home</font></a><br><br>";    
    string += "&nbsp; <img name='ptimg2' src='images//bluept.gif' width= 9 height=10><a href='services.htm' onmouseover='ShowLinkImg(2)' onmouseout='HideLinkImg(2)'><font size='2' color='#00008B'>Services</font></a><br>";    
    string += "&nbsp; <img name='ptimg5' src='images//bluept.gif' width= 9 height=10><a href='software.htm' onmouseover='ShowLinkImg(5)' onmouseout='HideLinkImg(5)'><font size='2' color='#00008B'>Software</font></a><br>";    
    string += "&nbsp; <img name='ptimg3' src='images//bluept.gif' width= 9 height=10><a href='aboutUs.htm' onmouseover='ShowLinkImg(3)' onmouseout='HideLinkImg(3)'><font size='2' color='#00008B'>About&nbsp;Us</font></a><br><br>";    

//    string += "&nbsp; <img src='images//bluept.gif' width= 9 height=10><a href='chat.htm' onmouseover='ShowLinkImg(11)' onmouseout='HideLinkImg(11)'><font size='2' color='#DCDCDC'>Chat</font></a><br>";    
//    string += "&nbsp; <img name='ptimg12' src='images//bluept.gif' width= 9 height=10><a href='#' onClick='openFreeChat()' onmouseover='ShowLinkImg(12)' onmouseout='HideLinkImg(12)'><font size='2' color='#00008B'>Chat</font></a><br><br>";    

    string += "&nbsp; <img name='ptimg4' src='images//bluept.gif' width= 9 height=10><a href='mailto:birdsoft@uglybass.com' onmouseover='ShowLinkImg(4)' onmouseout='HideLinkImg(4)'><font size='2' color='#00008B'>Contact&nbsp;Us</font></a><br>";    
    

   string += "<br><br><br><br><br><br><br><br>";

    document.write(string);

}

function drawNavLinks()
{
    var string = "";

//worm ones    string += "&nbsp; <img src='images//bsworm1a.gif' width=22 height=48 align=left><br><a href='index.htm' ><font size='2' >Home</font></a><br><br><a href='services.htm' ><font size='2' >Services</font></a><br>";    
//worm ones    string += "&nbsp; <img src='images//bsworm2a.gif' width=22 height=48 align=left><br><a href='software.htm' ><font size='2' >Software</font></a><br><br><a href='aboutus.htm' ><font size='2' >About Us</font></a><br>";    
    string += "<br>&nbsp;&nbsp;<img name='ptimg1' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='index.htm' onmouseover='ShowLinkImg(1)' onmouseout='HideLinkImg(1)'><font size='2' >Home</font></a><br>";    
//    string += "<br>&nbsp;&nbsp;<img name='ptimg2' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='services.htm' onmouseover='ShowLinkImg(2)' onmouseout='HideLinkImg(2)'><font size='2' >Services</font></a><br>";    
    string += "<br>&nbsp;&nbsp;<img name='ptimg7' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='software.htm' onmouseover='ShowLinkImg(7)' onmouseout='HideLinkImg(7)'><font size='2' >Software</font></a><br>";    
    string += "<br>&nbsp;&nbsp;<img name='ptimg8' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='aboutus.htm' onmouseover='ShowLinkImg(8)' onmouseout='HideLinkImg(8)'><font size='2' >About Us</font></a><br>";    


//    string += "&nbsp; <img name='ptimg2' src='images//bluept.gif' width= 9 height=10><a href='services.htm' onmouseover='ShowLinkImg(2)' onmouseout='HideLinkImg(2)'><font size='2' >Services</font></a><br>";    
//    string += "&nbsp; <img name='ptimg5' src='images//bluept.gif' width= 9 height=10><a href='software.htm' onmouseover='ShowLinkImg(5)' onmouseout='HideLinkImg(5)'><font size='2' >Software</font></a><br>";    
//    string += "&nbsp; <img name='ptimg3' src='images//bluept.gif' width= 9 height=10><a href='aboutUs.htm' onmouseover='ShowLinkImg(3)' onmouseout='HideLinkImg(3)'><font size='2' >About&nbsp;Us</font></a><br><br>";    

//    string += "&nbsp; <img src='images//bluept.gif' width= 9 height=10><a href='chat.htm' onmouseover='ShowLinkImg(11)' onmouseout='HideLinkImg(11)'><font size='2' color='#DCDCDC'>Chat</font></a><br>";    
//    string += "&nbsp;<img name='ptimg12' src='images//bluept.gif' width= 9 height=10><a href='#' onClick='openFreeChat()' onmouseover='ShowLinkImg(12)' onmouseout='HideLinkImg(12)'><font size='2' color='#00008B'>Chat</font></a><br><br>";    

    string += "<br>&nbsp;&nbsp;<img name='ptimg3' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='submitbug.htm' onmouseover='ShowLinkImg(3)' onmouseout='HideLinkImg(3)'><font size='2' >Submit&nbsp;Bug</font></a><br>";    
    string += "<br>&nbsp;&nbsp;<img name='ptimg5' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='faq.htm' onmouseover='ShowLinkImg(5)' onmouseout='HideLinkImg(5)'><font size='2' >F.A.Q.</font></a><br>";    
    string += "<br>&nbsp;&nbsp;<img name='ptimg6' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='discuss.htm' onmouseover='ShowLinkImg(6)' onmouseout='HideLinkImg(6)'><font size='2' >Forum</font></a><br>";    
    string += "<br>&nbsp;&nbsp;<img name='ptimg4' src='images//bluept.gif' width= 9 height=10>&nbsp;<a href='mailto:birdsoft@uglybass.com' onmouseover='ShowLinkImg(4)' onmouseout='HideLinkImg(4)'><font size='2' >Contact&nbsp;Us</font></a><br>";    
    

   string += "<br><br><br><br>";

    document.write(string);

}

function titleBar()
{
    var string = "";
    //string += "<link REL='stylesheet' HREF='bs1.css' TYPE='TEXT/CSS'>";
    //string += "<center><img src='images//BSLabel.gif' border=0 width=53 height=30 alt='Birdsoft'></center>";
    //document.write(string);


    string += "<table width='100%' cellpadding=3 cellspacing=0 border=0><tr><td align='left' valign='bottom'><center><img src='images//BSLabel.gif' border=0 width=53 height=30 alt='Birdsoft'></center>";
    string += "</td></tr></table>";
    document.write(string);
}

function drawTopNavBar()
{
	var string = "";

	string += "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
	string += "<tr><td valign='top'><IMG SRC=images//curve2.gif ALIGN=top WIDTH=11 HEIGHT=11 border=0></td>";
	string += "<td><center><font color='#00008B'>Custom Web Design and Programming</font></td></tr></table>";

    document.write(string);

}

function drawCopyright()
{
   var string = "";
   string += "<font size=-3 color='#FFFFFF'>..:: Copyright © 2004 - Birdsoft ::..</font>";

   document.write(string);
}


function greetings()
{
var string = "&nbsp;<font size='-1' color='#696969'>";

var result = GetPersonalizedName();
if(result == null)
  string += "Welcome to Birdsoft";
else
  string += "Welcome " + result;

string += "</font>";

document.write(string);
}


function openFreeChat() 
{
window.open("chatsingle.htm","_blank","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=510,height=400,screenX=0,screenY=0,left=0,top=0");
}

function CloseWindow() 

{

window.close();  

return true;

}



function drawChat()
{
var string = "";

string += "<center><applet archive='http://chat.planetz.net:8000/java/cr.zip' codebase='http://chat.planetz.net:8000/java/' code='ConferenceRoom.class' width='500' height='340' name='QuickChat'>";
string += "<param name='cabbase' value='http://chat.planetz.net:8000/java/cr.cab'><param name='channel' value='#uglybass'><param name='simple' value='true'><param name='bg' value='FFFFFF'>";
string += "<param name='fg' value='000000'><param name='font' value='helvetica'><param name='size' value='12'><param name='tickershadow' value='false'>";
string += "<param name='ticker' value='This chat powered by QuickChat by Planet Z Networks - http://www.quickchat.org, visit their site to add QuickChat to your site!!'>";
string += "<param name='colorpanel' value='true'><param name='roomsWidth' value='0'>";
var theName = GetPersonalizedName();
if(theName == null)
  theName = "Guest";
string += "<param name='nick' value='" + theName +"'>";
string += "<param name='user' value='quickchat'><param name='port' value='7000'><param name='showwindowbuttons' value='false'><param name='info' value='Planet Z QuickChat'><param name='showticker' value='true'></applet>";
document.write(string);
}

function drawRightSpecialWindow()
{
	var string = "";
	string += "<table border='0' cellpadding='0' cellspacing='0' > <tr cellpadding='0' cellspacing='0'><td cellpadding='0' cellspacing='0' COLSPAN=3><img src='images//btTop.gif' border='0' height=22 width=147></td></tr>";

	string += "<tr COLSPAN=3 height=245 cellpadding='0' cellspacing='0'><td width=12 cellpadding='0' cellspacing='0'>";
        string += "<img src='images//btLeft.gif' border='0' height=245 width=12></td><td cellpadding=0 cellspacing='0' width=120 margin=0 valign=top class='small'>";
	string += "<font color='#FF0000'>Hello</font><br><br>";
	string += "Welcome to Birdsoft. <br>Yes, as you may have noticed this very functional custom made web page <b>layout</b> gets used on more than one site. But believe me, "; 
	string += "we can make your site look like about anything!! <br><br>Check out our newly registered <a href='http://www.fishinbass.com'>'FishinBass.com'</a> for an example.";
	string += "<br><br>";
	string += "</td><td width=12 Align='right'> <img src='images//btRight.gif' border='0' height=245 width=12 align='right'></td></tr>";
	string += "<tr cellpadding=0 cellspacing='0'> <td  cellpadding=0 COLSPAN=3><img src='images//btBot.gif' border='0' height=14 width=147></td></tr></table>";

	document.write(string);
}

function drawRightMessage()
{
	var string = "";
<!--	string += "<center><b>Featured Product</b></center><br><br>";-->

//	string += "<center><a href='http://www.ultiplanner.com'><img src='images//uplilanim.gif'width=72 height=96 //border=0></a><br><br><a href='http://www.ultiplanner.com'><b>Ulti-Planner</b></a><br><br>Check it out now!</font></center>";
//	string += "<center><a href='dogateit2.htm'><img src='images//dogcal1th.gif'width=72 height=96 border=0></a><br><br><a href='dogateit2.htm'><b>The Dog Ate It</b></a><br><br><font color='#B22222'>Version 2.0 is Here!<br> Check it out now!</font></center>";

//	string += "<center><a href='trickhand.htm'><img src='images//thThumbF.gif'width=72 height=96 border=0></a><br><br><a href='trickhand.htm'><b>TrickHand</b></a><br><br><font color='#B22222'>Euchre Fans, Check Out Version 1.1!!</font></center>";

//	string += "<center><b>Featured Product</b></center><br>";
//	string += "<center><a href='fairwaywatch.htm'><img src='images//fw1sm.gif' border=0></a><br><br><a href='fairwaywatch.htm'><b>FairwayWatch</b></a><br><br><b>NEW VERSION 2.0!!</b></center>";

//	string += "<center><b>Featured Product</b></center><br><br>";
//	string += "<center><a href='dogateit2.htm'><img src='images//dogcal1th.gif'width=72 height=96 border=0></a><br><br><a href='dogateit2.htm'><b>The Dog Ate It</b></a><br>Student Planner<br><br>Back To School!!</center>";

	string += "<center><a href='upmain.htm'><img src='images//up20ls1th.gif'width=96 height=72 border=0></a><br><br><a href='upmain.htm'><b>Ulti-Planner</b></a><br>Personal Information Manager<br><br>New Version 2.1!!</center>";

//	string += "<center><b>Featured Product</b></center><br><br>";
//	string += "<center><a href='listwatch.htm'><img src='images//lwThumb.gif' width=72 height=96 border=0></a><br><br><a href='listwatch.htm'><b>ListWatch</b></a><br><br><a href='http://www.pocketpcawards.com'><img src='images/2002_Finalist_ListManagers.jpg' border=0></center>";


	document.write(string);
}

function drawNewsItems()
{
	var string = "";

	string += "Desktop Poker Tournament Timer, <a href='pokertimer.htm'>PokerTimer</a> Released! (also for Pocket PC)<br><br>";
	string += "New Version 2.1 of <a href='upmain.htm'>Ulti-Planner</a> Released! <br><br>";
	string += "Desktop <a href='holdemxp.htm'>All-In</a> is here!!<br><br>";
	string += "All-In Hold 'Em has come to your MS Smartphone! Check it out <a href='holdemsp.htm'>here!</a><br><br>";
//	string += "Back to School Time! Get 10% off the Top Student Planner!! Check out <a href='dogateit2.htm'>The Dog Ate It!</a><br><br>";
	string += "Birdsoft Software is amongst the nominations for the Pocket PC Awards! Ulti-Planner, Ulti-Contacts Today, PokerHand, and All-In Hold 'Em have all been nominated!!<br><br>";
//	string += "The Best Pocket PC <a href='trickhand.htm'>Euchre Game</a> is only $5.00 for a Limited Time!!<br><br>";
//	string += "Check out the New Version of <a href='holdem.htm'>All-In Hold'Em</a> ... The AI got better, if thats even possible....!!<br><br>";
//	string += "<a href='holdempalm.htm'>All-In Hold'Em</a> has come to your high resolution(320x320) PALM PDA....!!<br><br>";
//	string += "Check out the All New <a href='ulticontacts.htm'>Ulti-Contacts Today</a>!!<br><br>";
//	string += "Version 2.0 of FairwayWatch has been released!!<br><br>";
//	string += "Check out our Great Spring Sales on Crazy Bird Card Games!!<br><br>";
//	string += "All New Version of <a href='tripeaks.htm'>Tri-Peaks Hand</a> Solitaire is Out!!<br><br>";
	string += "Get <a href='handbj.htm'>Hand o'BlackJack</a> absolutely FREE!!!<br><br>";
//	string += "<a href='holdem.htm'>All-In Hold 'Em</a> is Out!! Check it out Now!!<br><br>";
//	string += "<a href='phpalm.htm'>PokerHand for Palm</a> has been updated, with 3 new games....!!<br><br>";
//	string += "<a href='dogateit2.htm'>The Dog Ate It</a> Version 2.1 is now Out!! New week view and Tabbed pages!!<br><br>";
	//string += "<a href='pokersnitch.htm'>PokerSnitch</a> has been Released!! Hold 'Em Poker Hand Analysis Tool.<br><br>";
	//string += "New Version of <a href='pokerhand.htm'>PokerHand</a> has been Released!! Featuring 3 New games, game statistics, and more..<br><br>";
	//string += "<a href='vptoday.htm'>Video Poker Today</a> has been Released!!<br><br>";

//	string += "PokerHand, ListWatch, and Ulti-Planner are named Nominees in the Pocket Pc Awards Card Games, List Manager, and PIM categories for 2003!!!<br><br>";

	document.write(string);
}

function ShowDogThumbImg(image)
{
var name = "scrImg";
var imagename = "Dog20Scr//" + image;

document.images[name].src = imagename;
}


//Below is for the news ticker
// change this to where you store the blank.gif image
var blank = "http://www.birdsoft.biz/clear.gif";

topedge = 165;  // location of news box from top of page
leftedge = 23;  // location of news box from left edge
boxheight = 85;  // height of news box
boxwidth = 260;  // width of news box
scrollheight = 350; // total height of all data to be scrolled

function scrollnews(cliptop) 
{
  if (document.layers)  
  {
  newsDiv = document.news;
  newsDiv.clip.top = cliptop;
  newsDiv.clip.bottom = cliptop + boxheight;
  newsDiv.clip.left = 0;
  newsDiv.clip.right = boxwidth + leftedge;
  newsDiv.left = leftedge;
  newsDiv.top = topedge - cliptop;
  }
  else 
  {
  newsDiv = news.style;
  newsDiv.clip = "rect(" + cliptop + "px " + (boxwidth + leftedge) + "px " + (cliptop + boxheight) + "px 0px)";
  newsDiv.pixelLeft = leftedge;
  newsDiv.pixelTop = topedge - cliptop;
  }
  
  cliptop = (cliptop + 1) % (scrollheight + boxheight);
  newsDiv.visibility='visible';
  setTimeout("scrollnews(" + cliptop + ")", 150);
}
