var repeat=0 //enter 0 to not repeat scrolling after 1 run, othersise, enter 1
var title=document.title
var leng=title.length
var start=1
function titlemove() {
  titl=title.substring(start, leng) + title.substring(0, start)
  document.title=titl
  start++
  if (start==leng+1) {
    start=0
    if (repeat==0)
    return
  }
  setTimeout("titlemove()",240)
}
if (document.title)
titlemove()

/*
 * http://jquery.com/
 */
 
$(document).ready(function() {
	sliter1(2500, 680); // set delay between the automatic slider and width of photos 
});

function sliter1($secs, $photo_wth) {	$addC = $(".itemidx.current").length;	if($addC == 0) {		$(".itemidx:first").addClass("current");	}
	$allPort = ($(".itemidx").length) - 1;	$wthDivide = 935 - $photo_wth;	$tileWth = parseInt($wthDivide / $allPort);	$caption_wth = $photo_wth - 63;	$caption_wth = $caption_wth + 'px';	$photo_wth = $photo_wth + 'px';
	$(".itemidx").css("width", $tileWth);	$(".itemidx.current").css("width", $photo_wth);	$(".caption").css({ width: $caption_wth, opacity: 0 });	if(typeof(isClicked) == 'undefined') { var isClicked = 0; }
	$(".itemidx").click(function() {	isClicked = 1;	var classClicked = $(this).attr('class');	if(classClicked !== 'itemidx current') {			$(".itemidx.current").removeClass("current").addClass("prev").stop().animate({ width: $tileWth }, 630);	$(this).addClass("current").css("width", $tileWth).stop().animate({ width: $photo_wth }, 730);	$(".itemidx.prev").removeClass("prev"); }	});
	if(typeof(isHovered) == 'undefined') { var isHovered = 0; }	$(".itemidx").hover(function() {	isHovered = 1;	}, function() {	isHovered = 0;	});	setInterval(function() {	if(isHovered == 0 && isClicked == 0) {	nextItm('680px', $tileWth);	}	}, $secs);}
function nextItm($photo_wth, $tile_width) {	$current = $(".itemidx.current");	$next = $(".itemidx.current").next();	if($next.attr('class') == undefined) {	$next = $(".itemidx:first");	} else {	}	$current.removeClass("current").css("width", $photo_wth).stop().animate({ width: $tile_width }, 630);	$next.addClass("current").css("width", $tile_width).stop().animate({ width: $photo_wth }, 730);}



CSS={AddClass:function(e,c){if(!e.className.match(new RegExp("\\b"+c+"\\b","i")))e.className+=(e.className?" ":"")+c;},RemoveClass:function(e,c){e.className=e.className.replace(new RegExp(" \\b"+c+"\\b|\\b"+c+"\\b ?","gi"),"");}};Tabs={GoTo:function(contentId,skipReplace){var foundTab=false;var toc=document.getElementById("toc");if(toc){var lis=toc.getElementsByTagName("li");for(var j=0;j<lis.length;j++){var li=lis[j];var anchors=li.getElementsByTagName("a");for(var k=0;k<anchors.length;k++){if(anchors[k].hash=="#"+contentId){CSS.AddClass(li,"current");foundTab=true;break;}else{CSS.RemoveClass(li,"current");}}}}var divsToHide=[];var divs=document.getElementsByTagName("div");for(var i=0;i<divs.length;i++){var div=divs[i];if(div.className.match(/\bcontent\b/i)){if(div.id=="_"+contentId)div.style.display="block";else divsToHide.push(div);}}for(var i=0;i<divsToHide.length;i++)divsToHide[i].style.display="none";if(!skipReplace)window.location.replace("#"+contentId);},OnClickHandler:function(e){if(!e)e=window.event;if(e.preventDefault)e.preventDefault();else e.returnValue=false;Tabs.GoTo(this.hash.substring(1));},Init:function(){if(!document.getElementsByTagName)return;var anchors=document.getElementsByTagName("a");for(var i=0;i<anchors.length;i++){var a=anchors[i];if(a.hash)a.onclick=Tabs.OnClickHandler;}var contentId;if(window.location.hash)contentId=window.location.hash.substring(1);var divs=document.getElementsByTagName("div");for(var i=0;i<divs.length;i++){var div=divs[i];if(div.className.match(/\bcontent\b/i)){if(!contentId)contentId=div.id;div.id="_"+div.id;}}if(contentId)Tabs.GoTo(contentId,true);}};FeedbackForm={RequestStatus:null,RequestStatusText:null,Request:null,Init:function(){var span=document.createElement("span");span.className="requestStatus";FeedbackForm.RequestStatus=span;var text=document.createTextNode("");span.appendChild(text);FeedbackForm.RequestStatusText=text;var button=document.getElementById("SubmitFeedback");button.parentNode.appendChild(span);var form=document.getElementById("FeedbackForm");if(form)form.onsubmit=FeedbackForm.OnSubmitHandler;},OnRequestEventHandler:function(){switch(FeedbackForm.Request.readyState){case 4:var d=FeedbackForm.Request.responseText;if(d.substring(0,2)=="OK"){FeedbackForm.RequestStatus.style.color="#080";document.getElementById("Name").value="";document.getElementById("Email").value="";document.getElementById("Message").value="";d=d.substring(3);}else{FeedbackForm.RequestStatus.style.color="#c00";}FeedbackForm.RequestStatusText.nodeValue=d;document.getElementById("Name").disabled="";document.getElementById("Email").disabled="";document.getElementById("Message").disabled="";document.getElementById("SubmitFeedback").disabled="";break;}},OnSubmitHandler:function(){var r=null;if(FeedbackForm.Request){r=FeedbackForm.Request;}else{if(window.XMLHttpRequest){try{r=new XMLHttpRequest();}catch(e){r=null;}}if(!r&&window.ActiveXObject){try{r=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{r=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){r=null;}}}if(!r&&window.createRequest){try{r=window.createRequest();}catch(e){r=null;}}FeedbackForm.Request=r;}if(!r)return true;document.getElementById("Name").disabled="disabled";document.getElementById("Email").disabled="disabled";document.getElementById("Message").disabled="disabled";document.getElementById("SubmitFeedback").disabled="disabled";FeedbackForm.RequestStatus.style.color="#000";FeedbackForm.RequestStatusText.nodeValue="Please wait...";r.open("POST","feedback.php?xhr=1",true);r.onreadystatechange=FeedbackForm.OnRequestEventHandler;r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");r.send("name="+encodeURIComponent(document.getElementById("Name").value)+"&email="+encodeURIComponent(document.getElementById("Email").value)+"&message="+encodeURIComponent(document.getElementById("Message").value));return false;}};window.onload=function(){Tabs.Init();FeedbackForm.Init();};var contentId=window.location.hash||"#Introduction";if(document.createStyleSheet){var style=document.createStyleSheet();style.addRule("div.content","display: none;");style.addRule("div"+contentId,"display: block;");}else{var head=document.getElementsByTagName("head")[0];if(head){var style=document.createElement("style");style.setAttribute("type","text/css");style.appendChild(document.createTextNode("div.content { display: none; } div"+contentId+" { display: block; }"));head.appendChild(style);}}
