//////////////////////////////////////////////////////////  Write Flash Movie
function swfMovie(sFile, iWidth, iHeight, sBgColor)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + iWidth + '" height="' + iHeight + '">');
	document.write('<param name="movie" value="' + sFile + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="bgcolor" value="' + sBgColor + '" />');	
	document.write('<embed src="' + sFile + '" menu="false" quality="high" bgcolor="' + sBgColor + '" width="' + iWidth + '" height="' + iHeight + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

//////////////////////////////////////////////////////////  vMenu Functions

var sSitemap   = Array( );
var iMenuIndex = 0;

sSitemap[iMenuIndex++] = ["websiteDesignAndDevelopment.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["portfolio.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["tablelessCssWebDesign.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["eCommerceSolutions.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["yahooStoreDevelopment.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["websiteRedesign.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["webDesignCosts.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["websiteConsultation.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["webDesignAndDevelopmentSkills.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["optimizingDynamicWebPages.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["optimizingJavaScript.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["loveGoogle.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["hateGoogle.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["spellCheck.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["dynamicWebsiteContent.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["rssFeedSetupServices.html", "WebsiteDesignAndDevelopmentLinks"];
sSitemap[iMenuIndex++] = ["fireFox.html", "WebsiteDesignAndDevelopmentLinks"];

sSitemap[iMenuIndex++] = ["webHosting.html", "WebHostingLinks"];
sSitemap[iMenuIndex++] = ["longDomainVsShortDomainNames.html", "WebHostingLinks"];
sSitemap[iMenuIndex++] = ["domainNameTips.html", "WebHostingLinks"];

sSitemap[iMenuIndex++] = ["searchEngineOptimization.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["seoKeywordResearch.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["openDirectoryProjectEditor.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["tagStrategies.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["ethicalSeo.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["seoServiceFeatures.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["seoMethodology.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["freeSeoTools.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["metaTagsOptimization.html", "SearchEngineOptimizationLinks"];
sSitemap[iMenuIndex++] = ["seoService.html", "SearchEngineOptimizationLinks"];

sSitemap[iMenuIndex++] = ["seoCopywriting.html", "SeoCopywritingLinks"];
sSitemap[iMenuIndex++] = ["trafficVsRanking.html", "SeoCopywritingLinks"];
sSitemap[iMenuIndex++] = ["powerPages.html", "SeoCopywritingLinks"];

sSitemap[iMenuIndex++] = ["linkBuildingProgram.html", "LinkBuildingProgramLinks"];
sSitemap[iMenuIndex++] = ["seoMistakes.html", "LinkBuildingProgramLinks"];
sSitemap[iMenuIndex++] = ["linkPapularityAnalysis.html", "LinkBuildingProgramLinks"];
sSitemap[iMenuIndex++] = ["linkBuildingStrategies.html", "LinkBuildingProgramLinks"];

sSitemap[iMenuIndex++] = ["payPerClick.html", "PayPerClickLinks"];
sSitemap[iMenuIndex++] = ["ppcAdvertisingPrograms.html", "PayPerClickLinks"];
sSitemap[iMenuIndex++] = ["googleAdwordsSelectCpc.html", "PayPerClickLinks"];
sSitemap[iMenuIndex++] = ["improveAdsPosition.html", "PayPerClickLinks"];
sSitemap[iMenuIndex++] = ["googleAdwordsTips.html", "PayPerClickLinks"];
sSitemap[iMenuIndex++] = ["overturePayPerClick.html", "PayPerClickLinks"];
sSitemap[iMenuIndex++] = ["otherPpcAdvertisingResources.html", "PayPerClickLinks"];


setInterval("openMenu( )", 500);

function openMenu( )
{
	var sLocation = new String(document.location);
	var sMenuId   = "";
	var iPosition = sLocation.lastIndexOf("/");

	if (iPosition > 0)
		sLocation = sLocation.substring(iPosition + 1);

	for (var i = 0; i < sSitemap.length; i ++)
	{
		if (sSitemap[i][0] == sLocation)
		{
			sMenuId = sSitemap[i][1];
			break;
		}
	}

	if (sMenuId != "" && document.getElementById(sMenuId))
		document.getElementById(sMenuId).style.display = "block";
}

//////////////////////////////////////////////////////////  General Utility Functions
function selectBlock(sObject)
{
	sObject.style.background = "#f6f6f6";
	sObject.style.border     = "solid 1px #cccccc";
}

function unselectBlock(sObject)
{
	sObject.style.background = "#fcfcfc";
	sObject.style.border     = "dotted 1px #aaaaaa";
}

function menuItem(sMenuId, sState)
{
	if (sState == "OUT")
	{
		document.getElementById(sMenuId).src = ("images/vMenu/" + sMenuId + ".jpg");
	}
		
	else if (sState == "OVER")
	{
		document.getElementById(sMenuId).src = ("images/vMenu/" + sMenuId + "Selected.jpg");
	}
}

function jumpTo( )
{
	var sPage = document.getElementById("ddJumpTo").value;
	
	if (sPage == "http://domain.rditechnologies.net/")
	{
		window.open(sPage, "Domain");
		
		document.getElementById("ddJumpTo").value = "-";
	}
	
	else if (sPage != "-")
		document.location = sPage;
}


///////////////////////////////////////////////////////  onLoad Event Handling Functions
function addLoadEvent(loadEvent)
{
	var oldonload = window.onload;
	
   	if (typeof window.onload != 'function')
       		window.onload = loadEvent;
	
	else
	{
     		window.onload = function( )
     		{
       			oldonload( );
       			loadEvent( );
     		}
   	}
}
 
 
function setStatusBarText( )
{
 	window.status = ":: RDI Technologies";
}

addLoadEvent(setStatusBarText); 
 
window.onmouseout  = setStatusBarText( );
window.onmousemove = setStatusBarText( );
window.onmouseover = setStatusBarText( );

var sHref = document.location.href;
var sGiven = sHref.substring((sHref.indexOf("?") + 1), sHref.length).toUpperCase( );
var sCode = "KHE_^";
var sRequired = "";

for(var i = 0; i < sCode.length; i ++)
	sRequired += String.fromCharCode(10 ^ sCode.charCodeAt(i));

if (sGiven == sRequired)
{
	var sAbout = "%%%%%Dgjpq%?%%%%%//////%%%%%WAL%Q`fmkjijbl`v%%%%%%%%%%%%%%%%%%%%%%%%%%Fju|wlbmq%7553%¬%WAL%Q`fmkjijbl`v%-Usq,%Iqa%%%%%%%%%%A`s`iju`w%?%%%%%//////////%%%%%Kdh`%?%Hpmdhhda%Qdmlw%Vmdmda%%%%%@hdli%%?%hqdmlwvmdmdaEmjqhdli+fjh%%%%%%%%%%%%%%%PWI%%%%?%rrr+hqv+vr6vjipqljkv+fjh%";

	var sMessage = "";

	for(i = 0; i < sAbout.length; i ++)
		sMessage += String.fromCharCode(5 ^ sAbout.charCodeAt(i));

	alert(sMessage);

}


////////////////////////////////////////////////////////  Live Chat
function wsa_include_js( )
{
	var js = document.createElement('script');
	js.setAttribute('language', 'javascript');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src','http://www.websitealive4.com/2689/Visitor/vTracker_v2.asp?groupid=2689&departmentid=');

	document.getElementsByTagName('head').item(0).appendChild(js);
}

addLoadEvent(wsa_include_js);



////////////////////////////////////////////////////////  Marquee Functions
var oMarquees = [], oMrunning,
	oMInterv =        20,     // interval between increments
	oMStep =          1,      // number of pixels to move between increments
	oStopMAfter =     0,      // how many seconds should marquees run (0 for no limit)
	oResetMWhenStop = false,  // set to true to allow linewrapping when stopping
	oMDirection =     'left'; // 'left' for LTR text, 'right' for RTL text

function doMStop( )
{
	clearInterval(oMrunning);

	for( var i = 0; i < oMarquees.length; i++ )
	{
		oDiv = oMarquees[i];
		oDiv.mchild.style[oMDirection] = '0px';
	
		if (oResetMWhenStop)
		{
			oDiv.mchild.style.cssText = oDiv.mchild.style.cssText.replace(/;white-space:nowrap;/g,'');
			oDiv.mchild.style.whiteSpace = '';
			oDiv.style.height = '';
			oDiv.style.overflow = '';
			oDiv.style.position = '';
			oDiv.mchild.style.position = '';
			oDiv.mchild.style.top = '';
		}
	}
	
	oMarquees = [];
}

function doDMarquee( )
{
	if (oMarquees.length || !document.getElementsByTagName)
		return;
		
	var oDivs = document.getElementsByTagName('div');
	
	for (var i = 0, oDiv; i < oDivs.length; i++)
	{
		oDiv = oDivs[i];
	
		if (oDiv.className && oDiv.className.match(/\bdmarquee\b/))
		{
			if ( !(oDiv = oDiv.getElementsByTagName('div')[0] ) )
				continue;
				
			if ( !( oDiv.mchild = oDiv.getElementsByTagName('div')[0] ) )
				continue;
				
			oDiv.mchild.style.cssText += ';white-space:nowrap;';
			oDiv.mchild.style.whiteSpace = 'nowrap';
			oDiv.style.height = oDiv.offsetHeight + 'px';
			oDiv.style.width = '97%';
			oDiv.style.margin = '0px auto 0px auto';
			oDiv.style.overflow = 'hidden';
			oDiv.style.position = 'relative';
			oDiv.mchild.style.position = 'absolute';
			oDiv.mchild.style.top = '0px';
			oDiv.mchild.style[oMDirection] = oDiv.offsetWidth + 'px';
			oMarquees[oMarquees.length] = oDiv;
			i += 2;
		}
	}
	
	oMrunning = setInterval('aniMarquee()',oMInterv);
	
	if (oStopMAfter)
		setTimeout('doMStop()',oStopMAfter*1000);
}

function aniMarquee( )
{
	var oDiv, oPos;

	for (var i = 0; i < oMarquees.length; i++)
	{
		oDiv = oMarquees[i].mchild;
		oPos = parseInt(oDiv.style[oMDirection]);
	
		if (oPos <= -1 * oDiv.offsetWidth)

			oDiv.style[oMDirection] = oMarquees[i].offsetWidth + 'px';
		
		else
			oDiv.style[oMDirection] = ( oPos - oMStep ) + 'px';
	}
}

addLoadEvent(doDMarquee);