﻿
		var currentLocation = '';
		var specialLocation = false;

	function changeScript()
		{
			if(currentLocation!=location.hash)
				{
					currentLocation=location.hash;
					try { 
							insertScript('doc/'+location.hash.substr(1)+'.js');
						}
					catch(e)
						{
							
						}
					
					if(!specialLocation)
						try {
								functionMain();
								specialLocation=true;
							}
						catch(e)
							{
								
							}
				}

			setTimeout('javascript:changeScript();', 120);
		}

	function insertScript(URL)
		{
			var targetNode = document.createElement('div');
			document.body.appendChild(targetNode);
			try { 	
					var el = document.createElement('script');

//						el.innerHTML = script;
						el.type="text/javascript";
						el.src=URL+'?id='+(new Date())+' '+Math.random();

					targetNode.appendChild(el);
				} 
			catch (e) 
				{	
					var el = document.createElement('span'); targetNode.appendChild(el);
						el.innerHTML = '<br /><scr'+'ipt src="' + URL + '" type="text/javascript" defer="defer">'
			 		  /* + script */ + '</script' + '>';
				}
		}

	if (top!=self)
			{
				top.location=location;						
			}
		else
			{
				if(location.hash=='')
				   location.hash='Index';
				
				try { setTimeout('javascript:changeScript();', 120) } catch (e) {};
			}
	

