Website = function(responseGot)
			{
                this.initialize = function()
				{
					this.host='http://'+document.location.host+'/';
                    this.navi = null;
					this.html=new Object;
                    this.html.contentTag = Util.createTag('div', 'id=content', null);
					this.fileCache=new Object();
					this.xmlCache=new Object();
					this.caching=false;
					this.autoWidthElements=new Object();
                    document.body.appendChild(this.html.contentTag);
					this.autoWidthElements[this.html.contentTag.id]=this.html.contentTag;
					this.images=new Object();
                }
				this.showChildPage=function()
				{
					website.navi.showNavigation(this);
					var tmpFunc=website.showPage.bind(this.childs[this.forward-1]);
					tmpFunc();
				}
                this.showPage = function(){
					website.navi.showNavigation(this);
					var performXML=function(responseGot)
					{
						if(responseGot!=false)
						{
							var toParse;
							if(typeof(resultXML.xml)!='undefined')
								toParse=resultXML.xml;
							else
								toParse=resultText;
							website.fileCache[this.name + '.xml'] = xmlParse(toParse);
						}

						var tmpFunc=processXSLT.bind(this);
						tmpFunc();

					}
					var performXSL=function(responseGot)
					{
						if(responseGot!=false)
						{
							var toParse;
							/*if(typeof(resultXML.xml)!='undefined')
								toParse=resultXML.xml;
							else*/
								toParse=resultText;
							website.fileCache[this.style + '.xsl'] = xmlParse(toParse);
						}
						if(typeof(website.fileCache[this.name + '.xml']) == 'undefined')
						{
							loadXMLDoc(Website.HOST+'content/' + this.name + '.xml', performXML.bind(this), true);
							//Util.request(website.host + 'content/' + this.name + '.xml', {method: 'get',onComplete: performXML.bind(this)});
						}
						else
						{
							var tmpFunc=performXML.bind(this);
							tmpFunc(false);
						}

					}
					var processXSLT=function()
					{
						website.setContent(xsltProcess(website.fileCache[this.name+'.xml'], website.fileCache[this.style+'.xsl']));
						website.setAutoWidth();
					}
					if (typeof(website.fileCache[this.style + '.xsl']) == 'undefined') {
						loadXMLDoc(Website.HOST+'stylesheets/' + this.style + '.xsl', performXSL.bind(this), true);
					}
					else
					{
						var tmpFunc=performXSL.bind(this);
						tmpFunc(false);
					}
					website.navi.navigationContainer['nomadic_container'].html.style.width=Util.calculateOffsetWidth(website.navi.navigationContainer['nomadic_container'].html);

                }
				this.setContent = function(contentGot)
				{
					/*var galery=contentGot.getElementsByTagName('galery')[0];
					if(galery!=null)
					{
						var tmpGaleryContainer=Util.createTag('div','class=galery',null)
						var src=website.host+'pics/'+galery.getAttribute('prefix')+'1.jpg';
						var tmp1stPicture=Util.createTag('img','src='+src,null);
						tmpGaleryContainer.appendChild(tmp1stPicture);
						website.html.contentTag.appendChild(tmpGaleryContainer);
					}
					website.html.contentTag.appendChild(contentGot);*/
					website.html.contentTag.innerHTML=contentGot;
				}
				this.showNextImage= function()
				{
					var galeryContainer=Util.gel('galery');
					var numberOfPics=galeryContainer.getAttribute('numberOfPics');
					var prefix=galeryContainer.getAttribute('prefix');
					var count=parseInt(galeryContainer.getAttribute('count'))+1;
					var path='/pics/'+prefix+count+'.jpg';
					var newImg=new Image();//Util.createTag('img','src='+path,null);
					newImg.src=path;//setAttribute('src',path);
					newImg.setAttribute('name',prefix+count);
					//website.images[prefix+count]=newImg;
					galeryContainer.setAttribute('count',count);
					galeryContainer.removeChild(galeryContainer.firstChild);
					galeryContainer.appendChild(newImg);
					//alert(newImg.readyState);
					if(count>1)
						Util.gel('prevImg').style.visibility='visible';
					if(count==numberOfPics)
						Util.gel('nextImg').style.visibility='hidden';
					Util.gel('galeryStatus').innerHTML=count+' of '+numberOfPics;
					website.setAutoWidth();
				}
				this.showPrevImage= function()
				{
					var galeryContainer=Util.gel('galery');
					var numberOfPics=galeryContainer.getAttribute('numberOfPics');
					var prefix=galeryContainer.getAttribute('prefix');
					var count=parseInt(galeryContainer.getAttribute('count'))-1;
					var path='/pics/'+prefix+count+'.jpg';
					var newImg=new Image();//Util.createTag('img','src='+path,null);
					newImg.src=path;
					newImg.setAttribute('name',prefix+count);
					galeryContainer.setAttribute('count',count);
					galeryContainer.removeChild(galeryContainer.firstChild);
					galeryContainer.appendChild(newImg);
					if(count<numberOfPics)
						Util.gel('nextImg').style.visibility='visible';
					if(count==1)
						Util.gel('prevImg').style.visibility='hidden';
					Util.gel('galeryStatus').innerHTML=count+' of '+numberOfPics;
					website.setAutoWidth();
				}
				this.showHome=function()
				{
					var tmpFunc=this.showPage.bind(this.navi.home);
					tmpFunc();
				}
				this.openExternalLink=function(linkGot)
				{
					if(typeof(linkGot)=='string')
						window.open(linkGot);
					else
						window.open(this);
				}
				this.setAutoWidth=function()
				{
					for(var element in this.autoWidthElements)
						this.autoWidthElements[element].style.width=Util.calculateOffsetWidth(this.autoWidthElements[element]);
				}
				this.initialize(responseGot);
            };
			Website.HOST='http://'+document.location.host+'/';
