function passValidation()
{
	var root = document.change_password;
	var oldp = root.old.value;
	var newp = root.newp.value;
	var confnew = root.confnew.value;
	
	if (oldp == '' || newp == '' || confnew == ''){
		alert('Please fill up all the fields');
		return false;
	}	
	if (newp != confnew){
		alert('The password and it\'s confirmation do not match');
		root.confnew.focus();
		return false;
	}
	
	oldp = hex_md5(oldp);
	newp = hex_md5(newp);
	confnew = hex_md5(confnew);
	
	root.old.value = oldp;
	root.newp.value = newp;
	root.confnew.value = confnew;
	
	return true;
}
function getid()
{
var root=document.addalias;
var hold= root.domain.value;
//root.id.value = hold ;
window.location="/manager/aliases/?id="+hold;
//alert(root.id.value);
}
function check_adduser()
{
	var root = document.user_form;
	var username = root.username;
	var password = root.password;
	var fname = root.fname;
	var lname = root.lname;
	var email = root.email;
	var phone = root.phone;
	var level = root.level;
	
	if(username.value == '')
	{
		alert('Please insert a username');
		username.focus();
		return false;
	}
	if(password.value == '')
	{
		alert('Please insert a password');
		password.focus();
		return false;
	}
	if(fname.value == '')
	{
		alert('Please insert a First Name');
		fname.focus();
		return false;
	}
	if(lname.value == '')
	{
		alert('Please insert a Last Name');
		lname.focus();
		return false;
	}
	if(email.value == '')
	{
		alert('Please insert E-mail address');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid E-mail address");
		email.focus();
		return false;
	}
	if(phone.value == '')
	{
		alert('Please insert a Phone #');
		phone.focus();
		return false;
	}
	if(level.value == '')
	{
		alert('Please choose a Level');
		return false;
	}
	return true;
}
function check_edit_user()
{
	var root = document.user_edit_form;
	var fname = root.fname;
	var lname = root.lname;
	var email = root.email;
	var phone = root.phone;
	
	if(fname.value == '')
	{
		alert('Please insert a First Name');
		fname.focus();
		return false;
	}
	if(lname.value == '')
	{
		alert('Please insert a Last Name');
		lname.focus();
		return false;
	}
	if(email.value == '')
	{
		alert('Please insert E-mail address');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid E-mail address");
		email.focus();
		return false;
	}
	if(phone.value == '')
	{
		alert('Please insert a Phone #');
		phone.focus();
		return false;
	}
	return true;
}
function check_addserver()
{
	var root = document.addserver;
	var name = root.name;
	var ip = root.ip;
	var host = root.host;	
	if(name.value == '')
	{
		alert('Please insert the server name');
		name.focus();
		return false;
	}
	if(ip.value == '')
	{
		alert('Please insert the ip');
		ip.focus();
		return false;
	}
	if(host.value == '')
	{
		alert('Please insert the host name');
		host.focus();
		return false;
	}
	return true;
}
function check_editserver()
{
	var root = document.editserver;
	var name = root.name;
	var ip = root.ip;
	var host = root.host;	
	if(name.value == '')
	{
		alert('Please insert the server name');
		name.focus();
		return false;
	}
	if(ip.value == '')
	{
		alert('Please insert the ip');
		ip.focus();
		return false;
	}
	if(host.value == '')
	{
		alert('Please insert the host name');
		host.focus();
		return false;
	}
	return true;
}
function check_edit_project()
{
	var root = document.edit_project_form;
	var project_title = root.project_title;
	var project_release_date = root.release_date;
	var comment = root.comment;
	if(project_title.value == '')
	{
		alert('Please insert a project title');
		project_title.focus();
		return false;
	}	
	if(project_release_date.value == '')
	{
		alert('Please insert a release date');
		project_release_date.focus();
		return false;
	}
	if (comment.value == '')
	{
		alert('Please insert a comment');
		comment.focus();
		return false;
	}
	return true;
}
	
