/* rollover */

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

/* Loading Images */
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		continue_large_over = newImage("images/buttons/continue-large-over.gif");
		STTA_small_over = newImage("images/buttons/STTA-small-over.gif");
		UandC_over = newImage("images/buttons/UandC-large-over.gif");
		signIn_over = newImage("images/buttons/signIn-large-over.gif");
		CanA_over = newImage("images/buttons/CanA-large-over.gif");
		/* Nav's images added by sushil */
		USCitizenship_over = newImage("images/nav/USCitizenship-over.gif");
		FamilyVisas_over = newImage("images/nav/FamilyVisas-over.gif");
		GreenCards_over = newImage("images/nav/GreenCards-over.gif");		
		/*OtherVisas_over = newImage("images/nav/OtherVisas-over.gif");*/		
		StudentVisas_over = newImage("images/nav/StudentVisas-over.gif");		
		USCISForms_over = newImage("images/nav/USCISForms-over.gif");		
		VisitorVisas_over = newImage("images/nav/VisitorVisas-over.gif");		
		WorkVisas_over = newImage("images/nav/WorkVisas-over.gif");
		Passport_over = newImage("images/nav/Passports-over.gif");		
		preloadFlag = true;
	}
}

/* External Pop-up Window*/

function Popup_ext(file,width,height,left,top)
{
        if (navigator.appName == "Microsoft Internet Explorer") { width=width+0; height=height+0;}
		
 		if (parseInt(navigator.appVersion) < 4){width=width+0;height=height+0;}
		newWindow = window.open(file,"PopupWindow","dependent=yes,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",left="+left+",top="+top);

		if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 3)
	window.open(windowLoc,"PopupWindow","status=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",left="+left+",top="+top);

    	if (parseInt(navigator.appVersion) >= 3 && navigator.appName == "Netscape")
        newWindow.focus();
}


/* Warning pop-up */

function Popup_warn(file,width,height,left,top)
{
        if (navigator.appName == "Microsoft Internet Explorer") { width=width+0; height=height+0;}
		
 		if (parseInt(navigator.appVersion) < 4){width=width+0;height=height+0;}
		newWindow = window.open(file,"PopupWindow","dependent=yes,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",left="+left+",top="+top);

		if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 3)
	window.open(windowLoc,"PopupWindow","status=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",left="+left+",top="+top);

    	if (parseInt(navigator.appVersion) >= 3 && navigator.appName == "Netscape")
        newWindow.focus();
}


/* Added for Agreement (TextArea) */

	function myTextArea_OnScroll(myTextArea)
	{
	if (myTextArea.scrollTop + myTextArea.offsetHeight >= myTextArea.scrollHeight)
	{
	document.getElementById('button-disabled').style.display= "none";
	document.getElementById('button-enabled').style.display= "";
	}
	}


/*  function myText(myTextArea)
	{
	var TextArea=document.getElementById('myTextArea');
	var textareaheight= TextArea.scrollHeight;
	var textareaposition= TextArea.scrollTop;
	var textareascrollbar= TextArea.clientHeight;
	if((textareaheight - textareaposition) == textareascrollbar)
	{
	document.getElementById('button-disabled').style.display= "none";
	document.getElementById('button-enabled').style.display= "";
	}
	if (textareaposition + textareaheight == TextArea.offsetHeight)
	{
	document.getElementById('button-disabled').style.display= "none";
	document.getElementById('button-enabled').style.display= "";
	}
	} */



//login page                                                                                                                                                 

function banner()
{
    var iframesrc="ID-header-banner.jsp";
    document.write('<iframe name="loginframe" id="loginframe" style="margin:0 0 -3px 0;padding:0;height:120px;" src="'+iframesrc+'" width="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe> ')
}

function banneraction(act)
{
    parent.document.forms['loginForm'].action = act;
    parent.document.forms['loginForm'].submit();
}


