/*
#**********************************
#   file:   functions.js          *
#   Author: Thomas Hippchen       *
#   WWW:    www.hippchen.de       *
#   eMail:  th@hippchen.de        *
#   April 2000                    *
#**********************************
*/
function DoSubmit(script,act,id)
{
	f=document.theform;
	f.action=script;
	f.act_id.value=act;
	f.auto_id.value=id;
	f.submit();
	
}
function RemoveFromCategory(script,act,id)
{
	f=document.theform;
	f.action=script;
	f.act_id.value=act;
	f.image2category_auto_id.value=id;
	f.submit();
}

function GoToPage(script,p_count)
{
	var f=document.theform;	
	f.page_count.value=p_count;
	f.action=script;
	f.submit();
}
	
function SortPage(script,s_key)
{
	var f=document.theform;	

	if (f.sort_key.value==s_key)//toggle direction
	{
		if (f.sort_dir.value=="ASC") f.sort_dir.value="DESC"; else f.sort_dir.value="ASC";
	}
	else
	{
		f.sort_dir.value="ASC";
		f.sort_key.value=s_key;
	}
	f.action=script;
	f.submit();
}


function GeneratePassword(pwd_len)
{
	pwdSource="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	pwd="";
	pwd_len=8;
	for (i=0;i<pwd_len;i++)
	{
		idx=Math.ceil(Math.random()*pwdSource.length-1);
		pwd+=pwdSource.charAt(idx);
	}
	return pwd;
}

function GetLogin(field_name,pwd_len)
{
	document.theform[field_name].value=GeneratePassword(pwd_len);
}

function OpenHelp(file_name,topic)
{
	theURL="help/"+file_name+".html#"+topic;
	newWin=window.open(theURL,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=650,height=500")
}
function dlg_DoHelp(file_name)
{
	theURL="help/"+file_name;
	newWin=window.open(theURL,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=650,height=500")
}

function SetColor(layer_name,field_name)
{
	theURL="color_select.html";
	newWin=window.open(theURL,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=650,height=500")
}
/****************/
/* END OF FILE */

