/**
 * 3D Rotate Tool JavaScript version

 * http://www.yofla.com/flash/3d-rotate/ 
 * 
 * License: All rights reserved for the function RotateToolManager
 *  Other classes in this file respect the copyright of their authors.
 *   
 * @author  Matus Laco matus@yofla.com
 * @since   06/2010
 * @updated 04/2011
 * @version 0.0.5 
 * 
 * version 0.0.5
 * + play/pause button added
 * + added mouse rotation browser support
 *
 * version 0.0.4
 * + small ie bug fix
 *
 * 
 * version 0.0.3
 * + support for configFileUrl parameter 
 * 
 * version 0.0.2
 * + added support for touch events
 * 
 */

// minified RotateToolManager, Rotate Tool Class
function RotateToolManager(){var f=[],y=typeof swfobject=="undefined"?!1:!0,r=!1,s=[],t=0;this.add=function(b){if(b.target){var e=b.target;f[e]?alert("Rotate Tool with target: "+e+" was already initialized!"):y?swfobject.hasFlashPlayerVersion("9.0.0")||(r?f[e]=new u(b):s[e]=b):(b=new u(b),f[e]=b)}};this.checkXMLLoad=function(b){f[b]&&f[b].isXMLLoaded==!1&&alert("Failed loading xml: "+f[b].getPathToConfig())};this.rotate=function(b){f[b].showNextImage()};this.domReady=function(){r=!0;for(var b in s)window.RotateTool.add(s[b])};
y&&swfobject.addDomLoadEvent(this.domReady);this.authorize=function(){var b=document.location.href,e=document.createElement("img");e.onload=function(){this.width==1?m(!0):m(!1)};e.onerror=function(){m(!0)};e.src="http://authorize.yoflaserver.com/js/authimg.php?d="+b+"&s=YOFLA&p=3DRTJS&v=0.0.5"};this.imagesLoaded=function(){var b=0,e;for(e in f)b++;t++;t==b&&this.authorize()};var m=function(b){for(var e in f)f[e].setAuthorized(b)},u=function(b){if(!b.path)b.path="";if(!b.target)return!1;if(!b.configFile)b.configFile=
"config.xml";if(!b.configFileUrl)b.configFileUrl=!1;if(!document.getElementById(b.target))return alert('Could not find element with id: "'+b.target+'"!'),!1;var e=b.target,g=document.getElementById(b.target),d,c,f=b.path,s=b.configFile,m=b.configFileUrl,y=new XMLLoader,C,r,t=new YLogger,u=[],h=0,D=0,L,E,k=1,v=!1,w,F,i,x,z,G=50,n=0,A=0,B=!0,l=!1,o,j;this.isXMLLoaded=!1;this.getPathToConfig=function(){return C};g.innerHTML="";if(f.length>0){var H=f.substr(f.length-1);H=="/"||H=="\\"||(f+="/")}else f=
"";C=m?m:f+s;b.targetWidth>0&&b.targetHeight>0?(o=b.targetWidth-2,j=b.targetHeight-2,g.style.width=b.targetWidth+"px",g.style.height=b.targetHeight+"px"):g.offsetWidth==0||g.offsetHeight==0?alert("RotateTool: Target size not defined!"):(o=g.offsetWidth,j=g.offsetHeight);this.setAuthorized=function(a){(L=a)||M()};this.onXMLLoaded=function(a){this.isXMLLoaded="true";clearTimeout(r);var b=a.getElementsByTagName("settings")[0];E=new N(b);b=a.getElementsByTagName("images")[0];a=b.getElementsByTagName("image");
x=h=a.length;if(h==0)a=b.getElementsByTagName("img"),x=h=a.length;h==0&&t.logPrefix("No Images loaded!",f+"@"+e);preloader=new Preloader(g);for(b=0;b<h;b++){var c=f+a[b].getAttribute("src"),d=document.createElement("img");u.push(d);d.onload=O;d.onerror=P;d.src=c;d.style.display="none"}};this.showNextImage=function(){i=F+k;i>=x&&(i=0);i<0&&(i=x-1);try{w.src=u[i].src}catch(a){}F=i};var O=function(){D++;preloader.update(Math.round(D/h*100));if(!w){w=this;var a=1,b=this.width,a=this.height,a=o/j<b/a?
o/b:j/a,b=Math.floor(this.height*a),a=Math.floor(this.width*a);this.height=b;this.width=a;this.style.position="absolute";j>b?(b=(j-b)/2,this.style.top=b+"px"):(b=(o-a)/2,this.style.left=b+"px");this.style.cursor="pointer";this.style.zIndex=10}if(h==D)g.appendChild(w),w.style.display="block",G=E.rotation.rotatePeriod*1E3/x,F=h-1,i=0,d=document.createElement("div"),d.style.width=o+"px",d.style.height=j+"px",d.style.background="white",d.style.opacity="0",d.style.filter="alpha(Opacity=0)",d.style.display=
"block",d.style.position="absolute",d.style.left="0px",d.style.top="0px",d.style.cursor="pointer",d.style.zIndex=90,g.appendChild(d),c=document.createElement("div"),c.innerHTML="Play",c.style.width="55px",c.style.height="25px",c.style.background="#EEEEEE",c.style.fontFamily="sans-serif",c.style.fontSize="14px",c.style.color="black",c.style.fontWeight="bolder",c.style.lineHeight="25px",c.style.textAlign="center",c.style.border="1px solid black",c.style.opacity="0.8",c.style.filter="alpha(Opacity=80)",
c.style.display="block",c.style.position="absolute",c.style.left="10px",c.style.top=j-35+"px",c.style.cursor="pointer",c.style.zIndex=95,g.appendChild(c),DeviceDetector.isTouchDevice?(d.addEventListener("touchstart",Q,!1),d.addEventListener("touchmove",R,!1),d.addEventListener("touchend",S,!1),d.addEventListener("touchcancel",T,!1),c.addEventListener("touchend",I,!1)):(YAHOO.util.Event.addListener(d,"mousedown",U),YAHOO.util.Event.addListener(c,"click",I)),c.style.visibility=E.userInterface.showTogglePlayButton==
"true"?"visible":"hidden",p(),preloader.destroy()},U=function(a){l=!0;B=v;q();if(!a)a=window.event;A=a.clientX;try{a.preventDefault()}catch(b){}YAHOO.util.Event.addListener(d,"mouseup",J);YAHOO.util.Event.addListener(d,"mousemove",K);try{a.stopEvent()}catch(c){}},J=function(a){l=!1;YAHOO.util.Event.removeListener(d,"mouseup",J);YAHOO.util.Event.removeListener(d,"mousemove",K);if(!a)a=window.event;A-a.clientX==0?B?q():p():p();try{a.stopEvent()}catch(b){}},K=function(a){if(l){if(!a)a=window.event;a=
a.clientX;a>n?(k=-1,eval('window.RotateTool.rotate("'+e+'")')):a<n?(k=1,eval('window.RotateTool.rotate("'+e+'")')):k=0;n=a}},Q=function(a){B=v;l=!0;q();A=a.targetTouches[0].screenX},S=function(a){a=A-a.changedTouches[0].screenX;l=!1;a==0?B?q():p():p()},R=function(a){a.preventDefault();a=a.targetTouches[0].screenX;a>n?(k=-1,eval('window.RotateTool.rotate("'+e+'")')):a<n?(k=1,eval('window.RotateTool.rotate("'+e+'")')):k=0;n=a},T=function(){l=!1;q()},I=function(a){try{a.preventDefault()}catch(b){}v?
q():p()},P=function(){t.logPrefix("Error loading image: "+this.src,f+"@"+e)},p=function(){z&&clearInterval(z);z=setInterval('RotateTool.rotate("'+e+'")',G);v=!0;c.innerHTML="Pause"},q=function(){clearInterval(z);v=!1;if(!l)c.innerHTML="Play"},M=function(){var a=document.createElement("div");a.innerHTML='<a id="yoflalink" title="3D Rotate Tool by YoFLA.com" target="_blank" style="display: block; width: 25px; background-color: red; -moz-border-radius: 10px; -webkit-border-radius: 10px; color: white; text-decoration: none;" href="http://www.yofla.com/flash/3d-rotate/">Y</a>';
a.style.position="absolute";a.style.fontSize="20px";a.style.fontWeight="bolder";a.style.fontFamily="verdana, arial, sans-serif";a.style.marginTop="3px";a.style.marginLeft="3px";a.style.top=0;a.style.left=0;a.style.zIndex=80;a.style.textAlign="center";a.onmouseover=function(){document.getElementById("yoflalink").style.color="yellow"};a.onmouseout=function(){document.getElementById("yoflalink").style.color="white"};g.appendChild(a)},N=function(a){var b={rotatePeriod:a.getElementsByTagName("rotation")[0].getAttribute("rotatePeriod")},
a={showTogglePlayButton:a.getElementsByTagName("userInterface")[0].getAttribute("showTogglePlayButton")};return{rotation:b,userInterface:a}};y.loadXML(C,{obj:this,fnc:this.onXMLLoaded},!0);r=setTimeout('RotateTool.checkXMLLoad("'+e+'")',5E3);g.style.position="relative"}};
var RotateTool = new RotateToolManager();


