function pasteFlash(movie,width,height,bgcolor){
	var d=document;
	var param = '';
	d.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
	d.writeln('		   <param name="allowScriptAccess" value="sameDomain" />');
	d.writeln('        <param name="movie" value="'+movie+'">');
	d.writeln('        <param name="quality" value="high">');
	if (bgcolor == 'transparent'){
		d.writeln('        <param name="wmode" value="transparent">');
		param = 'wmode="transparent"';
	}else if (bgcolor != ''){
		d.writeln('        <param name="BGCOLOR" value="'+bgcolor+'">');
		param = 'bgcolor="'+bgcolor+'"';
	}else{
		param = '';
	}
	d.writeln('<embed src="'+movie+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" '+param+'></embed>');
	d.writeln('</object>');
}

var divAppear = 'rolling_pin';
var appearValue = 0;

function makeItAppear(){
	appearValue +=5;		
	var obj = document.getElementById(divAppear);
	setChildrenOpacity(obj,appearValue);
	if (obj.style.display == 'none'){
		obj.style.backgroundImage = "url(images/ve_rollingpin.gif)";
		obj.style.display = 'block';
	}
	obj.style.filter = "alpha(opacity="+appearValue+")";
	obj.style.MozOpacity = appearValue + '%';
	obj.style.opacity = appearValue;	
	if (appearValue < 100){
		setTimeout('makeItAppear()',200);
	}
}

function setChildrenOpacity(obj,opacityValue){
	if (obj.childNodes){
		for (var i=0; i < obj.childNodes.length ; i++){
			if (obj.childNodes[i].style){
				obj.childNodes[i].style.filter = "alpha(opacity="+opacityValue+")";
				obj.childNodes[i].style.MozOpacity = opacityValue + '%';
				obj.childNodes[i].style.opacity = opacityValue;			
				if (obj.childNodes[i].childNodes && obj.childNodes[i].childNodes.length > 0){
					setChildrenOpacity(obj.childNodes[i],opacityValue);
				}
			}
		}
	}
}

//setTimeout('makeItAppear()',1000);

function moveDivVertically()
{
  moveDivRounds++;
  // get the stylesheet
  //
  var theDiv = document.getElementById(divAppear);
  if (! theDiv){   
   if (moveDivRounds < 8)
	   the_timeout = setTimeout('moveDiv();',500);   
   else
		alert("Cannot get DIV with ID = " + divAppear);   
  }else{
   var the_style = theDiv.style;
   if (the_style){
   	if (! isMoving){
   		the_style.backgroundImage = "url(images/ve_rollingpin.gif)";
   		if (document.layers){
	   		the_style.left = screen.width - parseInt(the_style.width) - 20; 
	   	}else{
	   		the_style.left = (screen.width - parseInt(the_style.width) - 20) + 'px'; 	   	
	   	}
   	}
   	isMoving=1;
    // get the current coordinate and add 5
    //
    var current_top = parseInt(the_style.top);
    var new_top = current_top + 5;

    // set the left property of the DIV, add px at the
    // end unless this is NN4
    //
    if (document.layers) 
    {
      the_style.top = new_top;
    }
    else 
    {  
      the_style.top = new_top + "px";
    }
    
    // if we haven't gone to far, call moveDiv() again in a bit
    // 
    if (new_top < 2)
    {
      the_timeout = setTimeout('moveDiv();',10);
    }
   }else{
  	alert("error getting style object");
   }
  }
}

