/* ------------------------------------------------------------
	JavaScript Document for screen shots for 
	Products and Languages

--------------------------------------------------------------------*/

var _imageRoot = "http://indianastrologysoftware.com/images/";
/*------------------------------------------------------------------*/
function getLifeSignScreenShots(_prodId,_Lang,_scrCount)
{
	menuActive();
	_scrImageArray = getScreenShotArray(_scrCount);
	_scrImageRoot = _imageRoot + _prodId.toUpperCase()+'/'+_Lang.toLowerCase()+'/';
	
	showProcess();
	_frame = document.getElementById("my-glider");
	_imgList = _frame.getElementsByTagName('img');
	for( i=0 ; i< _scrCount ; i++ )
	{
		_imgList[i].src = _scrImageRoot + _scrImageArray[i];
		
		obj = document.getElementById("screenid"+i);
		if(!obj)
		{
			obj = document.createElement("div");
			obj.id = "screenid"+i;
			obj.setAttribute("align","center");
			obj.innerHTML = "Screen: <b>"+(i+1)+"</b> of <b>"+_scrCount+"</b>";
			_imgList[i].parentNode.insertBefore(obj,_imgList[i]);
			
			msg = document.createElement("div");
			msg.id = "scrmessage";
			msg.innerHTML = "Click image to Enlarge";
			_imgList[i].parentNode.appendChild(msg);
		}
	}
	
	setTimeout("hideProcess()",5000); 
}

function _void(){ var t = true; }
var linkobj;
window.onload = function()
{
	if(!document.all)
	{
		window.captureEvents(Event.CLICK);
		window.onclick = function(e){
		linkobj = e.target ? Object(e.target) : null;
		}
	}
}
function menuActive()
{
	if(document.all)
	{
		linkobj = window.event ? window.event.srcElement : null;
	}
	else
	{
		//if(linkobj.tagName != "A") menuActive();
	}
	if(linkobj!=null)
	{
		
		nodes = linkobj.parentNode.parentNode.getElementsByTagName("a");
		for(i=0; i < nodes.length ; i++)
		{ 
			if(linkobj.tagName.toUpperCase() == "A")	
				nodes[i].className = "";	
		}
		if(linkobj.tagName.toUpperCase() == "A")
			linkobj.className = "avisited";
	}
	
}

function showProcess()
{
	if(! document.getElementById("processing"))
	{
		_process = document.createElement("div");
		_process.id = "processing";
		_process.innerHTML = "<img src='http://indianastrologysoftware.com/images/loadingAnimation.gif' />";
		_process.style.display = "block";
		_process.className = "process";
		_process.position = "relative";
		_process.style.width = "100px";
		_process.style.left ="200px";
		_process.style.top = "55px";
		_process.style.zIndex = 200;
		_process.setAttribute("align","center");
		
		gl=document.getElementById("my-glider");
		gl.appendChild(_process);
	}
	else
	document.getElementById("processing").style.display = "block";
	
}
function hideProcess()
{
	document.getElementById("processing").style.display = "none";
}

function getScreenShotArray(_scrCount)
{
	_scrArray = new Array();
	for(_cnt=1 ; _cnt <= parseInt(_scrCount) ; _cnt++ )
	{
		_scrArray[_cnt-1] = 'scn'+strPadLeft(_cnt,'0',2)+'.gif';
	}

	return _scrArray;
}

function strPadLeft(_strInput,_strPadChar,_strPadLength)
{
	
	var len = String(_strInput).length;
	for(_i=0 ; _i < parseInt(_strPadLength)-len ;_i++)
	{
	  _strInput = _strPadChar + String(_strInput);
	}
	
	return _strInput;
}

/*
function getScrollPanelObj()
{
	return Object ('<img />');
}
*/

