function pop1(linkname)
{
	window.open(linkname,'HDFC','height=500, width=500, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_news_sep(linkname)
{
	window.open(linkname,'HDFC','height=600, width=1000, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_hfm(linkname)
{
	window.open(linkname,'HDFC','height=300, width=550, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop2(linkname)
{
	window.open(linkname,'HDFC')
}

function pop3(linkname)
{
	window.open(linkname,'HDFC','height=305, width=440, scrollbars=yes, resizable=1,top=0,left=0')
}

function popfeed(linkname)
{
	window.open(linkname,'HDFC','height=500, width=500, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_loan_eligible(linkname)
{
	window.open(linkname,'HDFC','height=510, width=790, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_homeline(linkname)
{
	window.open(linkname,'HDFC','height=410, width=445, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_pdf(linkname)
{
	window.open(linkname,'HDFC','height=500, width=600, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_annual(linkname)
{
	window.open(linkname,'HDFC','height=550, width=680, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_850(linkname)
{
	window.open(linkname,'HDFC','height=510, width=850, scrollbars=yes, resizable=1,top=0,left=0')
}

function pop_banner(linkname)
{
	window.open(linkname,'HDFC','height=500, width=500, scrollbars=yes, resizable=1,top=0,left=0')
}

function mouseover(sublinks)
{
	document.getElementById(sublinks).style.visibility='visible'
}

function mouseover(sublinks)
{
	document.getElementById(sublinks).style.visibility='hidden'
}

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){

if(subobjstr=="subcontent2")
	document.getElementById("subcontent3").style.display="none";
	
if(subobjstr=="subcontent3")
	document.getElementById("subcontent2").style.display="none";


if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function getposOffset(overlay_inner, offsettype){
var totaloffset=(offsettype=="left")? overlay_inner.offsetLeft : overlay_inner.offsetTop;
var parentEl=overlay_inner.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay_inner(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

var dropC = "0";
$(document).ready(function() {
    $("a").click(function() {

        if ($(this).attr("href").toLowerCase().indexOf(".asp") > 0 || $(this).attr("href").toLowerCase() == "http://www.hdfc.com") {
			//alert($(this).attr("href").toLowerCase());
            dropC = 1;
        }
    });
});

$(window).unload(function() {
    if (dropC == "1") {
        dropC = "0";
    }
    else {
        if (checkCookie() == true) {
            //window.open("/applications/DropoutCapture/DropoutCapture.asp","Dropout","toolbar=no;scrollbars=yes;resizable=yes;");
			window.open("/applications/DropoutCapture/DropoutCapture.asp","Dropout","left=20,top=20,width=600,resizable=1,scrollbars=1,location=0,directories=0,menubar=0,status=0,toolbar=0");
            //var winpop = window.open("/applications/DropoutCapture/DropoutCapture.asp","Dropout","toolbar=no;scrollbars=yes;resizable=yes;");
			//var winpop = window.open("/applications/DropoutCapture/DropoutCapture.asp","Dropout","toolbar=no;");
			/*if (!winpop || winpop.closed) {
		        document.location.href = "/applications/DropoutCapture/DropoutCapture.asp"; target="_blank";
		    }*/
        }
    }
});

function getCookie(c_name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if (x == c_name) {
            return unescape(y);
        }
    }
}

function checkCookie() {
    var check = getCookie("chkDropOut");
    if (check == null) {
        return true;
    }
    else {
        return false;
    }
}

