function ShowHide(cntrlName)
{
	var obj = document.getElementById(cntrlName);
	if(obj.style.display=="none")
		obj.style.display="block";
	else
	    obj.style.display = "none";
	//alert("wait for it .....");	
}

function CloseAndRefreshOpener(inWhere) {
    var tLoc = "";
    tLoc = inWhere;
    window.opener.document.location = tLoc;
    window.close();
}

var win_md_win = 0;
function open_medium_window(inWhere) {
    // when the child is called:
    stringURL = inWhere;
    var win_args;
    win_args = 'status=no, width=650, height=500, innerHeight=500, innerWidth=650, resizable=Yes';
    win_args = win_args + ',left=150, top=150, screenX=150, screenY=150, menubar=Yes, toolbar=No,scrollbars=Yes';
    win_md_win = window.open(stringURL, "cal_event", win_args);
    win_md_win.opener = self;
}

function AddLinkTag(txtBoxID, which) {
    var t;
    var obj = document.getElementById(txtBoxID);
    if (obj) {
        if (obj.value) {
            t = obj.value;
            if (which == "LINK") {
                t = t + " [LINK]http://www.yourhyperlink.com[/LINK]";
            }
            if (which == "B") {
                t = t + " [B]your bolded text here[/B]";
            }
            if (which == "I") {
                t = t + " [I]your bolded text here[/I]";
            }
            if (which == "RED") {
                t = t + " [RED]your red colored text here[/RED]";
            }
            if (which == "GREEN") {
                t = t + " [GREEN]your green text here[/GREEN]";
            }
            if (which == "BLUE") {
                t = t + " [BLUE]blue colored text here[/BLUE]";    
            }
            
            obj.value = t;
        }
        else {
            if (which == "LINK") {
                obj.value = " [LINK]http://www.yourhyperlink.com[/LINK]";
            }
            if (which == "RED") {
                obj.value = " [RED]your red colored text here[/RED]";
            }
            if (which == "GREEN") {
                obj.value = " [GREEN]your green text here[/GREEN]";
            }
            if (which == "BLUE") {
                obj.value = " [BLUE]blue colored text here[/BLUE]";
            }
            if (which == "B") {
                obj.value = " [B]your bolded text here[/B]";
            }
            if (which == "I") {
                obj.value = " [I]your bolded text here[/I]";
            }
        }
    }
}

////////////////////////////////////////////////
//
// dynamically loads the 'link bar'
//
//		NOTE! assumes there's a <DIV> named "pic_bar" on the page!@!!
//
//		builds innerHTML on the fly, it includes the links, and uses CSS
////////////////////////////////////////////////
function LoadLinkBar()
{
	var n="";
	n="<table width=\"800px\" cellpadding=\"0\" cellspacing=\"0\">";
	n += "<tr><td class=\"linkbar_normal\" onmouseover=\"this.className='linkbar_normal_over';\"";
	n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/EntryList.aspx';\"";
	n += "		title='View rider profiles'>RIDERS</td>";	
	n += "	<td width=\"22px\">&nbsp;</td>";
	n += "	<td width=\"95px\" class=\"linkbar_normal\" onmouseover=\"this.className = 'linkbar_normal_over';\"";
	n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/racelist.aspx';\"";
	n += "		title='view-enter race results'>RACES</td>";
	n += "	<td width=\"22px\">&nbsp;</td>	";
	
	n += "	<td width=\"95px\" class=\"linkbar_normal\" onmouseover=\"this.className = 'linkbar_normal_over';\"";
	n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/Cal_View.aspx';\"";
	n += "		title='View - update latest events and races on the team calendar'>CALENDAR</td>";
	n += "	<td width=\"22px\">&nbsp;</td>	";
	n += "	<td width=\"95px\"class=\"linkbar_normal\" onmouseover=\"this.className = 'linkbar_normal_over';\""; 
	n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/Info.aspx';\"";
	n += "		title='For more information - go here'>INFO</td>";
	n += "	<td width=\"22px\">&nbsp;</td>	";
	n += "	<td width=\"95px\"class=\"linkbar_normal\" onmouseover=\"this.className = 'linkbar_normal_over';\"";
	n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/ContactUsForm2.aspx';\"";
	//n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/signupform.html';\"";
	n += "		title='Fill out a contact us form...'>CONTACT</td>";
	n += "	<td width=\"22px\">&nbsp;</td>	";
	n += "	<td width=\"95px\"class=\"linkbar_normal\" onmouseover=\"this.className = 'linkbar_normal_over';\"";
	n += "		onmouseout=\"this.className='linkbar_normal'\" onclick=\"javascript:window.location.href='http://www.blueskyvelo.com/sponsors.aspx';\"";
	n += "		title='Take a look at our great sponsors.'>SPONSORS</td>";

	n += "	<td width=\"95px\" class=\"linkbar_normal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
	n += "	<td width=\"22px\">&nbsp;</td>	";
	
	n += "</tr></table>";
	if (document.getElementById)
	{
		var replace = document.getElementById('pic_bar');
		if (replace)
		{
			if (replace.childNodes[0])
			{
					replace.childNodes[0].nodeValue = n;
			}
			else if (replace.value)
			{
					replace.value = n;
			}
			else //if (replace.innerHTML)
			{
					replace.innerHTML = n;
			}        
		}
	}
} // end LoadLinkBar()

