// 4349
/************************** GLOBALS **************************/
var DOMAIN   = "powersevents.com"
var PROTOCOL = "http://"
var HOST     = "events"
var CGIpath  = "cgi"
var HTMLpath = ""


/************************* FUNCTIONS **************************/

function popup(url,parameters)
{
	if (!parameters){ parameters ='scrollbars,resizable,width=400,height=400' }
	var newWin = window.open(url,'',parameters)
	newWin.moveTo(15,15)
}

function Help(fileName)
{
	var path ="/help"
	var doc = path+"/"+fileName
	popup(doc, 'width=300, height=400, resizable, scrollbars')
}

function NavigateTo(url,targ)
{
	parent.central.location = url
	FormatBottomMenu(targ)
}

function FormatBottomMenu(targ)
{
		var num_links=parent.bottom.document.links.length
		var target_url="javascript:Navigate('"+targ+"')"
		for (count=0; count<num_links;count++)
		{
			if (parent.bottom.document.links[count].href == target_url)
			{
					document.links[count].style.color="red"
			}
			else{ parent.bottom.document.links[count].style.color="#204080"}
		}
}

function NavigatePublic(url, targ)
{
	parent.central.location = url
	FormatPublicLinks(url,targ)
}

function FormatPublicLinks(url,newtarg)
{
	var num_links=document.links.length
	var target_url="javascript:NavigatePublic('"+url+"','"+newtarg+"')"
	for (count=0; count<num_links;count++)
	{
		if (document.links[count].href == target_url)
		{
			document.links[count].style.color="red"
		}
		else{ document.links[count].style.color="#204080"}
	}
}

// 4266 - a blank init() so pages that call it onLoad
//        don t throw errors.
function init() {}

// 4634
function ShowHide(id)
{
	var obj = document.getElementById(id)
	if ( IsHidden(obj) )  // 4613
	{
		ShowObject(obj)
	}
	else
	{
		HideObject(obj)
	}
}
function ShowObject(obj)
{
	obj.style.display = "block"
}
function HideObject(obj)
{
	obj.style.display = "none"
}
function IsHidden(obj)
{
	if ( obj.style.display == "none" ) return true
	if (! obj.style.display ) return true
	return false
}
// 4634

// 4894
function ShowElement(id)
{
	var obj = document.getElementById(id)
	ShowObject(obj)	
}
function HideElement(id)
{
	var obj = document.getElementById(id)
	HideObject(obj)	
}


// 4894
function DeleteConfirm(id,table){
	var reply = REPLY;
	REPLY = escape(REPLY);
	if (confirm('Are you sure you wish to delete this record?'))
	{
		location = "rm.cgi?ok=1&tab="+table+"&id="+id+"&return=" + reply;

	}
}

function UpdateBiddingField(startingBidFactor,incrementFactor,buyNowFactor){
	var inp = document.getElementById('auction_itemestimated_value').value
	
	var bid_increment = parseInt(inp * parseFloat(incrementFactor))
	var buy_now = parseInt(inp * parseFloat(buyNowFactor))
	var starting_bid = parseInt(inp * parseFloat(startingBidFactor))
	
	document.getElementById('auction_itembuy_now').value = buy_now
	document.getElementById('auction_itembid_increment').value = bid_increment
	document.getElementById('auction_itemstarting_bid').value = starting_bid
}
	

