﻿window.onresize = function(event) {
    SetHeight();
}

function SetHeight(){
    var FooterTd = document.getElementById("FooterTd").offsetHeight;
    var BodyHeight = document.documentElement.offsetHeight
    var ContentHeight = (BodyHeight - FooterTd)-4;
    //window.moveTo(0, 0);
    //window.resizeTo(screen.availWidth, screen.availHeight);
    document.getElementById("ContentTd").style.height = ContentHeight;
}

var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{	
    // cancel close timer
    //mcancelclosetime();

    // close old layer
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

    // get new layer and show it
    ddmenuitem = document.getElementById(id);
    ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
    //closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
    if(closetimer)
    {
        //window.clearTimeout(closetimer);
        closetimer = null;
    }
}

function OpenUrl(URL){
	document.location = URL;
}

function OpenContentPopDiv(URL){
    document.getElementById("iframeProgress").style.display = 'block';
	document.getElementById("ContentPopDiv").style.display = 'block';
    document.getElementById("PopTDContentFrame").src = URL;
}

function CloseContentPopDiv(){
    document.getElementById("iframeProgress").style.display = 'none';
	document.getElementById("ContentPopDiv").style.display = 'none';
}

function showDjPopup(myLink){
	document.getElementById("iframeProgress").style.display = 'block';
	popDivBGObj = document.getElementById("popDivBG");
	popDivObj = document.getElementById("popDiv");
	popWinObj = document.getElementById("popWin");
	
	popDivBGObj.style.width=screen.width-20;
	popDivBGObj.style.height=screen.height-100;
	popDivBGObj.style.display='block';

	//myPopWidth = parseInt(popDivObj.style.width);
	//popDivObj.style.left = ((screen.width/2)-(myPopWidth/2));
	popDivObj.style.display='block';
	popWinObj.src = myLink;
	FadeIn();
}

function HideLoadingProgress(){
    document.getElementById("iframeProgress").style.display = 'none';
}

function HideDjPopup(){
	popDivBGObj = document.getElementById("popDivBG");
	popDivObj = document.getElementById("popDiv");
	popDivBGObj.style.display='none';
	popDivObj.style.display='none';
}

function FadeIn(){
	timerID = setInterval( "FadeEffect('ObjDiv');", 10);
}

var PopOpVal = 0;
var PopOpObVal = 0;

function FadeEffect() { 
	PopOpVal = PopOpVal+10;
	PopOpObVal = PopOpObVal+ 0.1;
	FadeInDiv = document.getElementById("popDiv");
	if (PopOpVal>=101)
	{
		clearInterval(timerID);
		PopOpVal = 0;
		PopOpObVal = 0;
	}else{
		FadeInDiv.style.filter = "alpha(opacity=" + PopOpVal + ")";
		FadeInDiv.style.opacity = PopOpObVal;
	}
}





// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
 
// =======================================
// set the following variables
// =======================================
 
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000
 
// Duration of crossfade (seconds)
var crossFadeDuration = 3
 
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
 
Pic[0] = 'CommoditiesAnimation/01.jpg'
Pic[1] = 'CommoditiesAnimation/02.jpg'
Pic[2] = 'CommoditiesAnimation/03.jpg'
Pic[3] = 'CommoditiesAnimation/04.jpg'
Pic[4] = 'CommoditiesAnimation/05.jpg'
Pic[5] = 'CommoditiesAnimation/06.jpg'
Pic[6] = 'CommoditiesAnimation/07.jpg'
Pic[7] = 'CommoditiesAnimation/08.jpg'
Pic[8] = 'CommoditiesAnimation/09.jpg'
Pic[9] = 'CommoditiesAnimation/10.jpg'
 
 
// =======================================
// do not edit anything below this line
// =======================================
 
var t
var j = 0
var p = Pic.length
 
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}
 
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

