// JavaScript Document
var pic = ['java0','java1','java2'];
var current = 0;
var next = 1;
var old = pic.length - 1;
function attachFlash(){
var id = document.getElementById('flashBox');
var but = document.getElementById('flashButton');
id.style.display = '';
but.style.display = 'none';
}
function removeFlash(){
var id = document.getElementById('flashBox');
var but = document.getElementById('flashButton');
but.style.display = '';
id.style.display = 'none';
};
function change(){
	$('#'+pic[current]).fadeIn('slow', function() {
        // Animation complete
     });
	 $('#'+pic[old]).fadeOut('slow', function() {
        // Animation complete
     });
	if ((current + 1) == pic.length){
		next = 0;
	}else{
		next = current+1;
	}
	old = current;
	current = next;
	setTimeout('change()',7000);
	
};
function grow(){
	if (mo){
	var id = document.getElementById('marketing');
	var check = false;
	var h = id.style.height.replace(/px/gi,'');
	var w = id.style.width.replace(/px/gi,'');
	var m = id.style.marginLeft.replace(/px/gi,'');
	var t = id.style.marginTop.replace(/px/gi,'');

	h = Number(h);
	w = Number(w);
	m = Number(m);
	t = Number(t);
	if (h < 600){
		h += ((600-h)/10);
		id.style.height = h+'px';
		check = true;
	}
	if (w < 950){
		w += ((950-w)/10);
		id.style.width = w+'px';
		check = true;
	}
	if (m > -475){
		m -= ((m+475)/10);
		id.style.marginLeft = m+'px';
		check = true;
	}
	if (t > 140){
		t -= ((t-140)/10);
		id.style.marginTop = t+'px';
		check = true;
	}
	if (check){
		setTimeout('grow()',30);
	}
	}

};
function shrink(){
	if (mo == false){
	var id = document.getElementById('marketing');
	var check = false;
	var h = id.style.height.replace(/px/gi,'');
	var w = id.style.width.replace(/px/gi,'');
	var m = id.style.marginLeft.replace(/px/gi,'');
	var t = id.style.marginTop.replace(/px/gi,'');

	h = Number(h);
	w = Number(w);
	m = Number(m);
	t = Number(t);
	if (h > 140){
		h -= ((h-140)/10);
		id.style.height = h+'px';
		check = true;
	}
	if (w > 180){
		w -= ((w-180)/10);
		id.style.width = w+'px';
		check = true;
	}
	if (m < 285){
		m += ((285-m)/10);
		id.style.marginLeft = m+'px';
		check = true;
	}
	if (t < 490){
		t += ((490 - t)/10);
		id.style.marginTop = t+'px';
		check = true;
	}
	if (w < 182){
		removeFlash();
	}
	if (check){
		setTimeout('shrink()',30);
	}
	}

};
