function dispW() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}
function dispH() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

// JavaScript Document
prenota = function(){
	maxH = dispH()-40;
	if (maxH < 520) maxH = 520;

	// Display an external page using an iframe
	var src = "http://"+account_url+"/catalogo_noleggio/registrazione/login.asp?ref=http://"+account_url+"/catalogo_noleggio/ncc/Servizi-on-line.asp";
	$.modal('<iframe src="' + src + '" height='+maxH+'+"px" width="825px" style="border:0">', {
		containerCss:{
			backgroundColor:"#fff",
			borderColor:"#fff",
			height:maxH,
			padding:0,
			width:825
		},
		overlayClose:false,
		autoPosition:true
	});
}
$().ready(function() {
	$("a[href^='http://www.gd-soft.it']").removeAttr("target");
	$("a[href^='http://www.gd-soft.it']").attr('href', 'javascript:prenota();');

	$("a[href^='http://www.etransfer.it']").removeAttr("target");
	$("a[href^='http://www.etransfer.it']").attr('href', 'javascript:prenota();');

	$("a[href^='http://"+account_url+"']").removeAttr("target");
	$("a[href^='http://"+account_url+"']").attr('href', 'javascript:prenota();');

});