//--------------------------------------------------------------------------
// ROTATE TOOL RELATED "CLASSES" 
//--------------------------------------------------------------------------

/**
 *  Creates a prelaoder in the target div
 *
 */
var Preloader = function( targetDiv ){
	// create percentage
	var percentDiv = document.createElement('div');
	percentDiv.style.fontSize    = '32px';
	percentDiv.style.fontFamily  = 'verdana, arial, sans-serif';
	percentDiv.style.lineHeight  = targetDiv.offsetHeight - 30 + 'px';
	percentDiv.style.textAlign   = 'center';
	percentDiv.style.top    = '0px';
	percentDiv.style.left   = '0px';
	percentDiv.innerHTML = '&nbsp; 0%';
	
	targetDiv.appendChild(percentDiv);
	
	
	this.update = function(percent)	{
		var prefix = '';
		if(percent < 10) prefix = '&nbsp; ';
		percentDiv.innerHTML = prefix + percent + '%';
	}
	
	this.destroy = function(){
		targetDiv.removeChild(percentDiv);		
	}
}// end Preloader



//------------------------------------------------------------------------------
// OTHER LIBRARIES
//------------------------------------------------------------------------------

// addEvent, removeEvent function by John Resig:
// http://ejohn.org/projects/flexible-javascript-events/
function addEvent( obj, type, fn ) {

  if ( obj.attachEvent ) {
    obj['e'+type+fn] = fn;
    obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
    obj.attachEvent( 'on'+type, obj[type+fn] );
  } else
    obj.addEventListener( type, fn, false );
}

