window.addEvent('domready', function()
{
	
	container = $('dialog')

      function isIE()
      {
      return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
      }
    
    if (isIE() == false) {
    dotheTalking();
    }

	function dotheTalking() {
	
	if (container.childNodes.length > 0) {
		for (var i=0; i<container.childNodes.length; i++) {
			var child = container.childNodes[i];
			if (child.nodeName == "DIV") {
			
				saySomething($(child.id), i * 1000);				
			}	
		}
	}
	
	settings = {
          tl: { radius: 5 },
          tr: { radius: 5 },
          bl: { radius: 5 },
          br: { radius: 5 },
          antiAlias: true,
          autoPad: false,
          validTags: ["div"]
    }
	
	myBoxObject = new curvyCorners(settings, "word");
	myBoxObject.applyCornersToAll();
	
	function saySomething (myTarg, myDelay) {
		
		if (myTarg.align == "bottomleft") {
	
		var offsetx = $('products').getPosition()["x"]
		var product1x = $(myTarg.title).getPosition()["x"] - offsetx
		var product1y = $(myTarg.title).getPosition()["y"] + ($(myTarg.title).getSize()["size"]["y"] * .65)

		} else if (myTarg.align == "bottomcenter") {

		var offsetx = $('products').getPosition()["x"]
		var product1x = $(myTarg.title).getPosition()["x"] - offsetx - ($(myTarg).getSize()["size"]["x"]/2) + ($(myTarg.title).getSize()["size"]["x"]/2) - 5
		var product1y = $(myTarg.title).getPosition()["y"] + ($(myTarg.title).getSize()["size"]["y"] * .65)	
		
		} else if (myTarg.align == "topcenter") {

		var offsetx = $('products').getPosition()["x"]
		var product1x = $(myTarg.title).getPosition()["x"] - offsetx - ($(myTarg).getSize()["size"]["x"]/2) + ($(myTarg.title).getSize()["size"]["x"]/2) - 5
		var product1y = $(myTarg.title).getPosition()["y"] - $(myTarg).getSize()["size"]["y"] + 27
		
		} else if (myTarg.align == "topright") {

		var offsetx = $('products').getPosition()["x"]
		var product1x = $(myTarg.title).getPosition()["x"] - offsetx + ($(myTarg.title).getSize()["size"]["x"] * .5)
		var product1y = $(myTarg.title).getPosition()["y"] + 5	
		
		} else if (myTarg.align == "topleft") {

		var offsetx = $('products').getPosition()["x"]
		var product1x = $(myTarg.title).getPosition()["x"] - offsetx 
		var product1y = $(myTarg.title).getPosition()["y"] + ($(myTarg.title).getSize()["size"]["y"] * .25)		
		
		} else {

		var offsetx = $('products').getPosition()["x"]
		var product1x = $(myTarg.title).getPosition()["x"] - offsetx
		var product1y = $(myTarg.title).getPosition()["y"] + ($(myTarg.title).getSize()["size"]["y"] * .75)	
		
		}				
				
		var fx = myTarg.effects({duration: 1000, transition: Fx.Transitions.Expo.easeInOut});
		
		myTarg.style.opacity = .0;		
		
		fx.start({
			'opacity': .0,
			'top': product1y - 10,
			'margin-left': product1x
		}).chain(function() {
			this.start.delay(myDelay, this, {
				'opacity': 1,
				'top': product1y,
				'margin-left':product1x
			});
		}).chain(function() {
			timeLength = (myTarg.innerHTML.length -9496) * 17
			if (timeLength < 90) { timeLength = 750 }
			this.start.delay(750, this, {
				'opacity': .0});
		}).chain(function() {
			this.start.delay(1000, this, {
				'width': 1,
				'height': 1,
				'top': -100,
				'display' : "none"
			});
		}).chain(function() {
		});	
		
		}
	
	}
}
);