//definitions
var siteprefix = 'http://www.visirun.com/';
var imageprefix = siteprefix + 'widget/images/';
var maindiv_name = 'visirunwidget';
var mainwidth = '160px';
var mainheight = '50px';
var mainborder = "";
var mainpointer = "pointer";
var skipopen = false;
var vr_sfondo_name = "vr_sfondo";
var vr_panel_name = "vr_panel";
var mainlinkname = "vl";
var destination_site = 'http://www.visirun.com/';
var destination_page = 'index.php?option=com_jumi&fileid=14';
var close_label = 'Chiudi';
var username_label = 'Email:';
var password_label = 'Password:';
var login_label = 'Entra';
var immaginesfondo = 'sfondo-pannello-it.png';
var maininner = '
';
var basehtml;
var vr_sfondotext = '
';
function openDiv(){
if ( skipopen ) {skipopen=false; return; }
if ( window.document.getElementById( vr_sfondo_name ) == null )
{
window.document.body.innerHTML = window.document.body.innerHTML + vr_sfondotext;
var vr_sfondo = window.document.getElementById(vr_sfondo_name);
var vr_panel = window.document.getElementById(vr_panel_name);
var form_container = window.document.getElementById("form_container");
var user_label = window.document.getElementById("user_label");
var pass_label = window.document.getElementById("pass_label");
var username_login = window.document.getElementById("username_login");
var password_login = window.document.getElementById("password_login");
var login = window.document.getElementById("login");
var login_block = window.document.getElementById("login_block");
var loginbutton = window.document.getElementById("loginbutton");
var close_panel = window.document.getElementById("close_panel");
vr_panel.onclick = nothing;
//sfondo
//css
if (self.innerHeight )
height = self.innerHeight + 'px';
else
if (document.body.clientHeight > 0 )
height = document.body.clientHeight+'px';
else height = '300%';
vr_sfondo.onclick = openDiv;
vr_sfondo.style.position = 'fixed';
vr_sfondo.style.zIndex = '1000';
vr_sfondo.style.left = '0';
vr_sfondo.style.top = '0';
vr_sfondo.style.height = '100%';
vr_sfondo.style.width ='100%';
vr_sfondo.style.display = 'none';
vr_sfondo.style.paddingTop='150px';
vr_sfondo.style.backgroundImage = 'url('+imageprefix+'sfondo-nero.png)';
vr_sfondo.style.display = 'block';
vr_panel.style.cursor = 'auto';
vr_panel.position = 'fixed';
vr_panel.style.backgroundImage = 'url('+imageprefix+immaginesfondo+')';
vr_panel.style.top ='100px';
vr_panel.style.margin ='0 auto';
vr_panel.style.width ='190px';
vr_panel.style.height ='170px';
vr_panel.style.padding = '15px 30px';
vr_panel.style.zIndex = '999999999';
vr_panel.style.color = '#999999';
vr_panel.style.fontSize ='10px';
close_panel.style.marginRight = '-10px';
close_panel.style.paddingRight = '12px';
close_panel.style.textAlign = 'right';
close_panel.style.display = 'inline';
close_panel.onclick = openDiv;
close_panel.style.cursor = 'pointer';
form_container.style.textAlign="left";
login.style.margin = '0px';
form_container.style.marginTop = '60px';
var labels = window.document.getElementsByTagName('label');
for(var y = 0; y < labels.length; y++) {
labels[y].style.position = 'absolute';
labels[y].style.padding= '3px';
}
user_label.style.marginBottom = '5px';
user_label.style.marginLeft = '5px';
pass_label.style.marginBottom = '5px';
pass_label.style.marginLeft = '5px';
username_login.style.marginLeft = '60px';
password_login.style.marginLeft = '60px';
username_login.style.border = '1px solid #cccccc';
password_login.style.border = '1px solid #cccccc';
username_login.style.width = '115px';
password_login.style.width = '115px';
login_block.style.textAlign="center";
login_block.style.marginTop = '15px';
loginbutton.style.color = '#FFFFFF';
loginbutton.style.padding = '3px';
loginbutton.style.paddingTop = '0px';
loginbutton.style.background = 'none';
loginbutton.style.border = 'none';
loginbutton.style.width = '75px';
loginbutton.style.height = '27px';
loginbutton.style.backgroundImage = 'url('+imageprefix+'loginbutton.png)';
loginbutton.style.backgroundRepeat = 'no-repeat';
}
else
{
window.document.body.removeChild( window.document.getElementById(vr_sfondo_name));
var trigger = window.document.getElementById("trigger");
trigger.onclick = openDiv;
}
}
function nothing(){ skipopen = true; }
//init
var mainlinkname = window.document.getElementById(mainlinkname);
mainlinkname.style.color = "#AAAAAA";
if ( true )
{
mainlinkname.innerHTML = 'Gestione Flotta VisiRun';
mainlinkname.href = 'http://www.visirun.com';
}
var maindiv = window.document.getElementById(maindiv_name);
maindiv.innerHTML = maininner+'
'+maindiv.innerHTML;
var trigger = window.document.getElementById("trigger");
trigger.onclick = openDiv;
//maindiv
//css
maindiv.style.width = mainwidth;
maindiv.style.border = mainborder;
maindiv.style.cursor = mainpointer;
maindiv.style.fontSize = '9px';
maindiv.style.color = '#CCCCCC';
maindiv.style.whiteSpace = 'nowrap';
maindiv.style.fontFamily = "arial";
maindiv.style.textAlign = "center";
//beavior