
/* First */
function expand(div,s)
{

//        if(div=='dvMenu1')
//	    {
//		    //document.getElementById('dvMenu1').style.display='block';
//		    document.getElementById('Menu1').style.backgroundImage='url(images/topimagemenuhover.jpg)';
//	    }
//	   
//	    if(div=='dvMenu3')
//	    {
//		    //document.getElementById('dvMenu3').style.display='block';
//		    document.getElementById('Menu3').style.backgroundImage='url(images/topimagemenuhover.jpg)';
//	    }
	    
	    


  var temp = s;
  var divid = div;  	
            var obj = temp;
            var top = 29;
            var left = 0;
            var right = 0;
            var screenWidth = window.screen.width;
            var screenHeight = window.screen.height;
            var width = temp.offsetWidth;
            var Height = temp.offsetHeignt;
            document.getElementById(divid).style.display="block";
            var selfWidth =  document.getElementById(divid).offsetWidth;
            do
            {
                top += obj.offsetTop;
                left += obj.offsetLeft;
//                right += obj.offsetRight;
//                alert(right);6
            }while(obj = obj.offsetParent);

        if(div=='dvMenu1')
	    {
		    //document.getElementById('dvMenu1').style.display='block';
		    document.getElementById('Menu1').style.backgroundImage='url(images/topimagemenuhover.jpg)';
		    var tempDiv = document.getElementById('dvMenu1Color'); 
		    tempDiv.className = "topmLight15Hover";
		    //alert(left);
		    //alert(width);
		    //alert(selfWidth);
		    //alert(screenWidth);
		    //alert(left);
		    if(left + width + selfWidth < screenWidth)
            {           
                left = left + width - 120;
                //alert(left);
            }
            else 
            {           
                left = left - selfWidth;
                //alert(left);
            }    
	    }
	     if(div=='dvMenu3')
	    {
		    //document.getElementById('dvMenu3').style.display='block';
		    document.getElementById('Menu3').style.backgroundImage='url(images/topimagemenuhover.jpg)';
		     var tempDiv1 = document.getElementById('dvMenu3Color'); 
		    tempDiv1.className = "topmLight15Hover";
		    if(left + width + selfWidth < screenWidth)
            {           
                left = left + width - 171;
                //alert(left);
            }
            else 
            {           
                left = left - selfWidth;
                //alert(left);
            }    
	    }
	    if(div=='dvMenu4')
	    {
		    //document.getElementById('dvMenu4').style.display='block';
		    document.getElementById('Menu4').style.backgroundImage='url(images/topimagemenuhover.jpg)';
		     var tempDiv2 = document.getElementById('dvMenu4Color'); 
		    tempDiv2.className = "topmLight15Hover";
//		    alert(left);
//		    alert(width);
//		    alert(selfWidth);
//		    alert(screenWidth);
		    if(left +  selfWidth < screenWidth)
            {           
                left = left + width - 133;
                //alert(left);
            }
            else 
            {           
                left = left - selfWidth;
                alert(right);
            }    
	    }
	    if(div=='dvMenu5')
	    {
		    //document.getElementById('dvMenu5').style.display='block';
		    document.getElementById('Menu5').style.backgroundImage='url(images/topimagemenuhover.jpg)';
		     var tempDiv = document.getElementById('dvMenu5Color'); 
		    tempDiv.className = "topmLight15Hover";
		    if(left + selfWidth < screenWidth)
            {           
                left = left + width - 140;
                //alert(left);
            }
            else 
            {           
                left = left - selfWidth;
                //alert(left);
            }   
	    }
                   
        document.getElementById(divid).style.top=top.toString() + 'px';
        document.getElementById(divid).style.left=left.toString()+'px';       
}
function collapse(s)
{
  document.getElementById(s).style.display="none";
  document.getElementById('Menu1').style.backgroundImage='url(images/manbg_image11.jpg)';
  var tempDiv = document.getElementById('dvMenu1Color'); 
  tempDiv.className = "Goldjewel";		    
  document.getElementById('Menu3').style.backgroundImage='url(images/manbg_image11.jpg)';
  var tempDiv1 = document.getElementById('dvMenu3Color'); 
  tempDiv1.className = "Goldjewel";
  document.getElementById('Menu4').style.backgroundImage='url(images/manbg_image11.jpg)';
  var tempDiv2 = document.getElementById('dvMenu4Color'); 
  tempDiv2.className = "Goldjewel";
  document.getElementById('Menu5').style.backgroundImage='url(images/manbg_image11.jpg)';
  var tempDiv2 = document.getElementById('dvMenu5Color'); 
  tempDiv2.className = "Goldjewel";
       
}

/* Second */
function expand1(div,t)
{

document.getElementById('Menu2').style.backgroundImage='url(images/topimagemenuhover.jpg)';
var tempDiv6 = document.getElementById('dvMenu2Color'); 
tempDiv6.className = "topmLight15Hover";
  var temp1 = t;
  var divid1 = div;  	
            var obj = temp1;
            var top = 29;
            var left = 532;
            var screenWidth = window.screen.width;
            var screenHeight = window.screen.height;
            var width = temp1.offsetWidth;
            var Height = temp1.offsetHeignt;
            document.getElementById(divid1).style.display="block";
            var selfWidth =  document.getElementById(divid1).offsetWidth;
            do
            {
                top += obj.offsetTop;
                left += obj.offsetLeft;
            }while(obj = obj.offsetParent);
           
            if(left + width + selfWidth < screenWidth)
            {           
                left = left + width;
            }
            else 
            {           
                left = left - selfWidth;
            }           
        document.getElementById(divid1).style.top=top.toString() + 'px';
        document.getElementById(divid1).style.left=left.toString()+'px';       
}
function collapse1(t)
{
  document.getElementById(t).style.display="none";
  document.getElementById('Menu2').style.backgroundImage='url(images/manbg_image11.jpg)';
  var tempDiv6 = document.getElementById('dvMenu2Color'); 
  tempDiv6.className = "Goldjewel";
}

/* Third */
function expand2(div,r)
{

document.getElementById('Menu6').style.backgroundImage='url(images/topimagemenuhover.jpg)';
var tempDiv7 = document.getElementById('dvMenu6Color'); 
tempDiv7.className = "topmLight15Hover";
  var temp2 = r;
  var divid2 = div;  	
            var obj1 = temp2;
            var top = 29;
            var left = -305;
            var screenWidth = window.screen.width;
            var screenHeight = window.screen.height;
            var width = temp2.offsetWidth;
            var Height = temp2.offsetHeignt;
            document.getElementById(divid2).style.display="block";
            var selfWidth =  document.getElementById(divid2).offsetWidth;
            do
            {
                top += obj1.offsetTop;
                left += obj1.offsetLeft;
            }while(obj1 = obj1.offsetParent);
           
            if(left + width + selfWidth < screenWidth)
            {           
                left = left + width - 1;
                //alert('500');
            }
            else 
            {           
                left = left + selfWidth;
                
            }           
        document.getElementById(divid2).style.top=top.toString() + 'px';
        document.getElementById(divid2).style.left=left.toString()+'px';       
}
function collapse2(h)
{
  document.getElementById(h).style.display="none";
  document.getElementById('Menu6').style.backgroundImage='url(images/manbg_image11.jpg)';
  var tempDiv7 = document.getElementById('dvMenu6Color'); 
  tempDiv7.className = "Goldjewel";
}

function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');
        //alert($next);

   $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}


$(function() {
    setInterval( "slideSwitch()", 5000 );
});