function check_addregistrar()
{
	var root = document.addregistrar;
	var name = root.name;
	var url = root.url;	
	if(name.value == '')
	{
		alert('Please insert the registrar name');
		name.focus();
		return false;
	}
	if(url.value == '')
	{
		alert('Please insert the url');
		url.focus();
		return false;
	}
	return true;
}
function check_editregistrar()
{
	var root = document.editregistrar;
	var name = root.name;
	var url = root.url;	
	if(name.value == '')
	{
		alert('Please insert the registrar name');
		name.focus();
		return false;
	}
	if(url.value == '')
	{
		alert('Please insert the url');
		url.focus();
		return false;
	}
	return true;
}

function check_edithostingPackages()
{
	var root = document.edithostingPackages;
	var title = root.title;
	var description = root.description;	
	var cost = root.cost;	
	if(title.value == '')
	{
		alert('Please insert the title');
		title.focus();
		return false;
	}
	if(description.value == '')
	{
		alert('Please insert the description');
		description.focus();
		return false;
	}
		if(cost.value == '')
	{
		alert('Please insert the cost');
		cost.focus();
		return false;
	}
	if (isNaN(cost.value))
	{
		alert('Please insert a numeric cost');
		cost.focus();
		return false;
	}
	if (cost.value <= 0)
	{
		alert('Please insert a valid cost value');
		cost.focus();
		return false;
	}
			if (cost.value > 999999999)
	{
		alert('The cost is too long');
		cost.focus();
		return false;
	}
	return true;
}
function check_addhostingPackages()
{
	var root = document.addhostingPackages;
	var title = root.title;
	var description = root.description;	
	var cost = root.cost;	
	if(title.value == '')
	{
		alert('Please insert the title');
		title.focus();
		return false;
	}
	if(description.value == '')
	{
		alert('Please insert the description');
		description.focus();
		return false;
	}
		if(cost.value == '')
	{
		alert('Please insert the cost');
		cost.focus();
		return false;
	}
	if (isNaN(cost.value))
	{
		alert('Please insert a numeric cost');
		cost.focus();
		return false;
	}
	if (cost.value <= 0)
	{
		alert('Please insert a valid cost value');
		cost.focus();
		return false;
	}
			if (cost.value > 999999999)
	{
		alert('The cost is too long');
		cost.focus();
		return false;
	}
	return true;
}

function check_adddomainCost()
{
	var root = document.adddomainCost;
	var extension = root.extension;
	var cost = root.cost;	
	if(extension.value == '')
	{
		alert('Please insert the extension');
		extension.focus();
		return false;
	}
		if(cost.value == '')
	{
		alert('Please insert the cost');
		cost.focus();
		return false;
	}
	if (isNaN(cost.value))
	{
		alert('Please insert a numeric cost');
		cost.focus();
		return false;
	}
	if (cost.value <= 0)
	{
		alert('Please insert a valid cost value');
		cost.focus();
		return false;
	}
		if (cost.value > 999999999)
	{
		alert('The cost is too long');
		cost.focus();
		return false;
	}
	return true;
}
function check_editdomainCost()
{
	var root = document.editdomainCost;
	var extension = root.extension;
	var cost = root.cost;	
	if(extension.value == '')
	{
		alert('Please insert the extension');
		extension.focus();
		return false;
	}
		if(cost.value == '')
	{
		alert('Please insert the cost');
		cost.focus();
		return false;
	}
	if (isNaN(cost.value))
	{
		alert('Please insert a numeric cost');
		cost.focus();
		return false;
	}
	if (cost.value <= 0)
	{
		alert('Please insert a valid cost value');
		cost.focus();
		return false;
	}
		if (cost.value > 999999999)
	{
		alert('The cost is too long');
		cost.focus();
		return false;
	}
	return true;
}
function check_add_company()
{
	var root = document.add_company;
	var name = root.name;	
	var email = root.email;
	var phone = root.phone;
	var cell = root.cell;
	var address = root.address;
	var contact_ref = root.contact_ref;
	if(name.value == '')
	{
		alert('Please insert a company name');
		name.focus();
		return false;
	}
	if(email.value == '')
	{
		alert('Please insert a company email');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid email address");
		email.focus();
		return false;
	}
	if(phone.value == '')
	{
		alert('Please insert a company a phone number');
		phone.focus();
		return false;
	}
	if(cell.value == '')
	{
		alert('Please insert a cell number');
		cell.focus();
		return false;
	}
	if(address.value == '')
	{
		alert('Please insert a company address');
		address.focus();
		return false;
	}
	if(contact_ref.value == '')
	{
		alert('Please select a contact for this company');
		contact_ref.focus();
		return false;
	}
	return true;
}
function check_edit_company()
{
	var root = document.edit_company;
	var name = root.name;	
	var email = root.email;
	var phone = root.phone;
	var cell = root.cell;
	var address = root.address;
	if(name.value == '')
	{
		alert('Please insert a company name');
		name.focus();
		return false;
	}
	if(email.value == '')
	{
		alert('Please insert a company email');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid email address");
		email.focus();
		return false;
	}
	if(phone.value == '')
	{
		alert('Please insert a company a phone number');
		phone.focus();
		return false;
	}
	if(cell.value == '')
	{
		alert('Please insert a mobile number');
		cell.focus();
		return false;
	}
	if(address.value == '')
	{
		alert('Please insert a company address');
		address.focus();
		return false;
	}
	return true;
}

