function PopupCenter(pageURL) {
var left = (screen.width/2)-(320/2);
var top = (screen.height/2)-(280/2);
var targetWin = window.open (pageURL, 'video', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no,resizable=no, copyhistory=no, width=320, height=280, top='+top+', left='+left);
} 
function checkEnter(event) {
    var characterCode// literal character code will be stored in this variable

    if(event && event.which){ //if which property of event object is supported (NN4)
        characterCode = event.which; //character code is contained in NN4's which property
    } else {
        characterCode = event.keyCode //character code is contained in IE's keyCode property
    }

    return (characterCode != 13);  //if generated character code is equal to ascii 13 (if enter key)
}

function openCss() {
    cssWin = new Window('csscollege', {className: "theme1", title: "CSS PROFILE COLLEGES", top:0, left:0, width:500, height:500,zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:true, maximizable:false,  url: "css_profile.jsf"})
    cssWin.setDestroyOnClose();
    cssWin.showCenter();
}

function closeCss(){
    cssWin.close();
}

function openLoginWindow() {
    worksheetWin = new Window('loginpage', {className: "theme1", title: "Login", top:0, left:0, width:370, height:300, zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:false, maximizable:false, url: "/collegecost/new_ccc_login.jsf"})
    worksheetWin.setDestroyOnClose();
    worksheetWin.showCenter();
}

function closeLoginWindow(){
    Windows.close('loginpage');
}

function openSubscriberOnlyPopup() {
    if (Windows.getWindow('subscriberOnlyPopup') == null) {
        popup = new Window('subscriberOnlyPopup', {className: "theme1", title: "Subscriber Only", top:0, left:0, width:250, height:200,zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:true, maximizable:false,  url: "subscriberOnlyPopup.jsf"})
        popup.setDestroyOnClose();
        popup.showCenter();
    }
    return false;
}

function closeSubscriberOnlyPopup(){
    popup.close();
}

function openCreditCardPopup() {
    popup = new Window('creditCardPopup', {className: "theme1", title: "Card Verification Number", top:0, left:0, width:350, height:350,zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:true, maximizable:false,  url: "creditCardPopup.jsf"})
    popup.setDestroyOnClose();
    popup.showCenter();
    return false;
}
function trackClick(tgt) { 
	var pageTracker = _gat._getTracker("UA-466763-1");
    pageTracker._trackPageview(tgt);
    return false;
}
function openEmailWindow(wn) {
	if(emailInSession) {
		openFlashWindow(wn);
		return;
	}
	worksheetWin = new Window('emailpage', {className: "theme1", title: "", top:0, left:0, width:370, height:220, zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:false, maximizable:false, url: "/collegecost/new_ccc_email.jsf?wn="+wn})
    worksheetWin.setDestroyOnClose();
    worksheetWin.showCenter();
}
function openFlashWindow(wn) {
	if(!emailInSession) emailInSession=true;
	if(wn==1){
	   worksheetWin = new Window('flashpage', {className: "theme1", title: "", top:0, left:0, width:600, height:380, zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:false, maximizable:false, url: "/collegecost/completingFAFSA.jsf"})
	}
	else{
		worksheetWin = new Window('flashpage', {className: "theme1", title: "", top:0, left:0, width:600, height:380, zIndex:150, opacity:1, resizable: false,minimizable:false, draggable:false, closable:false, maximizable:false, url: "/collegecost/financialAidOverview.jsf"})
	}
   worksheetWin.setDestroyOnClose();
   worksheetWin.showCenter();
}
function closeEmailWindow(){
    Windows.close('emailpage');
}
function closeFlashWindow(){
    Windows.close('flashpage');
}
function closeEmailAndOpenFlashWindow(wn) {
	closeEmailWindow();
	openFlashWindow(wn);
}

function showHideEmail(obj, focused) {
	defText = "your email";
	if(focused) {
		if(obj.value==defText) {
			obj.value="";
		}
	} else {
		if((obj.value)=="") {
			obj.value=defText;
		}
	}
}



function opencalCollegeWindow() {
	
	$j.ajax({
                type: "POST",
                url: "/collegecost/calcollegecost.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
						document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 

   }
function closeCalCollegeWindow(){
    Windows.close('calcollegecost');
}


function openMinCollegeWindow() {
	$j.ajax({
                type: "POST",
                url: "/collegecost/minimizeCollegeCost.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
						document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 450) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 

   
   }
function closeMinCollegeWindow(){
    Windows.close('mincollegecost');
}
function openAnalyseCollegeWindow() {
	$j.ajax({
                type: "POST",
                url: "/collegecost/analyseFunding.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
						document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 

   
   }
function closeAnalyseCollegeWindow(){
    Windows.close('analyseFunding');
}
function openCompleteFinAid() {

$j.ajax({
                type: "POST",
                url: "/collegecost/completeFinAid.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
						document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 

    
   }
function closeCompleteFinAidWindow(){
    Windows.close('compFinAidWorksheet');
}
function openEvaluateNegotiateFinAid() { 
	$j.ajax({
                type: "POST",
                url: "/collegecost/evaluateNegotiateFinAid.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
						document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 

    
   }
function closeEvaluateNegotiateFinAid(){
    Windows.close('evaluateNegotiateFinAid');
}

function openJuniorCalcollegecost() {
		$j.ajax({
                type: "POST",
                url: "/collegecost/juniorCalCollegeCost.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
						document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 

   }
function closeJuniorCalcollegecost(){
    Windows.close('juniorCalcollegecost');
}
function openJuniorMinCalcollegecost() {
	$j.ajax({
                type: "POST",
                url: "/collegecost/juniorMinimizeCollegeCost.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
   document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 
   }
function closeJuniorMinCalcollegecos(){
    Windows.close('juniorMinCalcollegecost');
}
function openJuniorAnalyseFunding() {
	$j.ajax({
                type: "POST",
                url: "/collegecost/juniorAnalyseFunding.jsf",
                cache: false,
                async: false,
                success: function(data) {
						
   document.getElementById("juniorMinCalcollegecost").innerHTML	=	data;
                        $j.blockUI({ message: $j('#juniorMinCalcollegecost'), css: {
                            top: ($j(window).height() - 300) / 2 + 'px',
                            left: ($j(window).width() - 500) / 2 + 'px',
							width: '355px',
                            border: 'none'
                        } });
                }
            });

			$j('#pop_up_close_btn').click(function() { 
					$j.unblockUI(); 
					return false; 
				}); 
   }
function closeJuniorAnalyseFunding(){
    Windows.close('juniorAnalyseFunding');
}