isIE = isIE4 = isIE5 = isIE6 = isIE7 = isNS = isNS4 = isNS6 = isNS7 = isNS8 = isFlash5 = isFlashMX = false;

// Browser Detection
if(navigator.appName.indexOf('Netscape') == 0) isNS = true;
if(navigator.appName.indexOf('Microsoft') == 0) isIE = true;
isUNIX = (window.navigator.appVersion.indexOf("X11") != -1) ||
         (window.navigator.appVersion.indexOf("Linux") != -1) ||
         (window.navigator.appVersion.indexOf("SunOS") != -1) ||
         (window.navigator.appVersion.indexOf("IRIX") != -1) ||
         (window.navigator.appVersion.indexOf("HP-UX") != -1);
isMac = (window.navigator.appVersion.indexOf("Mac") != -1);
isWindows = navigator.userAgent.indexOf("Windows 95") != -1 ||
            navigator.userAgent.indexOf("Windows 98") != -1 ||
            navigator.userAgent.indexOf("Windows NT") != -1;
isMacIE = (isMac && isIE);

// Netscape Version
if(isNS) {
  v = parseInt(navigator.appVersion);
  if(v == 4) {
    isNS4 = true;
  } else if(v == 5) {
    p = navigator.userAgent.lastIndexOf('/');
    v = parseInt(navigator.userAgent.substr(p+1));
    eval("isNS" + v + " = true");
  }
}

// Internet Explorer Version
if(isIE) {
  v = parseInt(navigator.appVersion.substr(navigator.appVersion.indexOf("MSIE")+5));
  eval("isIE" + v + " = true");
}

// Image Rollover & Preload

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//Open Browser Window

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

//Bookmark Page

function bookmarkIt() { 
  var bookmarktitle = document.title;
  var bookmarkurl = document.location;
  var netscape
  var macintosh
  netscape="Attention Netscape Users. To Bookmark this page please click the page you would like to bookmark and press CTRL+D. If you would like to add this page to your Netscape Sidebar, please click OK on the next window which appears.";
  macintosh="Attention Macintosh User. To Bookmark this page please click the page you would like to bookmark and press CTRL+D.";

  if (window.sidebar&&window.sidebar.addPanel) { 
    alert(netscape);
    window.sidebar.addPanel(bookmarktitle, bookmarkurl,""); 
  } else if (isMac) {
    alert(macintosh);
  } else if (document.all) {
    window.external.AddFavorite(bookmarkurl, bookmarktitle);
  } else if (window.opera && window.print) {
    return true;
  }
}

// Sticky Navigation

var currentNavItem = "";
var navItemNormal = new Image();

function writeNavButton(name,height,width) {
  document.write("<img src=/images/subbutn_" + name + "_off.gif name=butn_" + name + " id=butn_" + name + " width=" + width + " height=" + height + " border=0 onMouseOver=MM_swapImage('butn_" + name + "','','/images/subbutn_" + name + "_on.gif',1) onMouseOut=MM_swapImgRestore() onClick=setCurrentNavItem('" + name + "')>");
}

function setCurrentNavItem(item) {
  if(currentNavItem.name != MM_findObj("butn_"+item).name) {
    currentNavItem.src = navItemNormal.src;
    currentNavItem = MM_findObj("butn_"+item);
    currentNavItem.src = "/images/subbutn_" + item + "_active.gif";
    navItemNormal.src = "/images/subbutn_" + item + "_off.gif";
  }
}

function resetCurrentNavItem() {
  currentNavItem.src = navItemNormal.src;
  currentNavItem = "";
  navItemNormal = new Image();
}

function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}


function valida(frm){
																																						
var email = String(frm.fldemail.value);
if(email.lastIndexOf("@") > 0 && email.lastIndexOf("@")+1 < email.lastIndexOf(".") && email.lastIndexOf(".")+2 < email.length)
return true;
else {
alert("The email is not valid");
frm.fldemail.focus();			
return false;
}
}
				
function limpa()
{
if (document.recordregisto.fldemail.value == "Your Email")	
document.recordregisto.fldemail.value = "";
return true;
}

//Disable right click
					
///var message="";
///////////////////////////////////
///function clickIE() {if (document.all) {(message);return false;}}
///function clickNS(e) {if 
///(document.layers||(document.getElementById&&!document.all)) {
///if (e.which==2||e.which==3) {(message);return false;}}}
///if (document.layers) 
///{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
///else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

///document.oncontextmenu=new Function("return false")
// --> 

//Share Facebook

function 
fbs_click() 
{
u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}

function 
digg_click() 
{
u=location.href;t=document.title;window.open('http://digg.com/submit?phase=2&url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}

function 
tag_click() 
{
u=location.href;t=document.title;window.open('http://del.icio.us/post?url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}

function 
myspace_click() 
{
u=location.href;t=document.title;window.open('http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}


function 
google_click() 
{
u=location.href;t=document.title;window.open('http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}






