if (typeof LinkyBank=="undefined")
{
	LinkyBank=
	{
		rurl:[],
		replaceUrl:function()
		{
			LinkyBank.Load.Domready(LinkyBank.Ureplace);
		},
		Ureplace:function()
		{
			var c=LinkyBank;
			var i,bd=document.getElementsByTagName("body"),l=bd.length;
			for (i=0;i<l;i++)
			{
				c.sear_href(bd[i]);
			}
		},	
		sear_href:function(el)
		{
			var c=LinkyBank,i,url;
			if(el.nodeType==1 && el.hasChildNodes)
			{
				for (i=0;i<el.childNodes.length;i++)
				{
					var elc=el.childNodes[i];
					if (elc.nodeType==1 && elc.hasChildNodes && elc.tagName && elc.tagName.search(/^a$/i)>-1)
					{
						c.rurl.push(elc);
						if (c.jtag(elc.href))
						{
							url=c.enurl(elc.href);
							elc.href=c.baseurl+url;
							if (typeof c.targetopt!="undefined")
							{
								var to=parseInt(c.targetopt,10);
								if(to==1)
								{
									elc.target="_blank";
								}
								else if(to==2)
								{
									elc.target="_self";
								}								
							}
						}
					}
					else if(elc.hasChildNodes)
					{
						c.sear_href(elc);
					}
				}
			}
		},	
		jtag:function(s)
		{
			var c=LinkyBank,reg;
			reg=RegExp("^\\s{0,}http:","i")
			if(s.search(reg)>-1)
			{
				if(typeof c.exclude!="undefined")
				{
					for(var x in c.exclude)
					{
						if(typeof c.exclude[x]=="string")
						{
							reg=RegExp(c.exclude[x],"i");
							if (s.search(reg)>-1)
							{
								return false;
							}
						}
					}
				}
			}
			else
			{
				return false;
			}
			return true;
		},
		enurl:function(s)
		{
			return encodeURIComponent(s);
		}
	};
}

(function()
{
	if(typeof(LinkyBank)=="undefined")
	{
		LinkyBank={};
	}
	var Yesup=LinkyBank;
	if(typeof(Yesup.browser)=="undefined")
	{
		var uA=window.navigator.userAgent,pl=navigator.platform,c=Yesup,Y=document;
    c.browser=
    {
    	isIE:/(msie)/i.test(uA),
      isOP:/(opera)/i.test(uA),
      isSA:/safari/i.test(uA),
      isFI:/firefox/i.test(uA),
      isMac:/mac/i.test(pl),
      isWin:/^Win32$/i.test(pl),
      isLin:/^Linux/i.test(pl),
      isGe:/(Gecko)/i.test(uA),
      isKM:/Chrome/i.test(uA),
      ver:parseFloat((uA.match( /.+(?:fox|ion|era|sie|ome)[\/: ]([\d.\d]+)/i ) || [])[1]),
      isS:(document.compatMode=="CSS1Compat")
    };
    var b=c.browser;
    if (b.isMac && b.isSA)
    {
    	b.isS=Y.doctype?true:false;         
    }
		if (Y.documentMode)
		{
			b.DM=Y.documentMode;
		}
		else
		{
			b.DM=0;
		}
    b.isIES=b.isIE&(!b.isS);		
	}
	if(typeof(Yesup.Load)=="undefined")
	{
		Yesup.Load=
		{
			isready:false,
			isonload:false,
			isbundle:false,
			dfuncs:[],
			lfuncs:[],
			Domready:function(fn)
			{				
				var Dr=Yesup.Load;
				if(typeof fn!="function")
				{
					return;
				}
				if(Dr.isready)
				{
					fn();
				}
				else
				{
					if(!Dr.isbundle)
					{
						Dr.check();
					}
					Dr.dfuncs.push(fn);					
				}
			},
			Onload:function(fn)
			{
				var Dr=Yesup.Load;
				if(typeof fn!="function")
				{
					return;
				}
				if(Dr.isonload)
				{
					fn();
				}
				else
				{
					Dr.lfuncs.push(fn);					
					if(typeof window.onload!="function")
					{
						if(typeof Dr.oldload=="undefined")
						{
							Dr.oldload=window.onload;
						}
						window.onload=function()
						{
							Dr.isonload=true;
							if(typeof Dr.oldload=="function")
							{
								Dr.oldload();
							}
							var l=Dr.lfuncs.length;
							for(var f=0;f<l;f++)
							{
								Dr.lfuncs[f]();
							}
							Dr.lfuncs=[];
						}
					}
				}
			},
			check:function()
			{
				var Dr=Yesup.Load,b=Yesup.browser;
				if(Dr.isready)
				{
					return;
				}
				else
				{
					Dr.isbundle=true;
   				if (document.addEventListener && !b.isSA)
   				{
   					document.addEventListener("DOMContentLoaded", Dr.doIt, false);
   				}else if(b.isIE)
   				{
   	   			/*@cc_on @*/
   	   			/*@if (@_win32)
   	   			document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");
   	   			var script =document.getElementById("__ie_onload");
   	   			script.onreadystatechange = function() 
   	   			{
   	      		if (this.readyState == "complete") 
   	      		{
   	         		Dr.doIt(); 
   	      		}
   	   			};
   	   			@end @*/
   				} else if (b.isSA) 
   				{
   					Dr.t = setInterval(function(){ if (/loaded|complete/.test(document.readyState)) { clearInterval(Dr.t);Dr.doIt();} }, 10);
   				} else
   				{
   					window.onload = init;  //for the other browser
   				}
   			}				
			},
			doIt:function()
			{
				var Dr=Yesup.Load,l=Dr.dfuncs.length;
				if(!Dr.isready) 
				{
					Dr.isready = true;
        	for(var f = 0; f < l; f++)
	       	{
						Dr.dfuncs[f]();
	        }
        	Dr.dfuncs = [];
				}
			}
		};
	}
})();

//LinkyBank.baseurl=;
//LinkyBank.targetopt=(0,1,2);
//LinkyBank.exclude=[];
//LinkyBank.replaceUrl();

