/*
	This function opens a new window according the options passed to the function
	url - Contains to the address of the page that should be opened
*/

function popUp(url,location,menubar,resize,scroll,status,top,height,width)
{
	var sFeatures;
	sFeatures = "location=" + location + ",menubar=" + menubar + ",resizable=" + resize + ",scrollbars=" + scroll + ",status=" + status + ",top=" + top + ",height=" + height + ",width=" + width;
	window.open(url,null,sFeatures);
}


/* 
	This function is OnFocus handler for a textbox. If the textbox contains a default message
	then it resets the textbox.
*/

function TextBox_OnFocus(id,msg)
{
	var idTxt = document.getElementById(id);
	if(idTxt.value == msg) idTxt.value = "";
}

/*
	This function is OnBlur handler for a textbox. If the textbox doesn't contain any text when the user 
	switches to a different form element, then it resets the value of the textbox with the default message.
*/

function TextBox_OnBlur(id,msg)
{
	var idTxt = document.getElementById(id);
	if(idTxt.value.length == 0)
	{
		idTxt.value = msg;
	}
}

/*
	This function is compares the Email Address entered in two textboxes
*/
function Contact_ConfirmEmail(emailId1,emailId2)
{
	var id1 = document.getElementById(emailId1);
	var id2 = document.getElementById(emailId2);
	if(id1.value != id2.value)
	{
		alert("Please enter the same Email address as above");
		return false;
	}
	return true;
}

/*
	This function is used to Show or Hide a 'div' tag based on its current visibility value.
*/
function ShowHide(tblId)
{
	var id = document.getElementById(tblId);
	if(id.style.display == 'none')
	{
		id.style.display = '';
	}
	else
	{
		id.style.display = 'none';
	}
}
