// JavaScript Document
function popup(sw) {

if (sw == 1) {
// Show popup

document.getElementById('blackout').style.visibility = 'visible';
document.getElementById('divpopup').style.visibility = 'visible';
document.getElementById('blackout').style.display = 'block';
//document.getElementById('divpopup').style.display = 'block';
	if(ssOverflow == 'StockScreener'){
		document.getElementById('divpopup').style.display = 'block';
		document.getElementById('divpopup').style.overflow = 'hidden';
	}else{
		//document.getElementById('divpopup').style.overflow = 'auto';
		document.getElementById('divpopup').style.display = 'block';
	}
} else {
// Hide popup

	
document.getElementById('blackout').style.visibility = 'hidden';
document.getElementById('divpopup').style.visibility = 'hidden';
document.getElementById('blackout').style.display = 'none';
document.getElementById('divpopup').style.display = 'none';
document.getElementById('pop_content').innerHTML = '';
updateLivePrice = false ;paginateFlag = false;
defShowList = true; openChart = false;
pageName = "equity";
if(pageName == "stockScreener"){
	//document.getElementById("subindustDiv").style.visibility = "visible"
	}
try{
	//document.getElementById("industDiv").style.visibility = "visible"
	//document.getElementById("subindustDiv").style.visibility = "visible"
	document.body.style.overflow="";
   if (window.ActiveXObject){
  	 var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	standardbody.style.overflow=""
	}else{
		document.body.style.overflow="auto";
	}
}catch(e){}
	
}
}




function popup1(sw) {
if (sw == 1) {
// Show popup

document.getElementById('blackout_home').style.visibility = 'visible';
document.getElementById('divpopup_home').style.visibility = 'visible';
document.getElementById('blackout_home').style.display = 'block';
document.getElementById('divpopup_home').style.display = 'block';

document.getElementById('divpopup_home').style.width = "39%";
document.getElementById('divpopup_home').style.height = "25%";
document.getElementById('divpopup_home').style.marginLeft = "30%";
document.getElementById('divpopup_home').style.marginTop = "180px";		


} else {
// Hide popup	
document.getElementById('blackout_home').style.visibility = 'hidden';
document.getElementById('divpopup_home').style.visibility = 'hidden';
document.getElementById('blackout_home').style.display = 'none';
document.getElementById('divpopup_home').style.display = 'none';
document.getElementById('pop_content_home').innerHTML = '';	

if (window.ActiveXObject){
  	 var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	standardbody.style.overflow=""
	}
}
}


function showWidget(evt){
	title='Help'
		var pos=getPos(evt); 
    
	if (evt) {
        var url = evt.target;
    }
    else {
        evt = window.event;
        var url = evt.srcElement;
    }
    xPos = pos[0];
    yPos = pos[1];

   toolTip = document.getElementById("widgetDiv");
 
   //var getChartData = showDynamicChartdataChart(scrip,exid);
  // toolTip.innerHTML = "<h1>"+title+"<div id=\"closeBtn\"><img src=\"imgs/close_btn.gif\" onClick=hideWidget()  /></div></h1><p>"+getChartData+"</p>";
   toolTip.innerHTML = "<h1>"+title+"<div id=\"closeBtn\"><img src=\"imgs/close_btn.gif\" onClick=hideWidget()  /></div></h1><p>No new call has been issued today. You can continue with the previous call. Maintain strict stop loss.</p>";
   toolTip.style.top = parseInt(yPos)-34 + "px";
   
   toolTip.style.left = parseInt(xPos)-198+ "px";
   
   toolTip.style.visibility = "visible";
}

function hideWidget(){
   var toolTip = document.getElementById("widgetDiv");
   toolTip.style.visibility = "hidden";
   // if(document.getElementById("hiddenIframe3") !== null){
	//   var toolTip1 = document.getElementById("hiddenIframe3");
	 //  toolTip1.style.visibility = "hidden";
  // }
}

function getPos(e)  {
    var posx = 0;
    var posy = 0;

    if (!e) var e = window.event;
    if (e.pageX || e.pageY) 	
    {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) 	
    {
        posx = e.clientX + document.body.scrollLeft
            + document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
            + document.documentElement.scrollTop;
    }

    var pos=new Array();
    pos[0]=posx;
    pos[1]=posy;
    return pos;
}
