//====================================================================================================
//	Function Name	:	Validate_Form
//----------------------------------------------------------------------------------------------------
function Validate_Form(frm)
{
	with(frm)
    {		
		if(!IsEmpty(cont_name, 'Please enter your Name.'))
		{
			return false;
		}
		if(!IsEmpty(cont_email, 'Please enter your Email Address.'))
		{
			return false;
		}
		else if(!IsEmail(cont_email, 'Oppsss!!! Invalid Email Address specified.'))
		{
			return false;
		}
		if(!IsEmpty(cont_comment, 'Please enter your Comment.'))
		{
			return false;
		}
	}
	
	return true;
}

//====================================================================================================
//	Function Name	:	Validate_Login
//----------------------------------------------------------------------------------------------------
function Validate_Login(frm)
{
	with(frm)
    {		
		if(!IsEmpty(gallery_passwd, 'Kennwort bitte eintragen.'))
		{
			return false;
		}
		return true;
	}
}

//====================================================================================================
//	Function Name	:	Browse_Category
//----------------------------------------------------------------------------------------------------
function Browse_Category(catId)
{
	document.getElementById("subcat_"+catId).visibility = 'visible';
	document.getElementById("subcat_"+catId).display = 'block';
}

//====================================================================================================
//	Function Name	:	CheckForUrlIP
//----------------------------------------------------------------------------------------------------
function CheckForUrlIP(fld)
{
	var regex 	= /(http:\/\/|https:\/\/|http:|https:|www.|[\w]*.com|.net|.org|.edu|.int|.mil|.gov|.arpa|.aero|.coop|.info|.pro|.museum|.us|.biz|.bz|.info|.tv|.tw|.cc|.cn|.ws|.ca|.de|.jp|.co.in|.co.uk|.org.uk|.co.nz|.net.nz|.org.nz|.mobi|.eu|.name|.be|.at|.com.mx|.me.uk)/;
	var regexip =  /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	
	if(regex.test(fld.value))
	{
		alert("Please do not enter URL.");
		fld.focus();
		return false;
	}
	
	if(regexip.test(fld.value))
	{
		alert("Please do not enter IP Address.");
		fld.focus();
		return false;
	}
	
	return true;
}

function Ass_View_Click(assId,pageId)
{
	popupWindowURL('page.php?Action=View&pid='+pageId+'&ass_id='+assId, 'list', 400, 260, false, false, true);
}

function Team_View_Click(memId,pageId)
{
	popupWindowURL('page.php?Action=View&pid='+pageId+'&mem_id='+memId, 'list', 400, 260, false, false, true);
}

function Gallery_Click(catId)
{
	selCategory = document.getElementById("selcat");
	if(selCategory.value)
	{
		document.getElementById("subcat_"+selCategory.value).style.visibility = 'hidden';
		document.getElementById("subcat_"+selCategory.value).style.display = 'none';
	}
	
	selCategory.value = catId;
	document.getElementById("subcat_"+catId).style.visibility = 'visible';
	document.getElementById("subcat_"+catId).style.display = 'block';
}
