var WindowObjectReference = null;
function popUp(URL) {
	WindowObjectReference = window.open(URL, 'name', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=1,resizable=1,width=400,height=600,left=500,top=100');
	if (window.focus) {WindowObjectReference.focus();}
	}	
	
function SlideDiv(ElementId)
	{
	if (document.getElementById(ElementId).style.display == 'none')	
		{
		new Effect.Opacity($(ElementId), { from: 0, to: 0, duration: 0 });
		Effect.SlideDown($(ElementId),{ duration: 0.2 });
		new Effect.Opacity($(ElementId), { from: 0, to: 1.0, duration: 0.7 });
		}
		else
		{
		Effect.SlideUp($(ElementId),{ duration:  0.2 });
		}
	}
	
function SlideSearchBoxDivIfClosed(ElementId)
	{
	if (document.getElementById(ElementId).style.display == 'none')	
		{
		new Effect.Opacity($(ElementId), { from: 0, to: 0, duration: 0 });
		Effect.SlideDown($(ElementId),{ duration: 0.2 });
		new Effect.Opacity($(ElementId), { from: 0, to: 1.0, duration: 0.7 });
		}
	else
		{
		SlideDivIfOpen('usersaves');
		new Effect.Opacity($(ElementId), { from: 0.9, to: 1.0, duration: 0.1 });
		document.searchform.searchdata.focus();
		}
	}

function SlideDivIfOpen(ElementId)
	{
	if (document.getElementById(ElementId).style.display != 'none')	
		{
		Effect.SlideUp($(ElementId),{ duration:  0.3 });			
		}
	}		

function ConfirmDelete(question,url)
	{
 	var where_to= confirm(question);
 	if (where_to== true)
 		{
	   	window.location=url;
 		}
	}
function WriteSearchResult(ElementId,arg)
	{
	document.getElementById(ElementId).innerHTML+=arg;
	}

function AddText(TextToAdd,Obj) 
	{
	var newtext = TextToAdd;
	Obj.value = newtext  + "\n" + Obj.value;
	}
	
function ResetDates(Obj) 
	{
	if (Obj.value == "YYYY-MM-DD")
		{
		Obj.value = "";
		}
	}	
