if(isiPad){
	
	/**
	 * Event.simulate(@element, eventName[, options]) -> Element
	 * 
	 * - @element: element to fire event on
	 * - eventName: name of event to fire (only MouseEvents and HTMLEvents interfaces are supported)
	 * - options: optional object to fine-tune event properties - pointerX, pointerY, ctrlKey, etc.
	 *
	 *    $('foo').simulate('click'); // => fires "click" event on an element with id=foo
	 *
	 **/
	(function(){

	  var eventMatchers = {
	    'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
	    'MouseEvents': /^(?:click|mouse(?:down|up|over|move|out))$/
	  }
	  var defaultOptions = {
	    pointerX: 0,
	    pointerY: 0,
	    button: 0,
	    ctrlKey: false,
	    altKey: false,
	    shiftKey: false,
	    metaKey: false,
	    bubbles: true,
	    cancelable: true
	  }

	  Event.simulate = function(element, eventName) {
	    var options = Object.extend(defaultOptions, arguments[2] || { });
	    var oEvent, eventType = null;

	    element = $(element);

	    for (var name in eventMatchers) {
	      if (eventMatchers[name].test(eventName)) { eventType = name; break; }
	    }

	    if (!eventType)
	      throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported');

	    if (document.createEvent) {
	      oEvent = document.createEvent(eventType);
	      if (eventType == 'HTMLEvents') {
	        oEvent.initEvent(eventName, options.bubbles, options.cancelable);
	      }
	      else {
	        oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView, 
	          options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
	          options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element);
	      }
	      element.dispatchEvent(oEvent);
	    }
	    else {
	      options.clientX = options.pointerX;
	      options.clientY = options.pointerY;
	      oEvent = Object.extend(document.createEventObject(), options);
	      element.fireEvent('on' + eventName, oEvent);
	    }
	    return element;
	  }

	  Element.addMethods({ simulate: Event.simulate });
	})()
	
    var iPad = "\n";
    var IPAD_CSS  = RESOURCES_PATH + "../pub/style/ipad-style_" + PAGE_LANG + ".css";
    iPad += '<link rel="stylesheet" type="text/css" media="screen,projection" href="' + IPAD_CSS  + '" />\n';
    document.write(iPad);

    document.observe('dom:loaded', function(){
		$$("div.right-content input.button").each(function(it){
			it.writeAttribute("src","../../../entry/cc/framework/pub/img/go_ipad.gif");
		});

	    $$('#breadcrumb a').each(function(item){
		    item.observe('mouseover', function(event){
			});
		    item.observe('mouseout', function(event){
			});
		});
		
		document.observe('mouseover', function(e){
			var loveipad = Event.element(e);
			if(loveipad.tagName === 'A'){
				loveipad.simulate('click');
			}
		});

	    document.observe('touchstart', function(e) {
		    if(Layer.current) {
				var element = $(Event.element(e));
				var layerNode = Layer.current.node;
				if(element === "javascript:void(0);") {
			    	Layer.closeCurrent();
				}
		    }
		});
	});
} 
