// JavaScript Document

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

function loadMarquee()
{
	if (window.addEventListener)
	window.addEventListener("load", initializemarquee, false)
	else if (window.attachEvent)
	window.attachEvent("onload", initializemarquee)
	else if (document.getElementById)
	window.onload=initializemarquee
}

function open_win(linkname,winHeight,winWidth){
window.open(linkname,"_blank","toolbar=no, location=no, directories=no, status=no, titlebar=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, height=" + winHeight + ", width= " + winWidth)
}

/*SmartCIMS*/ var H1="For Banks, Brokers & financial companies | Browser-based central Master Data Mgmt | makes your KYC compliance easy";
/*AMC*/ var H2="Online MF Tracker | SIP & STP Calculators | NAV Verifiers | AMC Web-site maintenance.";
/*SmartSigner*/ var H3="Automated way to transmit important files in a legal, secured electronic form, with digital signatures...";
/*SmarTransact*/ var H4="Enable your customers to view information &amp; transact in real-time using their GSM phones";
/*SmartPSL*/ var H5="RBI's Priority Sector Lending directives strictly implemented in a web-based application to help tracking &amp; compliance";
/*SmartCPS*/ var H6="Streamline your central &amp; remote cheque printing with a secure, just-in-time web-based system";
/*SmartInsurance*/ var H7="For brokers & distributors | Life & non-Life (mediclaim,auto,fire etc.) | proposal tracking | premium mgmt | commission calculators";
/*SmartCalc*/ var H8="Upfront, annualized, trail, incentive brokerage calculations | receivable reconciliation | IRR &amp; redemption cost calc.";
/*SmartMutual*/ var H9="End-2-End MF distribution back-office | best-in-class brokerage calculators | sales/RM interface | Prospecting module (with risk profiling)";
/*DP CRM Solutions*/ var H10="Auto-Emailer | DP-on-Net | Paperless DigiSign statements";
/*dematrix*/ var H11="Single browser UI for NSDL &amp; CDSL | Speedier operations | Fastest Billing";
/*dpdlite*/ var H12="DP Backoffice for NSDL/CDSL | Download - Evaluate - Purchase model";
/*SmartTraderPlus*/ var H13="Desktop software tools to make uptodate stock triggers, levels, recommendations and detailed trading data available at your finger tips.";


function showTip(id,event)
{
	ev = event || window.event;
	
	if (ev.pageX || ev.pageY) {
          posx = ev.pageX;
          posy = ev.pageY;
     } else if (ev.clientX || ev.clientY) {
          posx = ev.clientX + document.body.scrollLeft;
          posy = ev.clientY + document.body.scrollTop;
     }
	 getScrollXY();
	 getSize();
	//document.getElementById("divDebug").innerHTML = "Mouse X:"+posx + " Mouse Y:"+posy + " scroll y:"+scrOfY;
	//document.getElementById("divDebug2").innerHTML = "Mouse X:"+posx + " Mouse Y:"+posy + " scroll x:"+scrOfX;
	
	
	document.getElementById("divTipText").innerHTML = id;
	document.getElementById("divTip").style.top=15+scrOfY+posy+"px";
	//alert(document.getElementById("divTip").style.top);
	document.getElementById("divTip").style.left=7+posx+"px";
	
	/* for debug */
	/*
	document.getElementById("divDebug2").innerHTML += "<br> left : "+document.getElementById("divTip").style.left;
	document.getElementById("divDebug2").innerHTML +="<br> w : "+document.getElementById("divTip").offsetWidth;
	document.getElementById("divDebug2").innerHTML +="<br> myW : "+myWidth;
	*/
	/* debug end */
	
	divTop = document.getElementById("divTip").style.top;
	divTop = divTop.substring(0,divTop.length-2);
	divHeight = document.getElementById("divTip").offsetHeight;
	TH = parseInt(divTop)+parseInt(divHeight);
	SH = parseInt(myHeight)+parseInt(scrOfY);
	//alert(TH);
	if(scrOfY>=1)
	{
		if(TH>SH)
		{
			document.getElementById("divTip").style.top=divTop-(TH-SH)+"px";
		}
	}else{
		if(TH>myHeight)
		{
			document.getElementById("divTip").style.top=divTop-(TH-myHeight)+"px";
		}
	}
	
	divLeft = document.getElementById("divTip").style.left;
	divLeft = divLeft.substring(0,divLeft.length-2);
	divWidth = document.getElementById("divTip").offsetWidth;
	LW = parseInt(divLeft)+parseInt(divWidth);
	SW = parseInt(myWidth)+parseInt(scrOfX);
	//alert(TH);
	if(scrOfX>=1)
	{
		if(LW>SW)
		{
			document.getElementById("divTip").style.left=divLeft-(LW-SW)+"px";
		}else if(LW<myWidth){
			document.getElementById("divTip").style.left=parseInt(divLeft)+scrOfX+"px";
		}
	}else{
		if(LW>myWidth)
		{
			document.getElementById("divTip").style.left=divLeft-(LW-myWidth)+"px";
		}
	}
	
	//document.getElementById("divDebug2").innerHTML +="<br> newLeft : "+document.getElementById("divTip").style.left;
	//document.getElementById("divDebug").innerHTML=document.getElementById("divDebug2").innerHTML
	//document.getElementById("divTip").style.top = document.getElementById("divTip").style.top+"px";
	
	document.getElementById("divTip").style.visibility="visible";
}