function removeEvent( obj, type, fn ) {
  if ( obj.detachEvent ) {
    obj.detachEvent( 'on'+type, obj[type+fn] );
    obj[type+fn] = null;
  } else
    obj.removeEventListener( type, fn, false );
}


/**
 * Very simple and basic Device detecting 
 * 
 */
var DeviceDetector = function(){

	var Device = {};
	Device.UA = navigator.userAgent;
	Device.Type = false;
	Device.Types = ["iPhone", "iPod", "iPad", "android"];

	for (var d = 0; d < Device.Types.length; d++) {
		var t = Device.Types[d];
		Device[t] = !!Device.UA.match(new RegExp(t, "i"));
		Device.Type = Device.Type || Device[t];
	}
	
	return { isTouchDevice : Device.Type ? true : false};
	
}();




/**
 * Class for displaying log messages.
 *
 * @author Matus Laco, matus@yofla.com
 * @version 0.0.1 Early Beta
 * @since  10/July/2010
 */
function YLogger ()
{
	var logdiv;   // reference to log div
	
	/**
	 * Creates the div for displaying log messages
	 */
	var createlogdiv = function()
	{
		// create logger div if it does not exists
		if(!document.getElementById('yoflalogdiv'))
		{
			logdiv = document.createElement('div');     
			logdiv.setAttribute('id','yoflalogdiv');
			logdiv.style.fontFamily = "sans-serif, verdana, arial";
			logdiv.style.fontSize = "10px";
			logdiv.style.width = "300px"; 
			logdiv.style.height = "300px"; 
			logdiv.style.left = "300px"; 
			logdiv.style.top = "300px";
			logdiv.style.overflow = "auto";
			logdiv.style.position = "absolute"; 
			logdiv.style.background = "#FFFF00"; 
			logdiv.style.border = "1px solid #FF0000"; 
			logdiv.style.zIndex = 1000; 
			logdiv.innerHTML = 'Test Div';
			//logdiv.style.display = 'none'; 
			document.body.appendChild(logdiv);
		};
	}
	
	
	/**
	 * Function to display a message in the log window.
	 *
	 * @acces public
	 * @param msg {String} The message to by displayed
	 * @param prefix {String} The prefis which is prepended before 
	 */
	this.log = function( msg )
	{
		createlogdiv();
		var prevtxt = logdiv.innerHTML.substr(0,900);
		logdiv.innerHTML = msg + '<br>' + prevtxt
		
	};
	
	
	/**
	 * Function to display a message in the log window with prefix
	 *
	 * @acces public
	 * @param msg {String} The message to by displayed
	 * @param prefix {String} The prefis which is prepended before 
	 */
	this.logPrefix = function(msg, prefix)
	{
		var tolog = prefix + ': ' + msg;
		this.log( tolog );
	}
	
}// enc class YLogger


// AJAXLib v. 1.0
// author: Jacek Karaszewski, http://www.karaszewski.com/tools/ajaxlib/
// licenced under Creative Commons Attribution 2.5 License
// ---
// wrapped into a namespace, added params for functionToCall
// by Matus Laco, www.yofla.com


/**
 * Class for loading .xml and parsing it to DOM. Start point is the
 * loadXML function. The parsed XML DOM object is passed as a parameter
 * to the functionToCall function
 *
 */
 
