chevrolet_swf = null;
chevrolet_opened = false;
chevrolet_counter = 0;

var diffx=0;
var diffy=0;

function setDiff(xdiffx,xdiffy){
	diffx=xdiffx;
	diffy=xdiffy;
}

// Rollout action
function chevrolet_banner() 
{
	if (!chevrolet_opened) {
		
		var chevrolet_banner_div = document.getElementById('chevrolet_banner_div');
		var chevrolet_div = document.getElementById('chevrolet_div');
		arrPositions = findPos(chevrolet_banner_div);
		chevrolet_div.style.left = (arrPositions[0]+diffx)+"px";
		chevrolet_div.style.top =  (arrPositions[1]+diffy)+"px";
		
		if (document.all && false) {
			chevrolet_swf = document.getElementById("chevrolet");
			chevrolet_swf.TGotoFrame("/",0);
			//idval = setInterval(alert, 1000);
		} else {
			chevrolet_div.style.display = "";
		}
		
		
		//chevrolet_play_banner();
		chevrolet_hide_banner();

		
		if (chevrolet_swf != null) {
			chevrolet_swf_init();
		}
		
		chevrolet_counter++; 
	}
}

function chevrolet_play() {
	clearInterval(idval);
	document.getElementById('chevrolet_div').style.display = '';
	//chevrolet_banner();
}

/*function chevrolet_hide() {
	//clearInterval(idval);
	//document.getElementById('chevrolet_div').style.display = 'none';
	chevrolet_close();
}*/

// Hide the banner when the expandible is ready
function chevrolet_hide_banner() 
{
	var chevrolet_banner_div = document.getElementById('chevrolet_banner_div');
	chevrolet_banner_div.style.display = "none";
}



// Play banner after rollout
function chevrolet_play_banner() 
{
	var chevrolet_swf_banner = "";
	if (document.all) {
		chevrolet_swf_banner = document.getElementById("chevrolet_banner");
	}else{
		chevrolet_swf_banner = window.document.chevrolet_banner;
	}
	chevrolet_swf_banner.TGotoFrame("/",1);
}




// Expandible loaded, start animation
function chevrolet_swf_init() 
{
	if (document.all) 
	{
		chevrolet_swf = document.getElementById("chevrolet");
		chevrolet_hide_banner();
	}else{
		chevrolet_swf = window.document.chevrolet;
	}
	
	chevrolet_swf.TGotoFrame("/",0);
	chevrolet_opened = true;
}




// Close the expandible
function chevrolet_close() 
{
	var chevrolet_banner_div = document.getElementById('chevrolet_banner_div');
	var chevrolet_div = document.getElementById('chevrolet_div');
	
	chevrolet_banner_div.style.display = "";
	chevrolet_div.style.display = "none";
	
	chevrolet_opened = false;
}




// Find the position of the banner to set the floating expandible
function findPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
}