function feedback()
{
   location.href = 'mailto:artemis.alpeia' + '@inwind.it';
 //window.open('/artemis/misc/feedback.html', '_AA_FBACK', 'width=400,height=375,resizable,status');
}

function sendSMS()
{
   window.open('/artemis/misc/send_sms.html', '_AA_FBACK', 'width=400,height=375,resizable,status');
}

function poll()
{  window.open('/artemis/misc/minipoll.html', '_AA_POLL', 'width=400,height=450,resizable,status');
}

function rate(mark, subj, id)
{  o_id = (id || 'rate_msg');
   getObj(o_id).innerHTML = 'Grazie!';
   setTimeout("getObj(o_id).innerHTML = '';", 5000);
   var frm = frames[0].document.forms[0];
   frm.mark.value = mark;
   frm.topic.value = (subj || document.title);
   frm.submit();
}

function getObj(id)
{  return (document.getElementById) ? document.getElementById(id) : document.all[id];
}

function getAbsoluteOffset(element)
{  var off = new Object();
   off.width = element.offsetWidth;
   off.height = element.offsetHeight;
   off.left = off.top = 0;
   off.toString = function() { var props = []; for (var i in this) props[props.length] = i + ' : ' + this[i]; return '{ ' + props.join(', ') + ' }'; };
   while (element)
   {  off.left += element.offsetLeft;
      off.top += element.offsetTop;
      element = element.offsetParent;
   }
   return off;
}

function adjust()
{
/*
   if (!document.getElementsByTagName) return;
   var inputs = document.getElementsByTagName('input');
   for (var i = 0; i < inputs.length; i++)
   {
      if (inputs[i].type == 'button' || inputs[i].type == 'submit' || inputs[i].type == 'reset')
      {
         with (inputs[i].style)
	 {  color =  'white';
	    fontFamily = 'Tahoma';
	    fontSize = '8pt';
	    backgroundColor = '#FFBA41';
	    border = '1px solid #FFA500';
	 }
//	 inputs[i].value = 'Vota!';
      }
   }
   var anchors = document.getElementsByTagName('a');
   for (var i = 0; i < anchors.length; i++)
   {
      if (anchors[i].innerText.indexOf('Bravenet') != -1)
      {  anchors[i].innerHTML = 'Powered by Bravenet';
	 anchors[i].className = 'white';
      }
   }
*/
}

var popupWin = null;

function popup(location, name, properties)
{
   if (popupWin)
   {
      popupWin.close();
   }
   popupWin = window.open(location, name, properties);
   return false;
}

function showNoMore(id)
{
   setCookie(id, true);
}

function setCookie(name, value)
{
   document.cookie = name + '=' + value + '; expires=' + new Date(new Date().getTime() + (365 * 24 * 60 * 60 * 1000)).toGMTString();
}

function deleteCookie(name)
{
   document.cookie = name + '=0 ; expires=' + new Date(0).toGMTString();
}

function getCookie(name)
{
   var c = document.cookie;
   if (c.indexOf(name + '=') == -1)
      return null;
   if (c.indexOf(';', c.indexOf(name)) != -1)
      return c.substring(c.indexOf('=', c.indexOf(name)) + 1, c.indexOf(';', c.indexOf(name)));
   else
      return c.substring(c.indexOf('=', c.indexOf(name)) + 1);
}

function detectCookie()
{
   var cookieEnabled = false;
   setCookie('prova', true);
   if (getCookie('prova'))
   {  cookieEnabled = true;
      deleteCookie('prova');
   }
   if (cookieEnabled)
   {
      alert('I cookie sono correttamente abilitati');
   }
   else
   {
      alert('I cookie sono disabilitati. Riferirsi alla documentazione del browser ' + navigator.appName + ' per abilitarli');
   }
}

function showAd(url, id)
{
   if (!getCookie(id))
      window.open(url, '_AA_AD', 'resizable,scrollbars,width=500,height=250');
}

defaultStatus = 'artemis.alpeia';

if (getCookie('skin'))
{
   document.write('<link href="/artemis/style/skin' + getCookie('skin') + '.css" rel="stylesheet" type="text/css">');
}
else
{
   document.write('<link href="/artemis/style/skin0.css" rel="stylesheet" type="text/css">');
}
