/*
 * @author: Naing Myo Aung
 * 
 */
var uagent;
var opsystem;
var IE4B = false;
var NS4B = false;
var NS6B = false;
var OP5B = false;
var AOLB = false;
var MsWinS = false;
var MacOS = false;
var ULinS = false;
var majorver;
majorver = parseInt(navigator.appVersion);
if (majorver>=4) {
	uagent = window.navigator.userAgent.toLowerCase();
	opsystem = window.navigator.platform.toLowerCase();
}
if (opsystem.indexOf('win') != -1) {
	MsWinS = true;
} else if (opsystem.indexOf('mac') != -1) {
	MacOS = true;
} else if (opsystem.indexOf('unix') != -1 || opsystem.indexOf('linux') != -1 || opsystem.indexOf('sun') != -1) {
	ULinS = true;
}
NS4B = (document.layers);
IE4B = (document.all);
NS6B = ((document.getElementById) && (!IE4B)) ? true : false;
OP5B = (uagent.indexOf('Opera') != -1) ? true : false;
if ((uagent.indexOf('aol')) != -1) {
	AOLB = true;
}
IE5 = false;
IE4 = false;
IEold = false;
IE5 = (uagent.indexOf('msie 5.0') != -1) ? true : false;
IE4 = (uagent.indexOf('msie 4') != -1) ? true : false;
if (IE5 || IE4) {
	IEold = true;
}

function initr() {
	imgdon = 1;
	if (IE4B) {
		if ((uagent.indexOf('msie 6.') != -1) || (uagent.indexOf('msie 5.5') != -1)) {
			setTimeout('dxtrans()', 3000);
		}
	} else if (NS6B) {
		cdobj = document.getElementById('trans');
		setTimeout('slides()', 3000);
	}
}
function dxtrans() {
	if (IEold != true) {
		cimg.filters[0].apply();
	}
	cimg.src = eval("imgp"+imgdon+".src");
	if (IEold != true) {
		cimg.filters[0].play();
	}
	imgdon++;
	if (imgdon>ImgCount) {
		imgdon = 1;
	}
	setTimeout('dxtrans()', 4000);
}
function slides() {
	document.slideimg.src = eval("imgp"+(imgdon)).src;
	imgdon++;
	if(imgdon>ImgCount) imgdon=1;
	setTimeout('slides()', 3000);
}
function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}

addOnloadEvent(initr);