   var thisPage, pageDisplay, thisPagePath;
/* --------------------------- */

/*------------ Initialize the page andpreload the images --- */
function initialize(){
//window.status='Welcome to the Institutional Portfolio web site' ; 
return true;

}

/* --------------------------------------------------------------------------------------------------------- */
/*  THIS IS VERY IMPORTANT FUNCTION FOR THE COMPLETE SITE TO WORK PROPERLY */
/* --------------------------------------------------------------------------------------------------------- */
function getelm(thisid){
	var thiselm = null;
   try{ 
               if (document.getElementById) {
                             // browser implements part of W3C DOM HTML ( Gecko, Internet Explorer 5+, Opera 5+                      
					   thiselm = document.getElementById(thisid);
			     	}
					
                else if (document.all){ 
				 // Internet Explorer 4 or Opera with IE user agent
                 thiselm = document.all[thisid];
              }
						
                else if (document.layers){ // Navigator 4
                    thiselm = document.layers[thisid];
                }

	if(thiselm)	{	
				if(thiselm == null) { return; }
				else {return thiselm;}
			}
	}
	catch(ex){
	
	}
}
/* ---------------------------------------------------------- */
  function GetPageText(){
	// get the page text 
		try{       
		thisPage = getelm("ctl00_iport");
        pageDisplay = getelm("PageDisplay");
        thisPagePath  = getelm("ctl00_cphMaster_pagePath");
       //alert(thisPagePath.value)
		    parseText(thisPagePath.value, pageDisplay);
            pageDisplay.style.display = "block";
		   }
    catch(ex) {
		     //alert(ex)
	    }
	}
	//================================
	function showhideElm(id, disp){
	    var elm = getelm(id);
                          
     		if (elm.style){
     		
					if(disp == 'show') { elm.style.display='block';}
					else if(disp =='hide') {elm.style.display='none';}
					}
			
	  return true;

	}		 
	//================================
	function toggleElmDisplay(id){
	    var elm = getelm(id);                         
     		if (elm.style){     		
					if(elm.style.display == 'none') { elm.style.display='block';	  return;}
					else if(elm.style.display == 'block') {elm.style.display='none'; return;}
				}			    
	}		 
 // ============================= // 	
function showhideImg(id, disp){
	var  id = id;
	var disp = disp;
          // move the element with id to x,y . Where x,y are the horizontal  nd vertical position in pixels
        var elm = getelm(id);
                               
     		if (elm.style){
					if(disp == 1) { elm.style.visibility='visible'; 	}
					else {	elm.style.visibility='hidden';		}
					}
			
	  return true;

	}
/* ---------------------------------------------------------- */
function imgOn(imgName, imgLoc) {
		        if (document.images) {
					onImg = new Image();
					onImg.src = '/newiport/images/' + imgLoc;
					var imgObj =  'document.' + imgName;
		            eval(imgObj).src =  onImg.src;
				//	alert(onImg.src)
		        }
		}

function imgOff(imgName, imgLoc) {
		        if (document.images) {
					offImg = new Image();
					offImg.src = '/newiport/images/' + imgLoc;
					var imgObj =  'document.' + imgName;
 			          eval(imgObj).src = offImg.src;
		        }
		}
//=============================================
function getGoogleSearch()
{
	var qtext = document.SearchSite.q.value;	
	// set the query text so that the search results are from planning site only
		document.SearchSite.q.value = qtext + ' '+ "site:planning.iupui.edu";
		document.SearchSite.submit();
	}
	
	//================================================
    //================================================
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	var r = {x: curleft, y: curtop};
	return r;
}

/* ----------------------------------------------------------- */
function break_out_of_frames() {
	if (parent.frames.length > 0) {parent.location.href = self.document.location;}
}

/* ----------------------------------------------------------- */
function PageLastUpdated() {
	if (document.lastModified){	document.write("Page Last Updated: " + document.lastModified + "  (IMIR Web Team)");}
}

/* ----------------------------------------------------------- */
function getlink() {
	var elmlist = getelm('linklist');
	if(elmlist){	var linkurl = elmlist.value;
		window.location.href=linkurl;	
	}
	else{return;}
//	linkurl = document.frmSiteSearch..options[document.sitequicklinks.linkslist.selectedIndex].value;

}

/* ----------------------------------------------------------- */
function OpenWindow(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=675,height=375,left = 100,top = 100');");
}

/* ----------------------------------------------------------- */
function closewindow(){
//alert
oWindow = window.parent.close(); 
}


//END