//////////////
// put this on body <body onunload="javascript: exitpop()" >
function exitpop()
{
my_window= window.open ("",
  "mywindow1","status=1,width=450,height=250"); 
my_window.document.write('<H1>Thank you for visiting our website... Do you have any question? <a href="mailto:info@paradiseawnings.com?subject=Request Information">Contact Us</a></H1>');  
}


var id,pause=0,position=0,revol=4;
function banner() 
{
  var i,k;
  var msg="                     Paradise Awnings has great products with great prices and outstanding service...Call us Today and Discover What the Paradise Advantage is ...         ";
  var speed=10;
  
  if (document.getElementById("banner"))
  {
  
  document.getElementById("banner").innerText = msg.substring(position,position+50);
  //document.thisform.thisbanner.value=msg.substring(position,position+50);
  if(position++==msg.length) 
  {
      if (revol-- < 2) return;
      position=0;
      document.getElementById("banner").innerText =" ";
  }
  id=setTimeout("banner()",1000/speed);
  
  }
}


/////
function neon(brite) 
{
if (document.getElementById("glowing"))
{

document.getElementById("glowing").innerText="Latest News";
if (brite < 21) 
{
brite = 21
document.getElementById("glowing").className="header-white3";
}
else 
{
brite = 1;
document.getElementById("glowing").className="header-red3";
}

//document.getElementById("glowing").style.filter = "glow(color=red, strength=" + brite + ")";
//// ok, now let's add a little time to each round it runs..
setTimeout("neon(" + brite + ")",300);
}

}

////
//id, 0, 100, 500
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
}
//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 
 

//////
//set image paths
src = ["images/slideshow/whouse1.jpg","images/slideshow/rest1.jpg","images/slideshow/rest2.jpg", "images/slideshow/wsubway.jpg", "images/slideshow/whouse2.jpg", "images/slideshow/wcurtains.jpg","images/slideshow/wcoverpatio.jpg",
"images/slideshow/wpostaloffice.jpg","images/slideshow/wpublix.jpg","images/slideshow/retractable.jpg","images/slideshow/willuminatedparking.jpg","images/slideshow/whotelsofiteldrive.jpg","images/slideshow/willuminatedparking2.jpg","images/slideshow/whouse4.jpg","images/slideshow/wstartbucks.jpg","images/slideshow/patiocover.jpg","images/slideshow/whotelsofitel.jpg"]


//set corresponding urls
url = ["http://freewarejava.com", "http://javascriptkit.com", "http://dynamicdrive.com", "http://www.geocities.com"]

msg = ["To your nice home ...","Extend your space","Add beauty to your place...","From National Accounts ...","To your beautiful home ...","You can now Enjoy your BBQ ...","Celebrate your BIG party ...","We do Government Projects as well ...","We are every where ...","Retractables, Shades and more ...","Protect your car ...","We also do MEGA structures ...","Don't be in the dark ...","Do you Wish you were here?","We also keep it cool for you ...","What are your needs?","Your Awnings' Solution Company ..."]


//set duration for each image
duration = 6;
state = 0;
//Please do not edit below
ads=[]; ct=0;counter=0;
function switchAd() 
{
if (document.getElementById("Ad_Image"))
{
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document.getElementById("Ad_Image").src = ads[ct=n].src;
document.getElementById("AdMsg").innerText = msg[ct];
opacity("Ad_Image", 0, 100, 3000);
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
if(counter<=15)
{
setTimeout("switchAd()",duration*1000);
counter++;
}
}
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();

}
////////////
function ToggleAnswer(obj)
{
   if (document.getElementById(obj).style.display == "block")
   {
     document.getElementById(obj).style.display = "none";
   }
   else
   {
     document.getElementById(obj).style.display = "block";
   }
}
/////////
function ShowTransparentPopUp()
    {
        if (document.getElementById("Popup"))
        {
        /* get the mouse left position */
        x = xcoord;// + document.getElementById("mpbody").scrollLeft;
        /* get the mouse top position  */
        y = ycoord;// + document.getElementById("mpbody").scrollTop + 35;
        /* display the pop-up */
        document.getElementById("Popup").style.display="block";
        /* set the pop-up's left */
        document.getElementById("Popup").style.left = x;
        /* set the pop-up's top */
        document.getElementById("Popup").style.top = y;
        
        setTimeout("HideTransparentPopUp()", 3000);
        }
    }
    /* this function hides the pop-up when
     user moves the mouse out of the link */
    function HideTransparentPopUp()
    {
        /* hide the pop-up */
        if (document.getElementById("Popup"))
        {
        document.getElementById("Popup").style.display="none";
        }
        
    }
    xcoord = 0;
    ycoord = 0;
    function getcoord()
    {
     if (document.getElementById("Popup"))
     {
        xcoord = window.event.clientX;
        ycoord = window.event.clientY;
        document.getElementById("Popup").style.left = window.event.clientX;
        document.getElementById("Popup").style.top = window.event.clientY;
      }
    }
/////////////////
function maxwindow()
{
window.resizeTo(screen.availWidth, screen.availHeight);
window.moveTo (0, 0);
}
///////////////////
function loaditup()
{
    //banner();
    //neon(21);
    getcoord();
    if (document.getElementById("Ad_Image"))
    {
    //setTimeout("ShowTransparentPopUp()", 2000);
    }
}




