// JavaScript Document

//Tool Box Components
function printPage()
{
	this.print();
}//Prints the Current Grant Details Page

function emailGrant()
{
	mail_str = "mailto:?subject=Check out the " + document.title;
	mail_str += "&body=I thought you might be interested in the " + document.title;
	mail_str += ". You can view it at, " + location.href;
	location.href = mail_str;
}//Opens up Microsoft Outlook so a User Can Email a Grant to a Friend/ Co-Worker


var toolboxHidden = false;
function hideToolbox()
{	
	//Hides the ToolBox
	//hideShowBtn, hideShowIcon
	if (toolboxHidden==false)
	{
		
		//document.getElementById("toolBox-Content").style.opacity=1;
		//document.getElementById("toolBox-Content").style.visibility="hidden";
		//document.getElementById("toolBox-Content").style.display= "none";
		slideup("toolBox-Content");
		document.getElementById("hideShowIcon").src="../Graphics/UnOrganized/arrowDown.png";
		toolboxHidden=true;
		//document[img_name].src=img_src;
	}
	else
	{
		//alert("Open");
		slidedown("toolBox-Content");
		document.getElementById("hideShowIcon").src="../Graphics/UnOrganized/arrowUp.png";
		//document.getElementById("toolBox-Content").style.visibility="visible";
		//document.getElementById("toolBox-Content").style.display= "block";
		
		toolboxHidden=false;
	}
}
//slidedown('mydiv');

///Page Variables
function getIp()
{
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
document.write("Your IP address is " + ip);
}

//Variables Global

function saveGrant()
{
	alert("Save Grant");
} 
function startProject()
{
	alert("Start Project");
} 
  
function tweetThis()
{
	tweet_string= "http://twitter.com/home?status= ";
	tweet_string+= "Check Out This Grant:";
}

function readMouse()
{
	mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;
	mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;

}
function isChecked(){							
 frm=document.forms.item(0);
 var j;		
 //loop through all elements 
	for (i=0;i<frm.length;i++){	
		// Look for our checkboxes only	
		var temp = frm.elements[i].type;
		if ((temp = "CheckBox") && (frm.elements[i].name.indexOf("cb_AddToResearchReport") > -1) ){
			if (frm.elements[i].checked){
				j=0;
				//alert('items are selected');
				return true;
			}
			else{
				j=1;
			}
		}
	}
	if (j==1){
		alert('No items are selected');
		return false;
	}
}