

//
// global variables
//
var isMozilla;
var objDiv = null;
var originalDivHTML1 = "";
var DivID = "";
var over = false;

//
// dinamically add a div to 
// dim all the page
//
function buildDimmerDiv1()
{
    var he=screen.height;   
   
    var we=100;
   
    document.write('<div id="dimmer1" class="dimmer1" style="width:'+ we + '%; height:' + he +'px"></div>');
}


//
//
//
function displayFloatingDiv1(divId, title, width, height, left, top) 
{
	DivID = divId;

	document.getElementById('dimmer1').style.visibility = "visible";

    document.getElementById(divId).style.width = width + 'px';
    document.getElementById(divId).style.height = height + 'px';
    document.getElementById(divId).style.left = left + 'px';
    document.getElementById(divId).style.top = top + 'px';
	
	var addHeader;
	
	if (originalDivHTML1 == "")
	    {
	     originalDivHTML1 = document.getElementById(divId).innerHTML;
	     
	  }
	addHeader = '<table style="  width:0px;height:0px;" class="floatingHeader1" cellpadding="0" cellspacing="0" border="0">' +
	            '<tr><td align="left" valign="bottom" ondblclick="void(0);" onmouseover="over=true;" onmouseout="over=false;">' + title + '' + 
	            '<a href="javascript:hiddenFloatingDiv(\'' + divId + '\');void(0);">' + 
	            '<img alt="Close..." title="Close..." src="images/close.png" border="0"></a></td></tr></table>';
	
    
    // add to your div an header	
	document.getElementById(divId).innerHTML = addHeader + originalDivHTML1;
	
	
	document.getElementById(divId).className = 'dimming1';
	document.getElementById(divId).style.visibility = "visible";

 
 
 
 

 
 
 


 
 
 if (window.innerHeight && window.scrollMaxY) 
 {// Firefox		
 yWithScroll = window.innerHeight + window.scrollMaxY;		
 xWithScroll = window.innerWidth + window.scrollMaxX;	
 } 
 else if (document.body.scrollHeight > document.body.offsetHeight)
 { // all but Explorer Mac		
 yWithScroll = document.body.scrollHeight;		
 xWithScroll = document.body.scrollWidth;	
 } 
 else 
 { // works in Explorer 6 Strict, Mozilla (not FF) and Safari		
 yWithScroll = document.body.offsetHeight;		
 xWithScroll = document.body.offsetWidth;  
 }	
 arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);	
 //alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );	

 
 
  document.getElementById("dimmer1").style.height=yWithScroll;
 
 
  document.getElementById('dimmer1').style.zIndex = 2;
 document.getElementById('ContactDiv').style.zIndex = 10002;
	
}


//
//
//
function hiddenFloatingDiv(divId) 
{
	document.getElementById(divId).innerHTML = originalDivHTML1;
	document.getElementById(divId).style.visibility='hidden';
	document.getElementById('dimmer1').style.visibility = 'hidden';
	
	DivID = "";
}

//
//
//
function MouseDown(e) 
{   
//    if (over)
//    {
//        if (isMozilla) {
//            objDiv = document.getElementById(DivID);
//            X = e.layerX;
//            Y = e.layerY;
//            return false;
//        }
//        else {
//            objDiv = document.getElementById(DivID);
//            objDiv = objDiv.style;
//            X = event.offsetX;
//            Y = event.offsetY;
//        }
//    }
}


//
//
//
function MouseMove(e) 
{  
//    if (objDiv) {
//        if (isMozilla) {
//            objDiv.style.top = (e.pageY-Y) + 'px';
//            objDiv.style.left = (e.pageX-X) + 'px';
//            return false;
//        }
//        else 
//        {
//            objDiv.pixelLeft = event.clientX-X + document.body.scrollLeft;
//            objDiv.pixelTop = event.clientY-Y + document.body.scrollTop;
//            return false;
//        }
//    }
}

//
//
//
function MouseUp() 
{
    objDiv = null;
}


//
//
//
function init1()
{
    // check browser
    isMozilla = (document.all) ? 0 : 1;


    if (isMozilla) 
    {
        document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
    }

    document.onmousedown = MouseDown;
    document.onmousemove = MouseMove;
    document.onmouseup = MouseUp;

    // add the div
    // used to dim the page
	buildDimmerDiv1();

}

// call init
init1();









  function displayWindow1()
		    {  
		    
		    
		
		        var w, h, l, t;
		        w = 420;
		        //h = 475;
		         h = 620;
		        l = screen.width/4;
		        t = screen.height/12;
                //alert("width"+screen.width);
                //alert("height"+screen.height);
                // no title		        
		        // displayFloatingDiv('windowcontent', '', w, h, l, t);

                // with title		        
		        displayFloatingDiv1('ContactDiv', '', w, h, l, t);
		        
		       // JSFX_FloatDiv("windowcontent", 790,-220).floatIt();
		        
		        // FloatDiv("windowcontent", screen.width/1.29,-screen.height/3.50).floatIt();
		        
		    }
		    
		    var ns = (navigator.appName.indexOf("Netscape") != -1);
            var d = document;
            function FloatDiv(id, sx, sy)
            {
	             var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	             var px = document.layers ? "" : "px";
	             window[id + "_obj"] = el;
	             if(d.layers)el.style=el;
	             el.cx = el.sx = sx;el.cy = el.sy = sy;
	             el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	            el.floatIt=function()
	            {
		         var pX, pY;
	         	 pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		        document.documentElement && document.documentElement.clientWidth ? 
		        document.documentElement.clientWidth : document.body.clientWidth;
		        pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		        document.documentElement.scrollTop : document.body.scrollTop;
		        if(this.sy<0) 
		        pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		        document.documentElement.clientHeight : document.body.clientHeight;
		        this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		        this.sP(this.cx, this.cy);
		        setTimeout(this.id + "_obj.floatIt()", 40);
	           }
	           return el;
	           
	           }

		    

