/*
 *
 * (c) SOLVIS Ltd 2002-2010. All Rights Reserved.
 *
 * --LICENSE NOTICE--
 * Source code is confidential and copyrighted.
 * Source code and all associated intellectual property rights
 * is retained by Solvis and/or its licensors.  Except as specifically
 * authorized in any Supplemental License Terms, you may not make
 * copies of source code, other than a single copy of source code for
 * archival purposes.  Unless enforcement is prohibited by
 * applicable law, you may not modify, decompile, or reverse
 * engineer this source code.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for educational, research, and not-for-profit purposes,
 * without fee and without a signed licensing agreement, is hereby
 * granted, provided that the above copyright notice and this paragraph
 * appear in all copies, modifications, and distributions. For commercial
 * licensing opportunities, contact:
 * 
 * SOLVIS Ltd
 * Arnold Böcklin-Strasse 35
 * CH-4051  BASEL
 * Tel: +41 (0)61 270 44 11
 * Fax: +41 (0)61 270 44 21
 * http://www.solvis.ch
 *
 * --LICENSE NOTICE--
 *
 * (c) SOLVIS Ltd 2002-2010. All Rights Reserved.
 *
 * Date: 18/08/2003
 *
 */


function winOpen(url) {
  window.open(url,'Solvis','width=800,height=600,scrollbars');
}

var codedMsg = "^c)diaj;njgqdn)^c";
var codedMsg2 = "\\kkgd^\\odjin;njgqdn)^c";

function mailMaker(param) {
	var loc = decodeURL();
	var reg=new RegExp('<br>','gi');
	param = param.replace(reg,'%0D%0A');
	window.location = loc + param;
}

function mailJobDecrypt() {
	mailDecoder(codedMsg2,'');
}

function decrypt() {
	return dec(codedMsg2);
}

function mailDecoder(mail, param) {
	var loc = decodeMail(mail);
	var reg=new RegExp('<br>','gi');
	param = param.replace(reg,'%0D%0A');
	window.location = loc + param;
}

function decode() { 
  return dec(codedMsg);
}

function decodeURL() {
  return dec('h\\dgoj5' + codedMsg);
}

function decodeMail(mail) {
  return dec('h\\dgoj5' + mail);
}

function dec (msg) {
	var ret = "";
	for(var i=0; i<msg.length; i++) ret += String.fromCharCode(msg.charCodeAt(i)+5)
	return ret;
}

function enc (msg) {
	var ret = "";
	for(var i=0; i<msg.length; i++) ret += String.fromCharCode(msg.charCodeAt(i)-5)
	return ret;
}

function checkForm(formId) {
	var form = document.getElementById(formId);
	if (form.Contact_Lastname.value == "") {
		alert('Please enter your last name');
		form.Contact_Lastname.focus();
		return false;
	}
	if (form.Contact_FirstName.value == "") {
		alert('Please enter your first name');
		form.Contact_FirstName.focus();
		return false;
	}
	if (form.Company_Name.value == "") {
		alert('Please enter your company name');
		form.Company_Name.focus();
		return false;
	}
	if (form.Contact_Phone1.value == "") {
		alert('Please enter your telephone');
		form.Contact_Phone1.focus();
		return false;
	}
	if (form.Contact_Email1.value == "") {
		alert('Please enter your email');
		form.Contact_Email1.focus();
		return false;
	}

	form.realname.value = form.Contact_FirstName.value + ' ' + form.Contact_Lastname.value;
	form.email.value = form.Contact_Email1.value;

	return true;
}