function check_add_contact()
{
	var root = document.add_contact;
	var fname = root.fname;	
	var lname = root.lname;	
	var email = root.email;
	var phone = root.phone;
	var address = root.address;
	if(fname.value == '')
	{
		alert('Please insert a contact first name');
		fname.focus();
		return false;
	}
	if(lname.value == '')
	{
		alert('Please insert a contact last name');
		lname.focus();
		return false;
	}
	if(email.value == '')
	{
		alert('Please insert a contact email');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid email address");
		email.focus();
		return false;
	}
	if(phone.value == '')
	{
		alert('Please insert a contact phone number');
		phone.focus();
		return false;
	}
	if(address.value == '')
	{
		alert('Please insert a contact address');
		address.focus();
		return false;
	}
	return true;
}
function check_edit_contact()
{
	var root = document.edit_contact;
	var fname = root.fname;	
	var lname = root.lname;	
	var email = root.email;
	var phone = root.phone;
	var address = root.address;
	if(fname.value == '')
	{
		alert('Please insert a contact first name');
		fname.focus();
		return false;
	}
	if(lname.value == '')
	{
		alert('Please insert a contact last name');
		lname.focus();
		return false;
	}
	if(email.value == '')
	{
		alert('Please insert a contact email');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid email address");
		email.focus();
		return false;
	}
	if(phone.value == '')
	{
		alert('Please insert a contact phone number');
		phone.focus();
		return false;
	}
	if(address.value == '')
	{
		alert('Please insert a contact address');
		address.focus();
		return false;
	}
	return true;
}
function check_add_account()
{
	var root = document.add_account;
	var name = root.name;
	var company_ref = root.company_ref;
	var contact_ref = root.contact_ref;
	var bill_contact_ref = root.bill_contact_ref;
	if(name.value == '')
	{
		alert('Please insert an account name');
		name.focus();
		return false;
	}
	if(company_ref.value == '')
	{
		alert('Please choose a company');
		return false;
	}
	if(contact_ref.value == '')
	{
		alert('Please choose a contact');
		return false;
	}
	if(bill_contact_ref.value == '')
	{
		alert('Please choose a billing contact');
		return false;
	}
	return true;
}
function check_edit_account()
{
	var root = document.update_account;
	var name = root.name;
	if(name.value == '')
	{
		alert('Please insert an account name');
		name.focus();
		return false;
	}
	return true;
}
function check_addaliase(){
var root = document.addalias;	
var domain = root.domain;	
var alias = root.alias;
if(domain.value == ''){
alert('Please Select the Domain Name');
domain.focus();
return false;
	}
	if(alias.value == ''){
alert('Please Select the Alias Domain Name');
alias.focus();
return false;
	}
}
function check_adddomainName()
{
	var root = document.adddomainName;
	var domain = root.domain;
	var extension = root.extension;
	var account = root.account;
	var registrar = root.registrar;
	var server = root.server;
	var r_day = root.r_day;
	var r_month = root.r_month;
	var expiry = root.expiry;
	if(domain.value == '')
	{
		alert('Please insert the Domain Name');
		domain.focus();
		return false;
	}
	var dom =/^\w+([a-zA-Z][a-zA-Z1-9]?\w+)+$/;
	var flag5 = domain.value.match(dom);
	if(!flag5)
	{
		alert("Please insert a Valid Domain Name !");
		domain.focus();
		return false;
	}
	
	
		if(extension.value == '')
	{
		alert('Please insert the extension');
		extension.focus();
		return false;
	}
			if(account.value == '')
	{
		alert('Please select the Company');
		account.focus();
		return false;
	}
				if(registrar.value == '')
	{
		alert('Please select the registrar');
		registrar.focus();
		return false;
	}
					if(server.value == '')
	{
		alert('Please select the server');
		server.focus();
		return false;
	}
	if(r_day.value == '')
	{
		alert('Please select the renewal Day');
		r_day.focus();
		return false;
	}
		if(r_month.value == '')
	{
		alert('Please select the renewal Month');
		r_month.focus();
		return false;
	}
			if(expiry.value == '')
	{
		alert('Please select the expiry Date');
		expiry.focus();
		return false;
	}
	return true;
}
function check_addhosting()
{
	var root = document.addhosting;
	var title = root.title;
	var domain = root.domain;
	var account = root.account;
	var host = root.host;
	var server = root.server;
	var r_day = root.r_day;
	var r_month = root.r_month;
	var expiry = root.expiry;
	if(title.value == '')
	{
		alert('Please insert the Title');
		title.focus();
		return false;
	}
		if(domain.value == '')
	{
		alert('Please select the Base Domain Name');
		domain.focus();
		return false;
	}
			if(account.value == '')
	{
		alert('Please select the Company');
		account.focus();
		return false;
	}
				if(host.value == '')
	{
		alert('Please select the Hosting Package');
		host.focus();
		return false;
	}
					if(server.value == '')
	{
		alert('Please select the server');
		server.focus();
		return false;
	}
	if(r_day.value == '')
	{
		alert('Please select the renewal Day');
		r_day.focus();
		return false;
	}
		if(r_month.value == '')
	{
		alert('Please select the renewal Month');
		r_month.focus();
		return false;
	}
			if(expiry.value == '')
	{
		alert('Please select the expiry Date');
		expiry.focus();
		return false;
	}
	return true;
}

