//apri Web messenger
function apriWebmessenger(){
desktop = window.open('http://imtunnel.tiscali.it/vulcano/main.jsp?community=tiscali-it&autosearch=true','','location=no,status=no,scrollbars=no,resizable=no,menubar=no,height=230,width=394');
}
// Browser check
var style='';
document.write(style);
var platform = navigator.platform;
var version = navigator.appVersion;
var browser = navigator.appName;
var fullVersion = parseFloat(version.substring(version.indexOf("MSIE")+5,version.length));
var majorVersion = parseInt(''+fullVersion);
if((majorVersion < 6)&&(browser == "Microsoft Internet Explorer")&&(platform == "Win32")) {
document.write('');
}
//Funzione MakeAD da inserire in Testa di Pagina Version 5.2
//Version 5.2 Rich Media
var magic2=Math.floor(Math.random() * 4573285835)
function makeAD (sito, tags, dimw, dimh){
now = new Date();
itstime = now.getTime();
site=sito+"/";
target=tags+"/ACC_RANDOM="+itstime+"/PAGEID="+magic2;
document.write('');
}
function apri(){
desktop=window.open('/password.html','password','toolbar=no,location=no,status=no,scrollbars=no,menubar=no,resizable=no,width=400,height=436');
}
function OnPhoenixHelp(w,h,where) {
x = (screen.width - w - 8);
url="http://www.tiscali.it/helpmail/index.html?where="+where;
desktop = window.open(url,"centrato","resizable=no,toolbar=no,scrollbars=no,menubar=no,location=no,status=no,width=" + w + ",height=" + h + ",screenY=0,screenX=" + x + ",left=" + x + ",top=0");
}
function Nospaces(checkString){
var newString = "";
var i = 0;
var st = 0;
if(checkString == null){return null;}
for (i = 0; i < checkString.length; i++){
ch = checkString.substring(i, i+1);
if (ch != " "){newString += ch;}
}
return newString;
}
function OnWebMailLoad(){
var uname=GetCookie("WEBUSER");
var i;
if(uname != null){
i= uname.indexOf("@tiscali.it");
if(i>=0){uname = uname.substring(0,i);}
document.dataentry.username.value = uname;
}
}
function OnWebMailLogin(){
var hostname=parent.location.hostname;
var hostArray=hostname.split(".");
var domain="";
for(var i=1; i < hostArray.length;i++){
if(i==hostArray.length-1)
domain+=hostArray[i];
else
domain+=hostArray[i]+'.';
}
// alert(domain);
var domain_point="."+domain;
SetCookie("WRITECOOKIES", "yes", null, "/", domain_point);
if(GetCookie("WRITECOOKIES") == null) {
alert("Cambia le impostazioni di sicurezza per accedere alla webmail.Quest'applicazione si basa sui cookies.");
}
var uname= document.dataentry.username.value;
var options="";
if(document.dataentry.options){options=document.dataentry.options.value;}
var location="/mail/main";
if(options != ""){location += "?" + options;}
uname=Nospaces(uname);
if((uname!=null) && (uname.length > 0) && document.dataentry.password.value!=''){
if(uname.indexOf("@")==-1){uname=uname + "@" + domain;}
}
else{alert('Inserire userID e password'); return;}
if(document.dataentry.template){
// SetCookie("TEMPLATE", document.dataentry.template[document.dataentry.template.selectedIndex].value, null, "/", domain_point);
SetCookie("TEMPLATE", document.dataentry.template.value, null, "/", domain_point);
}
SetCookie("WEBUSER", uname, null, "/mail", domain_point);
SetCookie("WEBPASS", document.dataentry.password.value,null, "/mail", domain_point);
//alert('user:'+GetCookie("WEBUSER"));
//alert(document.cookie);
window.location.href=location;
}
function IeCheck(){var agt=navigator.userAgent.toLowerCase();var nIE = (agt.indexOf("msie") != -1);return nIE;};
function WinCheck(){var agt=navigator.userAgent.toLowerCase();var nWin = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );return nWin;};
var tiscali_browser;function fnInit(){if (IeCheck()&&WinCheck()){if (window.external != null){tiscali_browser = window.external.tiscalibrowser;if ( tiscali_browser == "it" ) {document.write('');}}}}fnInit();
//Tiscali 10.0 Cookie Reading Functions -- (12-Dec-01)
//copyright Tiscali S.p.A 2001
function CheckT10(){
if (GetCookie("ssosession")!=null){return true;}
else return null;
}
function GetStatusT10(){
if (CheckT10()!= null){document.write('');}
else{document.write('');}
}
function IdentityT10(){
if(CheckT10()!= null){document.write(base64decode(GetCookie("whoiswho")));}
else{document.write('');}
};
function getCookieVal (offset){
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name){
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen){
var j = i + alen;
if(document.cookie.substring(i, j) == arg)return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name,value,expires,path,domain,secure){
document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
}
function DeleteCookie (name,path,domain){
if (GetCookie(name)){
document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
/*
* Interfaces:
* b64 = base64encode(data);
* data = base64decode(b64);
*/
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
function base64encode(str) {
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while(i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if(i == len)
{
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if(i == len)
{
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
out += base64EncodeChars.charAt(c3 & 0x3F);
}
return out;
}
function base64decode(str) {
var c1, c2, c3, c4;
var i, len, out;
len = str.length;
i = 0;
out = "";
while(i < len) {
/* c1 */
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while(i < len && c1 == -1);
if(c1 == -1)
break;
/* c2 */
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while(i < len && c2 == -1);
if(c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
/* c3 */
do {
c3 = str.charCodeAt(i++) & 0xff;
if(c3 == 61)
return out;
c3 = base64DecodeChars[c3];
} while(i < len && c3 == -1);
if(c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
/* c4 */
do {
c4 = str.charCodeAt(i++) & 0xff;
if(c4 == 61)
return out;
c4 = base64DecodeChars[c4];
} while(i < len && c4 == -1);
if(c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
}
return out;
}