//////////////
// put this on body <body onunload="javascript: exitpop()" >
function toggleforms(obj)
{
//alert('hello1');
 if(document.getElementById('divOrders'))
 {
    //alert('hello2');
    //alert(obj.id);
     if(obj.id == "btnOrders")
     {
     //alert('hello3');
       document.getElementById('divOrders').style.display='none';
       document.getElementById('divHistory').style.display='block';
       document.getElementById('divMP').style.display='none';
       //alert('hello4');
     }
     else if (obj.id == "btnHistory")
     {
       document.getElementById('divOrders').style.display='none';
       document.getElementById('divHistory').style.display='none';
       document.getElementById('divMP').style.display='block';
     }
     else if (obj.id == "btnMP")
     {
       document.getElementById('divOrders').style.display='block';
       document.getElementById('divHistory').style.display='none';
       document.getElementById('divMP').style.display='none';
     }
 }
}

//////////////
// 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 an outstanding service...Call us Today and Discover What the 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/whotelsofitel.jpg", "images/slideshow/whouse2.jpg", "images/slideshow/wcurtains.jpg","images/slideshow/wcoverpatio.jpg",
"images/slideshow/wpostaloffice.jpg","images/slideshow/wpublix.jpg","images/slideshow/wrestaurant.jpg","images/slideshow/willuminatedparking.jpg","images/slideshow/whotelsofiteldrive.jpg","images/slideshow/willuminatedparking2.jpg","images/slideshow/whouse4.jpg","images/slideshow/wstartbucks.jpg","images/slideshow/wsubway.jpg"]


//set corresponding urls
url = ["http://freewarejava.com", "http://javascriptkit.com", "http://dynamicdrive.com", "http://www.geocities.com"]

msg = ["To your nice home ...","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 ...","Extend your space with us ...","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 ...","Your Awnings' Solution Company ..."]

/*
subway
hotel pool
house pool
curtain bbq
covered patio
us postal office
publix
restaurant extend it
ilum park lot
hotel mega structure
ilum parl lot 2nd view
julio pool
starbucks cold stone
*/

//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<=12)
{
setTimeout("switchAd()",duration*1000);
counter++;
}
}
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();

}

/////////
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()", 2000);
        }
    }
    /* 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()", 5000);
    //}
}