function XMLLoader(){
	
	
	// private vars
	var functionToCall;
	var stripWS;
	var nodesToDelete;
	var resultXML;
	var xmlRequestObj;
	
	// PUBLIC FUNCTIONS
	this.loadXML = function(url, callFunc, ignoreWhite)
	{
		
		functionToCall = callFunc;
		stripWS = ignoreWhite;
		xmlRequestObj = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")
		xmlRequestObj.onreadystatechange = proccessXML;
		xmlRequestObj.open("GET", url, true);
		xmlRequestObj.send("");		
	};
	
	// PRIVATE FUNCTIONS
	
	/**
	 *
	 */
	var proccessXML = function ()
	{
		if (xmlRequestObj.readyState == 4 && (xmlRequestObj.status == 200 || xmlRequestObj.status == 304)) {
			if(stripWS) {
				stripWhiteSpace(xmlRequestObj.responseXML);
			}
			resultXML = xmlRequestObj.responseXML;
			
			
			if ( typeof(functionToCall) == 'object' )
			{
				functionToCall.fnc.call(functionToCall.obj, resultXML);
			}	
			else if ( typeof(functionToCall) == 'function')
			{
				functionToCall( resultXML );
			}		
			else if ( typeof (functionToCall) == 'string')
			{
				eval(functionToCall);
			}
			else
			{
				alert('undefined type of functionToCall');
			}
		}
		else
		{
		}		
	};

	
	/**
	 *
	 */
	var stripWhiteSpace = function ( node )
	{
		nodesToDelete = Array();
		findWhiteSpace(node, 0);
		for(i=nodesToDelete.length-1;i>=0;i--) {
			nodeRef = nodesToDelete[i];
			nodeRef.parentNode.removeChild(nodeRef)
		}		
	};// end function stripWhiteSpace()
	
	
	/**
	 *
	 */
	var findWhiteSpace = function (node, nodeNo)
	{
		for (i=0; i<node.childNodes.length; i++) {
			if (node.childNodes[i].nodeType == 3 && is_ws(node.childNodes[i])) {
				nodesToDelete[nodesToDelete.length] = node.childNodes[i]
			}
			if (node.childNodes[i].hasChildNodes()) {
				findWhiteSpace(node.childNodes[i], i);
			}
		}
		node = node.parentNode;
		i = nodeNo;		
	};// end function findWhiteSpace
	
	
	/**
	 *
	 */
	var is_ws = function ( nod )
	{
		return !(/[^\t\n\r ]/.test(nod.data));
	};
}


//-----------------------------------------------------------------------------------------------------------
// YAHOO EVENT LIBRARY
//-----------------------------------------------------------------------------------------------------------


