window.onload = StartupFunctions;
var TimerID = '';
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
var exactHeight=myHeight-135;
//alert(exactHeight);
function FirstAmination()
{
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {width: { to: [0] }};
    var anim = new YAHOO.util.Motion('top_h_line_under', attributes);
	anim.animate();
	TimerID = setTimeout("SecondAmination()", 500);
}
function SecondAmination()
{
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {height: { to: [100] }};
    var anim = new YAHOO.util.Motion('top_v_line_under', attributes);
	anim.animate();
	TimerID = setTimeout("ThirdAmination()", 1000);

}
function ThirdAmination()
{
	document.getElementById('red_line_4').style.display = 'block';
	document.getElementById('red_line_4_under').style.display = 'block';
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {height: { to: [exactHeight] }};
    var anim = new YAHOO.util.Motion('right_line_1_under', attributes);
	anim.animate();
	TimerID = setTimeout("ThirdAmination_1()", 1000);
}
function ThirdAmination_1()
{
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {height: { to: [443] }};
    var anim = new YAHOO.util.Motion('red_line_1', attributes);
	anim.animate();
	TimerID = setTimeout("ThirdAmination_2()", 1000);
}
function ThirdAmination_2()
{
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {width: { to: [591] }};
    var anim = new YAHOO.util.Motion('red_line_2', attributes);
	anim.animate();
	TimerID = setTimeout("ThirdAmination_3()", 1000);
}
function ThirdAmination_3()
{
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {height: { to: [0] }};
    var anim = new YAHOO.util.Motion('red_line_3', attributes);
	anim.animate();
	TimerID = setTimeout("ThirdAmination_4()", 1000);
}
function ThirdAmination_4()
{
	clearTimeout(TimerID); TimerID = 0;
	var attributes = {width: { to: [0] }};
    var anim = new YAHOO.util.Motion('red_line_4', attributes);
	anim.animate();
	TimerID = setTimeout("FourthAmination()", 1000);
}

function FourthAmination()
{
	clearTimeout(TimerID); TimerID = 0;
	//ie6.0fix	
	document.getElementById('red_line_4').style.display = 'none';
	var attributes_center = 
	{
		top: { to: 0 },
		left: { to: 0 },
		height: { to: 443 },
		width: { to: 591 }
	}; 
    var anim_center = new YAHOO.util.Motion('image_center', attributes_center);
	anim_center.animate();
	runSlideShow();
	TimerID = setTimeout("FifthAmination()", 2000);
}

function FifthAmination()
{
	opacity('top_logo_img', 0, 100, 1000);
	opacity('top_menu', 0, 100, 1000);
	opacity('right_menu', 0, 100, 1000);
	opacity('rightbox', 0, 100, 1000);
	opacity('toprightbox', 0, 100, 1000);
	TimerID = setTimeout("SixthAmination()", 1000);
}
/*function SevenAmination()
{
	clearTimeout(TimerID); TimerID = 0;
    var attributes_top = {color: { to: '#fff' }};
	var anim_1 = new YAHOO.util.Motion('right_link_1', attributes_top); var anim_2 = new YAHOO.util.Motion('right_link_2', attributes_top); var anim_3 = new YAHOO.util.Motion('right_link_3', attributes_top); var anim_4 = new YAHOO.util.Motion('right_link_4', attributes_top); var anim_5 = new YAHOO.util.Motion('right_link_5', attributes_top); var anim_6 = new YAHOO.util.Motion('right_link_6', attributes_top); var anim_7 = new YAHOO.util.Motion('right_link_7', attributes_top); var anim_8 = new YAHOO.util.Motion('right_link_8', attributes_top); var anim_9 = new YAHOO.util.Motion('right_link_9', attributes_top); 
	anim_1.animate(); anim_2.animate(); anim_3.animate(); anim_4.animate(); anim_5.animate(); anim_6.animate(); anim_7.animate(); anim_8.animate(); anim_9.animate();
	TimerID = setTimeout("EightAmination()", 1000);
}
function EightAmination()
{
		opacity('rightbox', 0, 100, 1000);
}*/
function StartupFunctions()
{
	TimerID = setTimeout("FirstAmination()", 0);
}

function myRollover(store)
{
document.getElementById(store).style.color="#960000";
}
function myRollout(store1)
{
document.getElementById(store1).style.color="#ffffff";
}

// *********************************************************************
// *********************************************************************
// *********************************************************************
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++;
        }
    }
}

//find object code
function MM_findObj(n, d){
  var p, i, x;
  if(!d){
    d=document;
  }
  if((p = n.indexOf("?")) > 0 && parent.frames.length){
    d = parent.frames[n.substring(p + 1)].document;
    n = n.substring(0, p);
  }
  if(!(x = d[n]) && d.all){
    x = d.all[n];
  }
  for(i = 0; !x && i < d.forms.length; i++){
    x = d.forms[i][n];
  }
  for(i = 0; !x && d.layers && i < d.layers.length; i++){
    x=MM_findObj(n, d.layers[i].document);
  }
  return x;
}

//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 + ")"; 
	}

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //set the current image as background
    document.getElementById(divid).style.backgroundImage = "url(" + 
document.getElementById(imageid).src + ")";
    
    //make image transparent
    changeOpac(0, imageid);
    
    //make new image
    document.getElementById(imageid).src = imagefile;

    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}