////////////////////////////////////////////////
//
// dynamically loads the 'banner box'
//
//		NOTE! assumes there's a <DIV> named "bsv_top_bar" on the page!@!!
//
//		builds innerHTML on the fly, it includes the links, and uses CSS
////////////////////////////////////////////////
function LoadTopBannerBox()
{
	var txt="";
	txt="<table width='100%'>";
	txt += "<tr><td style='width:45%'><a href='http://www.blueskyvelo.com'><img src='http://www.blueskyvelo.com/images/new_look/logo_small.jpg' border='0' alt=''></a></td>";
	txt += "<td style='text-align:right;'>Presented By</td>";
	txt += "<td style='text-align:right;'><a href='http://www.flatironsbank.com/index.asp'><img src='http://www.blueskyvelo.com/images/New_Look/flatirons_logo_header.png'  border='0' alt='' /></a></td>";
	
	txt += "</tr></table>";
	if (document.getElementById)
	{
		var b = document.getElementById('bsv_top_box');
		if (b)
		{
			if (b.childNodes[0])
			{
					b.childNodes[0].nodeValue = n;
			}
			else if (b.value)
			{
					b.value = n;
			}
			else //if (replace.innerHTML)
			{
					b.innerHTML = txt;
			}        
		}
	}
} // end LoadTopBannerBox()

////////////////////////////////////////////////////////
// User Confirm
////////////////////////////////////////////////////////
function ifUserConfirm(inWhich, url)
{
	var msg="";
	if(inWhich=="USER")
	{
	    msg="**********************************\n";
	    msg=msg + "WARNING !\n**********************************\n\n";
	    msg=msg + "You are attempting to delete the selected user and all that user's related information\n";
	    msg=msg + "\n\nThis action cannot be UNDONE!!!\n\n";
	    msg=msg + "Continue With Delete ?";
	}
	else if(inWhich=="USER_TRANS")
	{
	    msg="**********************************\n";
	    msg=msg + "WARNING !\n**********************************\n\n";
	    msg=msg + "You are attempting to delete the selected User Transaction.\n\nThis action cannot be UNDONE!!!\n\n";
	    msg=msg + "Continue With Delete ?";
	}
	else
	{
	    msg="**********************************\n";
	    msg=msg + "WARNING !\n**********************************\n\n";
	    msg=msg + "You are attempting to delete the selected entity.\n\nThis action cannot be UNDONE!!!\n\n";
	    msg=msg + "Continue With Delete ?";
	}
	
	if(confirm(msg))
	{	//alert(whereto);
	   window.location.href = url; 
	}	
}