/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=YAHOO;for(c=(f[0]=="YAHOO")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]];}}return g;};YAHOO.log=function(d,a,c){var b=YAHOO.widget.Logger;if(b&&b.log){return b.log(d,a,c);}else{return false;}};YAHOO.register=function(a,f,e){var k=YAHOO.env.modules,c,j,h,g,d;if(!k[a]){k[a]={versions:[],builds:[]};}c=k[a];j=e.version;h=e.build;g=YAHOO.env.listeners;c.name=a;c.version=j;c.build=h;c.versions.push(j);c.builds.push(h);c.mainClass=f;for(d=0;d<g.length;d=d+1){g[d](c);}if(f){f.VERSION=j;f.BUILD=h;}else{YAHOO.log("mainClass is undefined for module "+a,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(a){return YAHOO.env.modules[a]||null;};YAHOO.env.parseUA=function(d){var e=function(i){var j=0;return parseFloat(i.replace(/\./g,function(){return(j++==1)?"":".";}));},h=navigator,g={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:h&&h.cajaVersion,secure:false,os:null},c=d||(navigator&&navigator.userAgent),f=window&&window.location,b=f&&f.href,a;g.secure=b&&(b.toLowerCase().indexOf("https")===0);if(c){if((/windows|win32/i).test(c)){g.os="windows";}else{if((/macintosh/i).test(c)){g.os="macintosh";}else{if((/rhino/i).test(c)){g.os="rhino";}}}if((/KHTML/).test(c)){g.webkit=1;}a=c.match(/AppleWebKit\/([^\s]*)/);if(a&&a[1]){g.webkit=e(a[1]);if(/ Mobile\//.test(c)){g.mobile="Apple";a=c.match(/OS ([^\s]*)/);if(a&&a[1]){a=e(a[1].replace("_","."));}g.ios=a;g.ipad=g.ipod=g.iphone=0;a=c.match(/iPad|iPod|iPhone/);if(a&&a[0]){g[a[0].toLowerCase()]=g.ios;}}else{a=c.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(a){g.mobile=a[0];}if(/webOS/.test(c)){g.mobile="WebOS";a=c.match(/webOS\/([^\s]*);/);if(a&&a[1]){g.webos=e(a[1]);}}if(/ Android/.test(c)){g.mobile="Android";a=c.match(/Android ([^\s]*);/);if(a&&a[1]){g.android=e(a[1]);}}}a=c.match(/Chrome\/([^\s]*)/);if(a&&a[1]){g.chrome=e(a[1]);}else{a=c.match(/AdobeAIR\/([^\s]*)/);if(a){g.air=a[0];}}}if(!g.webkit){a=c.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);a=c.match(/Version\/([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);}a=c.match(/Opera Mini[^;]*/);if(a){g.mobile=a[0];}}else{a=c.match(/MSIE\s([^;]*)/);if(a&&a[1]){g.ie=e(a[1]);}else{a=c.match(/Gecko\/([^\s]*)/);if(a){g.gecko=1;a=c.match(/rv:([^\s\)]*)/);if(a&&a[1]){g.gecko=e(a[1]);}}}}}}return g;};YAHOO.env.ua=YAHOO.env.parseUA();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var b=YAHOO_config.listener,a=YAHOO.env.listeners,d=true,c;if(b){for(c=0;c<a.length;c++){if(a[c]==b){d=false;break;}}if(d){a.push(b);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var f=YAHOO.lang,a=Object.prototype,c="[object Array]",h="[object Function]",i="[object Object]",b=[],g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},d=["toString","valueOf"],e={isArray:function(j){return a.toString.apply(j)===c;},isBoolean:function(j){return typeof j==="boolean";},isFunction:function(j){return(typeof j==="function")||a.toString.apply(j)===h;},isNull:function(j){return j===null;},isNumber:function(j){return typeof j==="number"&&isFinite(j);},isObject:function(j){return(j&&(typeof j==="object"||f.isFunction(j)))||false;},isString:function(j){return typeof j==="string";},isUndefined:function(j){return typeof j==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(l,k){var j,n,m;for(j=0;j<d.length;j=j+1){n=d[j];m=k[n];if(f.isFunction(m)&&m!=a[n]){l[n]=m;}}}:function(){},escapeHTML:function(j){return j.replace(/[&<>"'\/`]/g,function(k){return g[k];});},extend:function(m,n,l){if(!n||!m){throw new Error("extend failed, please check that "+"all dependencies are included.");}var k=function(){},j;k.prototype=n.prototype;m.prototype=new k();m.prototype.constructor=m;m.superclass=n.prototype;if(n.prototype.constructor==a.constructor){n.prototype.constructor=n;}if(l){for(j in l){if(f.hasOwnProperty(l,j)){m.prototype[j]=l[j];}}f._IEEnumFix(m.prototype,l);}},augmentObject:function(n,m){if(!m||!n){throw new Error("Absorb failed, verify dependencies.");}var j=arguments,l,o,k=j[2];if(k&&k!==true){for(l=2;l<j.length;l=l+1){n[j[l]]=m[j[l]];}}else{for(o in m){if(k||!(o in n)){n[o]=m[o];}}f._IEEnumFix(n,m);}return n;},augmentProto:function(m,l){if(!l||!m){throw new Error("Augment failed, verify dependencies.");}var j=[m.prototype,l.prototype],k;for(k=2;k<arguments.length;k=k+1){j.push(arguments[k]);}f.augmentObject.apply(this,j);return m;},dump:function(j,p){var l,n,r=[],t="{...}",k="f(){...}",q=", ",m=" => ";if(!f.isObject(j)){return j+"";}else{if(j instanceof Date||("nodeType" in j&&"tagName" in j)){return j;}else{if(f.isFunction(j)){return k;}}}p=(f.isNumber(p))?p:3;if(f.isArray(j)){r.push("[");for(l=0,n=j.length;l<n;l=l+1){if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}if(r.length>1){r.pop();}r.push("]");}else{r.push("{");for(l in j){if(f.hasOwnProperty(j,l)){r.push(l+m);if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}}if(r.length>1){r.pop();}r.push("}");}return r.join("");},substitute:function(x,y,E,l){var D,C,B,G,t,u,F=[],p,z=x.length,A="dump",r=" ",q="{",m="}",n,w;for(;;){D=x.lastIndexOf(q,z);if(D<0){break;}C=x.indexOf(m,D);if(D+1>C){break;}p=x.substring(D+1,C);G=p;u=null;B=G.indexOf(r);if(B>-1){u=G.substring(B+1);G=G.substring(0,B);}t=y[G];if(E){t=E(G,t,u);}if(f.isObject(t)){if(f.isArray(t)){t=f.dump(t,parseInt(u,10));}else{u=u||"";n=u.indexOf(A);if(n>-1){u=u.substring(4);}w=t.toString();if(w===i||n>-1){t=f.dump(t,parseInt(u,10));}else{t=w;}}}else{if(!f.isString(t)&&!f.isNumber(t)){t="~-"+F.length+"-~";F[F.length]=p;}}x=x.substring(0,D)+t+x.substring(C+1);if(l===false){z=D-1;}}for(D=F.length-1;D>=0;D=D-1){x=x.replace(new RegExp("~-"+D+"-~"),"{"+F[D]+"}","g");}return x;},trim:function(j){try{return j.replace(/^\s+|\s+$/g,"");}catch(k){return j;
}},merge:function(){var n={},k=arguments,j=k.length,m;for(m=0;m<j;m=m+1){f.augmentObject(n,k[m],true);}return n;},later:function(t,k,u,n,p){t=t||0;k=k||{};var l=u,s=n,q,j;if(f.isString(u)){l=k[u];}if(!l){throw new TypeError("method undefined");}if(!f.isUndefined(n)&&!f.isArray(s)){s=[n];}q=function(){l.apply(k,s||b);};j=(p)?setInterval(q,t):setTimeout(q,t);return{interval:p,cancel:function(){if(this.interval){clearInterval(j);}else{clearTimeout(j);}}};},isValue:function(j){return(f.isObject(j)||f.isString(j)||f.isNumber(j)||f.isBoolean(j));}};f.hasOwnProperty=(a.hasOwnProperty)?function(j,k){return j&&j.hasOwnProperty&&j.hasOwnProperty(k);}:function(j,k){return !f.isUndefined(j[k])&&j.constructor.prototype[k]!==j[k];};e.augmentObject(f,e,true);YAHOO.util.Lang=f;f.augment=f.augmentProto;YAHOO.augment=f.augmentProto;YAHOO.extend=f.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
YAHOO.util.CustomEvent=function(d,c,b,a,e){this.type=d;this.scope=c||window;this.silent=b;this.fireOnce=e;this.fired=false;this.firedWith=null;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var f="_YUICEOnSubscribe";if(d!==f){this.subscribeEvent=new YAHOO.util.CustomEvent(f,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(b,c,d){if(!b){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(b,c,d);}var a=new YAHOO.util.Subscriber(b,c,d);if(this.fireOnce&&this.fired){this.notify(a,this.firedWith);}else{this.subscribers.push(a);}},unsubscribe:function(d,f){if(!d){return this.unsubscribeAll();}var e=false;for(var b=0,a=this.subscribers.length;b<a;++b){var c=this.subscribers[b];if(c&&c.contains(d,f)){this._delete(b);e=true;}}return e;},fire:function(){this.lastError=null;var h=[],a=this.subscribers.length;var d=[].slice.call(arguments,0),c=true,f,b=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=d;}}this.fired=true;if(!a&&this.silent){return true;}if(!this.silent){}var e=this.subscribers.slice();for(f=0;f<a;++f){var g=e[f];if(!g||!g.fn){b=true;}else{c=this.notify(g,d);if(false===c){if(!this.silent){}break;}}}return(c!==false);},notify:function(g,c){var b,i=null,f=g.getScope(this.scope),a=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(c.length>0){i=c[0];}try{b=g.fn.call(f,i,g.obj);}catch(h){this.lastError=h;if(a){throw h;}}}else{try{b=g.fn.call(f,this.type,c,g.obj);}catch(d){this.lastError=d;if(a){throw d;}}}return b;},unsubscribeAll:function(){var a=this.subscribers.length,b;for(b=a-1;b>-1;b--){this._delete(b);}this.subscribers=[];return a;},_delete:function(a){var b=this.subscribers[a];if(b){delete b.fn;delete b.obj;}this.subscribers.splice(a,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(a,b,c){this.fn=a;this.obj=YAHOO.lang.isUndefined(b)?null:b;this.overrideContext=c;};YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return a;};YAHOO.util.Subscriber.prototype.contains=function(a,b){if(b){return(this.fn==a&&this.obj==b);}else{return(this.fn==a);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var g=false,h=[],j=[],a=0,e=[],b=0,c={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},d=YAHOO.env.ua.ie,f="focusin",i="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:d,_interval:null,_dri:null,_specialTypes:{focusin:(d?"focusin":"focus"),focusout:(d?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(q,m,o,p,n){var k=(YAHOO.lang.isString(q))?[q]:q;for(var l=0;l<k.length;l=l+1){e.push({id:k[l],fn:m,obj:o,overrideContext:p,checkReady:n});}a=this.POLL_RETRYS;this.startInterval();},onContentReady:function(n,k,l,m){this.onAvailable(n,k,l,m,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(m,k,v,p,t,y){if(!v||!v.call){return false;}if(this._isValidCollection(m)){var w=true;for(var q=0,s=m.length;q<s;++q){w=this.on(m[q],k,v,p,t)&&w;}return w;}else{if(YAHOO.lang.isString(m)){var o=this.getEl(m);if(o){m=o;}else{this.onAvailable(m,function(){YAHOO.util.Event._addListener(m,k,v,p,t,y);});return true;}}}if(!m){return false;}if("unload"==k&&p!==this){j[j.length]=[m,k,v,p,t];return true;}var l=m;if(t){if(t===true){l=p;}else{l=t;}}var n=function(z){return v.call(l,YAHOO.util.Event.getEvent(z,m),p);};var x=[m,k,v,n,l,p,t,y];var r=h.length;h[r]=x;try{this._simpleAdd(m,k,n,y);}catch(u){this.lastError=u;this.removeListener(m,k,v);return false;}return true;},_getType:function(k){return this._specialTypes[k]||k;},addListener:function(m,p,l,n,o){var k=((p==f||p==i)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(m,this._getType(p),l,n,o,k);},addFocusListener:function(l,k,m,n){return this.on(l,f,k,m,n);},removeFocusListener:function(l,k){return this.removeListener(l,f,k);},addBlurListener:function(l,k,m,n){return this.on(l,i,k,m,n);},removeBlurListener:function(l,k){return this.removeListener(l,i,k);},removeListener:function(l,k,r){var m,p,u;k=this._getType(k);if(typeof l=="string"){l=this.getEl(l);}else{if(this._isValidCollection(l)){var s=true;for(m=l.length-1;m>-1;m--){s=(this.removeListener(l[m],k,r)&&s);}return s;}}if(!r||!r.call){return this.purgeElement(l,false,k);}if("unload"==k){for(m=j.length-1;m>-1;m--){u=j[m];if(u&&u[0]==l&&u[1]==k&&u[2]==r){j.splice(m,1);return true;}}return false;}var n=null;var o=arguments[3];if("undefined"===typeof o){o=this._getCacheIndex(h,l,k,r);}if(o>=0){n=h[o];}if(!l||!n){return false;}var t=n[this.CAPTURE]===true?true:false;try{this._simpleRemove(l,k,n[this.WFN],t);}catch(q){this.lastError=q;return false;}delete h[o][this.WFN];delete h[o][this.FN];h.splice(o,1);return true;},getTarget:function(m,l){var k=m.target||m.srcElement;return this.resolveTextNode(k);},resolveTextNode:function(l){try{if(l&&3==l.nodeType){return l.parentNode;}}catch(k){return null;}return l;},getPageX:function(l){var k=l.pageX;if(!k&&0!==k){k=l.clientX||0;if(this.isIE){k+=this._getScrollLeft();}}return k;},getPageY:function(k){var l=k.pageY;if(!l&&0!==l){l=k.clientY||0;if(this.isIE){l+=this._getScrollTop();}}return l;},getXY:function(k){return[this.getPageX(k),this.getPageY(k)];},getRelatedTarget:function(l){var k=l.relatedTarget;
if(!k){if(l.type=="mouseout"){k=l.toElement;}else{if(l.type=="mouseover"){k=l.fromElement;}}}return this.resolveTextNode(k);},getTime:function(m){if(!m.time){var l=new Date().getTime();try{m.time=l;}catch(k){this.lastError=k;return l;}}return m.time;},stopEvent:function(k){this.stopPropagation(k);this.preventDefault(k);},stopPropagation:function(k){if(k.stopPropagation){k.stopPropagation();}else{k.cancelBubble=true;}},preventDefault:function(k){if(k.preventDefault){k.preventDefault();}else{k.returnValue=false;}},getEvent:function(m,k){var l=m||window.event;if(!l){var n=this.getEvent.caller;while(n){l=n.arguments[0];if(l&&Event==l.constructor){break;}n=n.caller;}}return l;},getCharCode:function(l){var k=l.keyCode||l.charCode||0;if(YAHOO.env.ua.webkit&&(k in c)){k=c[k];}return k;},_getCacheIndex:function(n,q,r,p){for(var o=0,m=n.length;o<m;o=o+1){var k=n[o];if(k&&k[this.FN]==p&&k[this.EL]==q&&k[this.TYPE]==r){return o;}}return -1;},generateId:function(k){var l=k.id;if(!l){l="yuievtautoid-"+b;++b;k.id=l;}return l;},_isValidCollection:function(l){try{return(l&&typeof l!=="string"&&l.length&&!l.tagName&&!l.alert&&typeof l[0]!=="undefined");}catch(k){return false;}},elCache:{},getEl:function(k){return(typeof k==="string")?document.getElementById(k):k;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(l){if(!g){g=true;var k=YAHOO.util.Event;k._ready();k._tryPreloadAttach();}},_ready:function(l){var k=YAHOO.util.Event;if(!k.DOMReady){k.DOMReady=true;k.DOMReadyEvent.fire();k._simpleRemove(document,"DOMContentLoaded",k._ready);}},_tryPreloadAttach:function(){if(e.length===0){a=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var q=!g;if(!q){q=(a>0&&e.length>0);}var p=[];var r=function(t,u){var s=t;if(u.overrideContext){if(u.overrideContext===true){s=u.obj;}else{s=u.overrideContext;}}u.fn.call(s,u.obj);};var l,k,o,n,m=[];for(l=0,k=e.length;l<k;l=l+1){o=e[l];if(o){n=this.getEl(o.id);if(n){if(o.checkReady){if(g||n.nextSibling||!q){m.push(o);e[l]=null;}}else{r(n,o);e[l]=null;}}else{p.push(o);}}}for(l=0,k=m.length;l<k;l=l+1){o=m[l];r(this.getEl(o.id),o);}a--;if(q){for(l=e.length-1;l>-1;l--){o=e[l];if(!o||!o.id){e.splice(l,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(p,q,s){var n=(YAHOO.lang.isString(p))?this.getEl(p):p;var r=this.getListeners(n,s),o,k;if(r){for(o=r.length-1;o>-1;o--){var m=r[o];this.removeListener(n,m.type,m.fn);}}if(q&&n&&n.childNodes){for(o=0,k=n.childNodes.length;o<k;++o){this.purgeElement(n.childNodes[o],q,s);}}},getListeners:function(n,k){var q=[],m;if(!k){m=[h,j];}else{if(k==="unload"){m=[j];}else{k=this._getType(k);m=[h];}}var s=(YAHOO.lang.isString(n))?this.getEl(n):n;for(var p=0;p<m.length;p=p+1){var u=m[p];if(u){for(var r=0,t=u.length;r<t;++r){var o=u[r];if(o&&o[this.EL]===s&&(!k||k===o[this.TYPE])){q.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.OVERRIDE],scope:o[this.ADJ_SCOPE],index:r});}}}}return(q.length)?q:null;},_unload:function(s){var m=YAHOO.util.Event,p,o,n,r,q,t=j.slice(),k;for(p=0,r=j.length;p<r;++p){n=t[p];if(n){try{k=window;if(n[m.ADJ_SCOPE]){if(n[m.ADJ_SCOPE]===true){k=n[m.UNLOAD_OBJ];}else{k=n[m.ADJ_SCOPE];}}n[m.FN].call(k,m.getEvent(s,n[m.EL]),n[m.UNLOAD_OBJ]);}catch(w){}t[p]=null;}}n=null;k=null;j=null;if(h){for(o=h.length-1;o>-1;o--){n=h[o];if(n){try{m.removeListener(n[m.EL],n[m.TYPE],n[m.FN],o);}catch(v){}}}n=null;}try{m._simpleRemove(window,"unload",m._unload);m._simpleRemove(window,"load",m._load);}catch(u){}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var k=document.documentElement,l=document.body;if(k&&(k.scrollTop||k.scrollLeft)){return[k.scrollTop,k.scrollLeft];}else{if(l){return[l.scrollTop,l.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(m,n,l,k){m.addEventListener(n,l,(k));};}else{if(window.attachEvent){return function(m,n,l,k){m.attachEvent("on"+n,l);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(m,n,l,k){m.removeEventListener(n,l,(k));};}else{if(window.detachEvent){return function(l,m,k){l.detachEvent("on"+m,k);};}else{return function(){};}}}()};}();(function(){var a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;
/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
if(a.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;a._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null;}catch(c){}},a.POLL_INTERVAL);}}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready();}},a.POLL_INTERVAL);}else{a._simpleAdd(document,"DOMContentLoaded",a._ready);}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,c,f,e){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[a];if(d){d.subscribe(c,f,e);}else{this.__yui_subscribers=this.__yui_subscribers||{};var b=this.__yui_subscribers;if(!b[a]){b[a]=[];}b[a].push({fn:c,obj:f,overrideContext:e});}},unsubscribe:function(c,e,g){this.__yui_events=this.__yui_events||{};var a=this.__yui_events;if(c){var f=a[c];if(f){return f.unsubscribe(e,g);}}else{var b=true;for(var d in a){if(YAHOO.lang.hasOwnProperty(a,d)){b=b&&a[d].unsubscribe(e,g);
}}return b;}return false;},unsubscribeAll:function(a){return this.unsubscribe(a);},createEvent:function(b,g){this.__yui_events=this.__yui_events||{};var e=g||{},d=this.__yui_events,f;if(d[b]){}else{f=new YAHOO.util.CustomEvent(b,e.scope||this,e.silent,YAHOO.util.CustomEvent.FLAT,e.fireOnce);d[b]=f;if(e.onSubscribeCallback){f.subscribeEvent.subscribe(e.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var a=this.__yui_subscribers[b];if(a){for(var c=0;c<a.length;++c){f.subscribe(a[c].fn,a[c].obj,a[c].overrideContext);}}}return d[b];},fireEvent:function(b){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[b];if(!d){return null;}var a=[];for(var c=1;c<arguments.length;++c){a.push(arguments[c]);}return d.fire.apply(d,a);},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true;}}return false;}};(function(){var a=YAHOO.util.Event,c=YAHOO.lang;YAHOO.util.KeyListener=function(d,i,e,f){if(!d){}else{if(!i){}else{if(!e){}}}if(!f){f=YAHOO.util.KeyListener.KEYDOWN;}var g=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(c.isString(d)){d=document.getElementById(d);}if(c.isFunction(e)){g.subscribe(e);}else{g.subscribe(e.fn,e.scope,e.correctScope);}function h(o,n){if(!i.shift){i.shift=false;}if(!i.alt){i.alt=false;}if(!i.ctrl){i.ctrl=false;}if(o.shiftKey==i.shift&&o.altKey==i.alt&&o.ctrlKey==i.ctrl){var j,m=i.keys,l;if(YAHOO.lang.isArray(m)){for(var k=0;k<m.length;k++){j=m[k];l=a.getCharCode(o);if(j==l){g.fire(l,o);break;}}}else{l=a.getCharCode(o);if(m==l){g.fire(l,o);}}}}this.enable=function(){if(!this.enabled){a.on(d,f,h);this.enabledEvent.fire(i);}this.enabled=true;};this.disable=function(){if(this.enabled){a.removeListener(d,f,h);this.disabledEvent.fire(i);}this.enabled=false;};this.toString=function(){return"KeyListener ["+i.keys+"] "+d.tagName+(d.id?"["+d.id+"]":"");};};var b=YAHOO.util.KeyListener;b.KEYDOWN="keydown";b.KEYUP="keyup";b.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.9.0",build:"2800"});





// end of file rotatetool.js