function hideTip()
{
	document.getElementById("divTip").style.visibility="hidden";
}

var myWidth = 0, myHeight = 0;
function getSize()
{
	myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth; 
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth ; 
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth; 
		myHeight = document.body.clientHeight;
	}
	//alert("myWidth - "+myWidth +" myHeight - "+myHeight);
}

var scrOfX = 0, scrOfY = 0;
function getScrollXY() 
{
	scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
}

function showFlyer(loc)
{
	//alert(screen.height + " - " + screen.width);
	tempHeight = screen.height - 70;
	tempWidth = screen.width - 50;
	//alert(tempHeight + " - " + tempWidth);
	var win = window.open(loc,"_blank","toolbar=no, location=no, directories=no, status=no, titlebar=no, menubar=no, scrollbars=yes, resizable=no, top=0, left=25, copyhistory=yes, height=" + tempHeight + ", width= " + tempWidth);
	win.focus();
	//win.moveTo(20,0);
}

function showMobileGiving()
{
	tempHeight = 792;
	tempWidth = 612;
	//alert(tempHeight + " - " + tempWidth);
	var Mwin = window.open("NewSite_2/mobile_giving.html","_blank","toolbar=no, location=no, directories=no, status=no, titlebar=no, menubar=no, scrollbars=no, resizable=no, top=0, left=20, copyhistory=yes, height=" + tempHeight + ", width= " + tempWidth);
	Mwin.focus();
}

function showDponMobile()
{
	tempHeight = 500;
	tempWidth = 500;
	//alert(tempHeight + " - " + tempWidth);
	var DPwin = window.open("NewSite_2/DPonMobile/DPonMobile.html","_blank","toolbar=no, location=no, directories=no, status=no, titlebar=no, menubar=no, scrollbars=yes, resizable=no, top=0, left=20, copyhistory=yes, height=" + tempHeight + ", width= " + tempWidth);
	DPwin.focus();
}

function showSmarTransactFlash()
{
	tempHeight = 700;
	tempWidth = 800;
	var STwin = window.open("NewSite_2/flash/SmarTransact/SmarTransact_Flash.html","_blank","toolbar=no, location=no, directories=no, status=no, titlebar=no, menubar=no, scrollbars=no, resizable=no, top=0, left=20, copyhistory=yes, height=" + tempHeight + ", width= " + tempWidth);
	STwin.focus();
}

function showIPhoneFlash()
{
	tempHeight = 750;
	tempWidth = 800;
	var STwin = window.open("NewSite_2/flash/iPhone/iPhoneApp.html","_blank","toolbar=no, location=no, directories=no, status=no, titlebar=no, menubar=no, scrollbars=no, resizable=no, top=0, left=20, copyhistory=yes, height=" + tempHeight + ", width= " + tempWidth);
	STwin.focus();
}