/* 

Author:   José Guilherme Moreira
Contact:  jgmoreira@gangnetworks.com
Web Site: http://www.gangnetworks.com */

// Open Popup 
function openbrWindow(theURL,winName,features) { 
window.open(theURL,winName,features); 
} 

// Check Contact Form 
function checkContactForm() { 
if (document.Contact.contact_name.value == "") { 
alert("Tem de indicar o seu Nome!  "); 
document.Contact.contact_name.style.backgroundColor = "#ffc"; 
document.Contact.contact_name.focus(); 
return false; 
} 
else if (document.Contact.contact_email.value == "") { 
alert("Tem de indicar o seu E-mail!  "); 
document.Contact.contact_email.style.backgroundColor = "#ffc"; 
document.Contact.contact_email.focus(); 
return false; 
} 
else if (document.Contact.contact_email.value.indexOf("@") == -1 || document.Contact.contact_email.value.indexOf(".") == -1) { 
alert("O E-mail que indicou não é válido!  "); 
document.Contact.contact_email.style.backgroundColor = "#ffc"; 
document.Contact.contact_email.focus(); 
return false; 
} 
else if (document.Contact.contact_phone.value == "") { 
alert("Tem de indicar o seu Telefone!  "); 
document.Contact.contact_phone.style.backgroundColor = "#ffc"; 
document.Contact.contact_phone.focus(); 
return false; 
} 
else if (isNaN(parseInt(document.Contact.contact_phone.value)) || document.Contact.contact_phone.value.length <= 8) { 
alert("O Telefone que indicou não é válido!  "); 
document.Contact.contact_phone.style.backgroundColor = "#ffc"; 
document.Contact.contact_phone.focus(); 
return false; 
} 
else if (document.Contact.contact_message.value == "") { 
alert("Tem de indicar a sua Mensagem!  "); 
document.Contact.contact_message.style.backgroundColor = "#ffc"; 
document.Contact.contact_message.focus(); 
return false; 
} 
else { 
return true; 
} 
} 

// Close Ups 
var print_button = "no"; 
var close_button = "yes"; 
var right_click_on = "no"; 
var view_width = "500"; 
var view_height = "550"; 
var viewer = "no"; 
var border_color = "999"; 
var background_colors = "fff"; 
var right_click_text = "As funções do botão direito estão desactivadas nesta página  "; 
var scrollbars = "0"; 	// Turns on scrollbars - "1" for On "0" for Off 

function CloseUp(URL, WinTitle) { 
if (viewer == "no") { 
popup_window = window.open('', 'CloseUp', 'width=' + view_width + ', height=' + view_height + ', menubar=0, location=0, toolbar=0, statusbar=0, directories=0, resizable=1, scrollbars=' + scrollbars + ', top=50, left=150'); 
} 
else 
if (viewer == "yes") { 
popup_window = window.open(); 
} 
popup_window.document.open(); 
popup_window.document.write('<!DOCTYPE html PUBLIC "-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN" "http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd">\n'); 
popup_window.document.write('<html xmlns="http:\/\/www.w3.org\/1999\/xhtml" xml:lang="en">\n'); 
popup_window.document.write('<head>\n\n'); 
popup_window.document.write('\t<title>' + WinTitle + '<\/title>\n'); 
popup_window.document.write('\t<link rel="stylesheet" href="css\/Base.css" type="text\/css" media="screen" \/>\n'); 
popup_window.document.write('\t<meta http-equiv="imagetoolbar" content="no" \/>\n\n'); 
if (right_click_on == "yes") { 
popup_window.document.write('<script language="JavaScript" type="text\/javascript">\n\n'); 
popup_window.document.write('function noRightClick() {\n'); 
popup_window.document.write('if (event.button == 2) {\n'); 
popup_window.document.write('alert(\'' + right_click_text + '\')\n'); 
popup_window.document.write('}\n'); 
popup_window.document.write('}\n'); 
popup_window.document.write('document.onmousedown = noRightClick;\n\n'); 
popup_window.document.write('</script>\n\n'); 
} 
popup_window.document.write('<\/head>\n'); 
popup_window.document.write('<body style="background-color: #' + background_colors + '; margin: 0; padding: 0;">\n'); 
popup_window.document.write('<div style="text-align: center;">\n'); 
popup_window.document.write('\t<img src="' + URL + '" alt="" style="margin: 15px; border: 1px solid #' + border_color + ';" \/><br \/>\n\n'); 
popup_window.document.write('\t<form action="" style="margin: 0">\n'); 
popup_window.document.write('\t\t&nbsp;\n'); 
if (print_button == "yes") { 
popup_window.document.write('\t\t<input type="button" value="Imprimir" onmouseover="this.className=\'ButtonCloseUpOn\'" onmouseout="this.className=\'ButtonCloseUp\'" class="ButtonCloseUp" onclick=\'self.print()\' \/>\n'); 
} 
if (close_button == "yes") { 
popup_window.document.write('\t\t<input type="button" value="Fechar" onmouseover="this.className=\'ButtonCloseUpOn\'" onmouseout="this.className=\'ButtonCloseUp\'" class="ButtonCloseUp" onclick=\'self.close()\' \/>\n'); 
} 
popup_window.document.write('\t\t&nbsp;\n'); 
popup_window.document.write('\t</form>\n'); 
popup_window.document.write('<\/div>\n'); 
popup_window.document.write('<\/body>\n'); 
popup_window.document.write('<\/html>'); 
popup_window.document.close(); 
} 