function check_edithosting()
{
	var root = document.edithosting;
	var title = root.title;
	var domain = root.domain;
	var account = root.account;
	var host = root.host;
	var server = root.server;
	var r_day = root.r_day;
	var r_month = root.r_month;
	var expiry = root.expiry;
	if(title.value == '')
	{
		alert('Please insert the Title');
		title.focus();
		return false;
	}
		if(domain.value == '')
	{
		alert('Please select the Base Domain Name');
		domain.focus();
		return false;
	}
			if(account.value == '')
	{
		alert('Please select the Company');
		account.focus();
		return false;
	}
				if(host.value == '')
	{
		alert('Please select the Hosting Package');
		host.focus();
		return false;
	}
					if(server.value == '')
	{
		alert('Please select the server');
		server.focus();
		return false;
	}
	if(r_day.value == '')
	{
		alert('Please select the renewal Day');
		r_day.focus();
		return false;
	}
		if(r_month.value == '')
	{
		alert('Please select the renewal Month');
		r_month.focus();
		return false;
	}
			if(expiry.value == '')
	{
		alert('Please select the expiry Date');
		expiry.focus();
		return false;
	}
	return true;
}

function sorting_projects()
{
	document.projects_sorting.submit();
}
function sorting_tasks()
{
	document.tasks_sorting.submit();
}
function check_add_projects_status()
{
	var root = document.add_projects_status;
	var status_name = root.status_name;
	if(status_name.value == '')
	{
		alert('Please insert a status name');
		status_name.focus();
		return false;
	}
	return true;
}
function check_add_tasks_status()
{
	var root = document.add_tasks_status;
	var status_name = root.status_name;
	if(status_name.value == '')
	{
		alert('Please insert a status name');
		status_name.focus();
		return false;
	}
	return true;
}
function check_add_payment()
{
	var root = document.add_payment_form;
	var amount = root.amount;
	var comment = root.comment;
	if(amount.value == '')
	{
		alert('Please insert an amount');
		amount.focus();
		return false;
	}
	if (isNaN(amount.value))
	{
		alert('Please insert a numeric amount');
		amount.focus();
		return false;
	}
	if (amount.value <= 0)
	{
		alert('Please insert a valid amount value');
		amount.focus();
		return false;
	}
	if (amount.value > 999999999999)
	{
		alert('The amount value is too long');
		amount.focus();
		return false;
	}
	if(comment.value == '')
	{
		alert('Please insert a comment');
		comment.focus();
		return false;
	}
	return true;
}
function check_edit_payment()
{
	var root = document.edit_payment_form;
	var amount = root.amount;
	var comment = root.comment;
	if(amount.value == '')
	{
		alert('Please insert an amount');
		amount.focus();
		return false;
	}
	if (isNaN(amount.value))
	{
		alert('Please insert a numeric amount');
		amount.focus();
		return false;
	}
	if (amount.value <= 0)
	{
		alert('Please insert a valid amount value');
		amount.focus();
		return false;
	}
	if (amount.value > 999999999999)
	{
		alert('The amount value is too long');
		amount.focus();
		return false;
	}
	if(comment.value == '')
	{
		alert('Please insert a comment');
		comment.focus();
		return false;
	}
	return true;
}
function check_add_project()
{
	var root = document.add_project_form;
	var project_title = root.project_title;
	var cs_ref = root.cs_ref;
	var comment = root.comment;
	var account_ref = root.account_ref;
	var nb_payments = root.nb_payments;
	var release_date = root.release_date;
	if(project_title.value == '')
	{
		alert('Please insert a project title');
		project_title.focus();
		return false;
	}
	if(status.value == '')
	{
		alert('Please select a project status');
		status.focus();
		return false;
	}
	if(cs_ref.value == '')
	{
		alert('Please select a Client Service');
		cs_ref.focus();
		return false;
	}
	if(comment.value == '')
	{
		alert('Please insert a comment');
		comment.focus();
		return false;
	}
	if(account_ref.value == '')
	{
		alert('Please select an account for project');
		account_ref.focus();
		return false;
	}
	if (release_date.value == '')
	{
		alert('Please insert a release date');
		release_date.focus();
		return false;
	}
	if(nb_payments.value == '')
	{
		alert('Please insert number of payments for project');
		nb_payments.focus();
		return false;
	}
	if (isNaN(nb_payments.value))
	{
		alert('Please insert a numeric number of payments');
		nb_payments.focus();
		return false;
	}
	if (nb_payments.value <= 0)
	{
		alert('Please insert a valid number of payments');
		nb_payments.focus();
		return false;
	}
	if (nb_payments.value > 12)
	{
		alert('The number of payments is too long, please it should be not more than 12 ');
		nb_payments.focus();
		return false;
	}
	return true;
}
function check_add_project_payments(nb_payments)
{
	var nb_payment = nb_payments;
	for (var i=1;i<=nb_payment;i++)
	{
		var amount = eval('document.add_project_payments.amount_'+i);
		var comment = eval('document.add_project_payments.comment_'+i);
	}
	if(amount.value == '')
	{
		alert('Please fill in all the amounts fields');
		amount.focus();
		return false;
	}
	if (isNaN(amount.value))
	{
		alert('Please all the amounts must be numeric');
		amount.focus();
		return false;
	}
	if (amount.value <= 0)
	{
		alert('Please insert a valid number for amounts');
		amount.focus();
		return false;
	}
	if (amount.value > 999999999999)
	{
		alert('The amount number is too long');
		amount.focus();
		return false;
	}
	if(comment.value == '')
	{
		alert('Please fill in all the comments fields');
		comment.focus();
		return false;
	}
	return true;
}
function check_add_task()
{
	var root = document.add_task_form;
	var task_title = root.task_title;
	var cs_ref = root.cs_ref;
	var comment = root.comment;
	var account_ref = root.account_ref;
	var release_date = root.release_date;
	if(task_title.value == '')
	{
		alert('Please insert a task title');
		task_title.focus();
		return false;
	}
	if(cs_ref.value == '')
	{
		alert('Please select a Customer Service');
		cs_ref.focus();
		return false;
	}
	if(comment.value == '')
	{
		alert('Please insert a comment');
		comment.focus();
		return false;
	}
	if(account_ref.value == '')
	{
		alert('Please select an ammount for task');
		account_ref.focus();
		return false;
	}
	if(release_date.value == '')
	{
		alert('Please a release date');
		release_date.focus();
		return false;
	}
	return true;
}
function check_edit_task()
{
	var root = document.edit_task_form;
	var title = root.task_title;
	var release_date = root.release_date;
	var comment = root.comment;
	if(title.value == '')
	{
		alert('Please insert a task title');
		title.focus();
		return false;
	}	
	if(release_date.value == '')
	{
		alert('Please insert a release date');
		release_date.focus();
		return false;
	}
	if (comment.value == '')
	{
		alert('Please insert a comment for task');
		comment.focus();
		return false;
	}
	return true;
}
function check_add_task_payments()
{
	var root = document.add_task_payments;
	var amount = root.amount;
	var comment = root.comment;
	if(amount.value == '')
	{
		alert('Please insert the amount value');
		amount.focus();
		return false;
	}
	if (isNaN(amount.value))
	{
		alert('Please the amount value must be numeric');
		amount.focus();
		return false;
	}
	if (amount.value <= 0)
	{
		alert('Please insert a valid amount value');
		amount.focus();
		return false;
	}
	if (amount.value > 999999999999)
	{
		alert('The amount value is too long');
		amount.focus();
		return false;
	}
	if(comment.value == '')
	{
		alert('Please insert a comment');
		comment.focus();
		return false;
	}
	return true;
}
function check_add_task_status()
{
	var root = document.add_task_status;
	var status_name = root.status_name;
	if(status_name.value == '')
	{
		alert('Please insert a status name');
		status_name.focus();
		return false;
	}
	return true;
}
function check_edit_task_status()
{
	var root = document.edit_task_status;
	var status_name = root.status_name;
	if(status_name.value == '')
	{
		alert('Please insert a status name');
		status_name.focus();
		return false;
	}
	return true;
}
function popupDesc(id)
{
	var div_name = eval('contact_info_'+id);
	div_name.style.visibility = 'visible';
}
function popdownDesc(id)
{
	var div_name = eval('contact_info_'+id);
	div_name.style.visibility = 'hidden';
}
function popupCompanyDesc(id)
{
	var div_name = eval('company_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownCompanyDesc(id)
{
	var div_name = eval('company_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popupContactDesc(id)
{
	var div_name = eval('contact_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownContactDesc(id)
{
	var div_name = eval('contact_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popupBillContactDesc(id)
{
	var div_name = eval('bill_contact_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownBillContactDesc(id)
{
	var div_name = eval('bill_contact_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popupContDesc(id)
{
	var div_name = eval('fname_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownContDesc(id)
{
	var div_name = eval('fname_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popupContacDesc(id)
{
	var div_name = eval('lname_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownContacDesc(id)
{
	var div_name = eval('lname_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popupCSDesc(id)
{
	var div_name = eval('cs_desc_p_'+id);
	div_name.style.visibility = 'visible';
}
function popdownCSDesc(id)
{
	var div_name = eval('cs_desc_p_'+id);
	div_name.style.visibility = 'hidden';
}
function popupAccountPrDesc(id)
{
	var div_name = eval('account_desc_p_'+id);
	div_name.style.visibility = 'visible';
}
function popdownAccountPrDesc(id)
{
	var div_name = eval('account_desc_p_'+id);
	div_name.style.visibility = 'hidden';
}
function popupCSTaDesc(id)
{
	var div_name = eval('cs_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownCSTaDesc(id)
{
	var div_name = eval('cs_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popupAccountTaDesc(id)
{
	var div_name = eval('account_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownAccountTaDesc(id)
{
	var div_name = eval('account_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function popuppackageDesc(id)
{
	var div_name = eval('package_desc_'+id);
	div_name.style.visibility = 'visible';
}
function popdownpackageDesc(id)
{
	var div_name = eval('package_desc_'+id);
	div_name.style.visibility = 'hidden';
}
function set_due_payment()
{
	document.edit_due_payment.submit();
}
function submitNewsletter()
{
	var root = document.newsletter;
	var name = root.name;
	var email = root.email;
	if (name.value == '')
	{
		alert('Please insert your name');
		name.focus();
		return false;
	}	
	if (email.value == '')
	{
		alert('Please insert your mail Address');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid E-mail address");
		email.focus();
		return false;
	}
	return true;
}
function check_contact_me()
{
	var root = document.contact_me;
	var name = root.name;
	var email = root.email;
	var subject = root.subject;
	var message = root.message;
	if (name.value == '')
	{
		alert('Please insert your name');
		name.focus();
		return false;
	}	
	if (email.value == '')
	{
		alert('Please insert your mail Address');
		email.focus();
		return false;
	}
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var flag2 = email.value.match(pattern);
	if(!flag2)
	{
		alert("Please enter a valid E-mail address");
		email.focus();
		return false;
	}
	if (subject.value == '')
	{
		alert('Please insert a subject');
		subject.focus();
		return false;
	}
	if (message.value == '')
	{
		alert('Please insert a message');
		message.focus();
		return false;
	}
	return true;
}
function clear_form()
{
	var message = confirm("Are you sure you want to clear this form ?");
	if (message == true)
	{
		var root = document.contact_me;
		var name = root.name;
		var email = root.email;
		var subject = root.subject;
		var message = root.message;
		if (name.value != '')
		{
			name.value = "";
		}
		if (email.value != '')
		{
			email.value = "";
		}
		if (subject.value != '')
		{
			subject.value = "";
		}
		if (message.value != '')
		{
			message.value = "";
		}
	}
}

/////////////POP IMAGE////////////
function popImage(imageURL,imageTitle){
	defaultWidth  = 500;
	defaultHeight = 500;
	//alert(imageURL);
	var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left=100,top=100';
	var optIE='scrollbars=no,width=150,height=100,left=100,top=100';

	var AutoClose = true;

	if (parseInt(navigator.appVersion.charAt(0))>=4){
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left=100,top=100';
		var optIE='scrollbars=yes,width=150,height=100,left=100,top=100';

		//if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
			writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
			writeln('<sc'+'ript>');
			writeln('var isNN,isIE;');
			writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
			writeln('isNN=(navigator.appName=="Netscape")?1:0;');
			writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
			writeln('function reSizeToImage(){');
			writeln('if (isIE){');
			writeln('window.resizeTo(100,100);');
			writeln('width=100-(document.body.clientWidth-document.images[0].width);');
			writeln('height=100-(document.body.clientHeight-document.images[0].height);');
			writeln('window.resizeTo(width,height);}');
			writeln('if (isNN){');
			writeln('window.innerWidth=document.images["Image"].width;');
			writeln('window.innerHeight=document.images["Image"].height;}}');
			writeln('function doTitle(){document.title="'+imageTitle+'";}');
			writeln('</sc'+'ript>');
			if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
			else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
			writeln('<img name="Image" src="'+imageURL+'" style="display:block"></body></html>');
			close();
		}
}
////////////////////////////////