// Package: Progous Website
// Version: 1.0
// Date Created: 17-8-2008
// Last Modified: 29-10-2008
// Authors Osama Shamseddine <osama@progous.com>
// Copyright 2008 by Progous sarl, All Rights Reserved

var preloadFlag = false;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function preloadImages() {
	if (document.images) {
		layout_01_over = newImage("images/new.jpg");
		layout_02_over = newImage("images/new_over.jpg");
		layout_03_over = newImage("images/archive.jpg");
		layout_04_over = newImage("images/archive_over.jpg");
		layout_05_over = newImage("images/profile.jpg");
		layout_06_over = newImage("images/profile_over.jpg");
		layout_07_over = newImage("images/services.jpg");
		layout_08_over = newImage("images/services_over.jpg");
		layout_09_over = newImage("images/contact.jpg");
		layout_010_over = newImage("images/contact_over.jpg");
		preloadFlag = true;
	}
}


// This function will set the website in its intial phase
function Initialise()
{  
    preloadImages();
}

    
// This function will handle the closing and openning of the panels
function changeDivImage(divid, imageid, imagename)
{
    if (document.getElementById(divid).style.display == "none")
    {
        document.getElementById(imageid).setAttribute("src", "images/" + imagename + "_on.jpg");     
        document.getElementById(divid).style.display = 'block';
    }   
    else 
    {     
        document.getElementById(imageid).setAttribute("src", "images/" + imagename + ".jpg");
        document.getElementById(divid).style.display = 'none';
    }        
}
  
// This function will handle changing the text of the sub panel links      
function changeDivLabel(divid, labelid)
{
    if (document.getElementById(divid).style.display=="none")
    {
        document.getElementById(divid).style.display = 'block';
        document.getElementById(labelid).innerHTML ='less about this site';
    }
    else
    {
        document.getElementById(divid).style.display = 'none';
        document.getElementById(labelid).innerHTML ='more about this site';
    }        
}



// This funtion will open the pop-up window for the image preview
function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter)
{
  if(window.screen)if(isCenter)if(isCenter=="true")
  {
    var myLeft = '0';
    var myTop = '0';
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight+',left='+myLeft+',top='+myTop);
}