/*---------------------------------------------------------------------------

JavaScript Nudging Text Effect for Web Designers Toolkit
(C)1999-2004 USINGIT.COM, All Rights Reserved.
To get more ideas, solutions, free and professional scripts, visit:
http://www.usingit.com/
http://www.usingit.com/products/webtoolkit
email: support@usingit.com

This script can be used freely for commercial and non-commercial sites only if 
you don't alert the copyright info here! 

-----------------------------------------------------------------------------*/

//**************************************************************
//Set the parameters below to make this script to fit your need.
//**************************************************************

//The message will be displayed with special effect.
nudgingMessage="Dalaman Village Peace & Tranquility";

//**************************************************************
//DO NOT CHANGE ANYTHING BELOW.
//**************************************************************

arTop=new Array();
arTop[0]=-1;
arTop[1]=-4;
arTop[2]=-7;
arTop[3]=-10;
arTop[4]=-7;
arTop[5]=-4;
arTop[6]=-1;
count=0;
count2=0;
htmlCode="";

function jmp1()
{
	if(nudgingMessage.length > 6)
	{
		htmlCode="";
		for(i=0;i<nudgingMessage.length;i++)
		{
			htmlCode=htmlCode+"<span style='position:relative;' id='NUDGE"+i+"'>"+nudgingMessage.charAt(i)+"</span>";
		}
		oDudgeDiv.innerHTML=htmlCode;
		jmp2();
	}
	else
	{
		alert("Your message is too short! The message needs at least 7 letters to display.");
	}
}

function jmp2()
{
	oChar0=(document.getElementById)?document.getElementById("NUDGE0"):document.all.NUDGE0;
	oChar0.style.left=-count2;
	if(count2!=9)
	{
		count2+=3;
		setTimeout("jmp2()",40);
	}
	else
	{
		jmp3();
	}
}

function jmp3()
{
	oChar0.style.left=-count2;
	if(count2!=0)
	{
		count2-=3;
		setTimeout("jmp3()",40);
	}
	else
	{
		jmp4();
	}
}

function jmp4()
{
	htmlCode="";
	for(i=0;i<nudgingMessage.length;i++)
	{
		if(i+count>-1&&i+count<7)
		{
			htmlCode=htmlCode+"<span style='position:relative;top:"+arTop[i+count]+"'>"+nudgingMessage.charAt(i)+"</span>";
		}
		else
		{
			htmlCode=htmlCode+"<span>"+nudgingMessage.charAt(i)+"</span>";
		}
	}
	oDudgeDiv.innerHTML=htmlCode;
	htmlCode="";
	if(count!=(-nudgingMessage.length))
	{
		count--;
		setTimeout("jmp4()",40);
	}
	else
	{
		count=0;
		setTimeout("jmp1()",40);
	}
}

document.write("<div id=\"NUDGINGBLOCK\"></div>");
if(document.all||document.getElementById)
{
	oDudgeDiv=(document.getElementById)?document.getElementById("NUDGINGBLOCK"):document.all.NUDGINGBLOCK;
	jmp1();
}
else
{
	document.write(nudgingMessage);
}
