var browserString = navigator.appName;
var browserVersion = navigator.appVersion;

function SchoolInfo(id)
{
	url = "&School_ID=" +id;
	url = "http://"+top.location.host+"/schoolInfo.cfm?"+url;
	if(browserString.search("Microsoft") != -1 && browserVersion.search("MSIE 6") != -1)
	{
		if(!parent.$("#blockSelect").hasClass('iFrameExits'))
			parent.$('body').append('<iframe id="blockSelect" class="iFrameExits" style="width:100%;height:'+parent.$('body').height()+';filter:alpha(opacity=0);position:absolute;left:0px;top:0px;z-index:1000;"></iframe>')
		else
			parent.$("#blockSelect").show();
		
		parent.$.fn.colorbox({
			width:"548", 
			height:"468",
			overlayClose:"false",
			iframe:true,
			opacity: 0.7,
			href:url,
			onComplete:function(){parent.$('html, body').animate({scrollTop:parent.$('#colorbox').position().top})}
		});
		parent.$('#cboxClose').click(function() {$("#blockSelect").hide();});
	}	
	else
	{
		parent.$.fn.colorbox({
			width:"548", 
			height:"468",
			overlayClose:"false",
			iframe:true,
			opacity: 0.7,
			href:url
		});
	}
}
function fotterLightBox(page)
{
	if(page.indexOf('privacy')!= -1)
		iFrameHeight = 700;
	else
		iFrameHeight = 370;
	iFrameFix();
	url="http://"+top.location.host+"/"+page;		
	$.fn.colorbox({
		width:570, 
		height:iFrameHeight,
		overlayClose:"false",
		iframe:true,
		opacity: 0.7,
		href:url
	});
}
function iFrameFix()
{
	if(browserString.search("Microsoft") != -1 && browserVersion.search("MSIE 6") != -1)
	{
		if(!$("#blockSelect").hasClass('iFrameExits'))
			$('body').append('<iframe id="blockSelect" class="iFrameExits" style="width:100%;height:'+$('body').height()+';filter:alpha(opacity=0);position:absolute;left:0px;top:0px;z-index:1000;"></iframe>')
		else
			$("#blockSelect").show();
	}
	
}
$(document).ready(function(){
	if(browserString.search("Microsoft") != -1 && browserVersion.search("MSIE 6") != -1)
	{
		$('#cboxClose').click(function() {
			  $("#blockSelect").hide();
			});
	}
});
function linkOutSchool(page,lWidth,lHeight)
{
	//iFrameFix();
	lWidth= eval(lWidth)+100;
	parent.$.fn.colorbox({
		width:lWidth, 
		height:lHeight,
		overlayClose:"false",
		iframe:true,
		opacity: 0.7,
		href:page
	});
}

/*******************************/
/**  Fix for iframe height **/
/*******************************/
$(function(){$('#schoolPageFrame')
 .load(function(){
	var frameHeight = $(this).contents().find('.pageCoreBg').height();
	    $(this).parent().css('height', frameHeight);
	    $(this).css('height', frameHeight);
});
$("#schoolPageFrame").trigger('load'); //IE fix
});


