
//clear search
function clear_search(s) {
  if (s.defaultValue==s.value || s.value=='SEARCH') s.value = ""
}


//text resize
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

//Schools and Colleges Template Launch Site Button Rollover Script
if (document.images) {
	
	btn_launchsite_01 = new Image()
	btn_launchsite_01.src = "/olc/images/CMU/chapters/btn_launchsite.gif"
	btn_launchsite_01_over = new Image()
	btn_launchsite_01_over.src = "/olc/images/CMU/chapters/btn_launchsite_over.gif"
	
	btn_launchsite_02 = new Image()
	btn_launchsite_02.src = "/olc/images/CMU/chapters/btn_launchsite.gif"
	btn_launchsite_02_over = new Image()
	btn_launchsite_02_over.src = "/olc/images/CMU/chapters/btn_launchsite_over.gif"
	
	btn_launchsite_03 = new Image()
	btn_launchsite_03.src = "/olc/images/CMU/chapters/btn_launchsite.gif"
	btn_launchsite_03_over = new Image()
	btn_launchsite_03_over.src = "/olc/images/CMU/chapters/btn_launchsite_over.gif"
}

function RollOver(imgName,imgSource) {
	if (document.images) {
		document.images[imgName].src = eval(imgSource + ".src")
	}
}




// Preloader
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		toptab_01 = newImage("/olc/images/CMU/chapters/home_toptab_prbsolving_on.gif");
		toptab_02 = newImage("/olc/images/CMU/chapters/home_toptab_collaboration_on.gif");
		toptab_03 = newImage("/olc/images/CMU/chapters/home_toptab_creativity_on.gif");
		toptab_04 = newImage("/olc/images/CMU/chapters/home_toptab_globalU_on.gif");
		toptab_05 = newImage("/olc/images/CMU/chapters/home_toptab_studexp_on.gif");
		
		btn_SeeAll_01 = newImage("/olc/images/CMU/chapters/btn_SeeAll_NewsEvents_over.gif");
		btn_SeeAll_02 = newImage("/olc/images/CMU/chapters/btn_SeeAll_NewsEvents_over.gif");
		
		btn_fastfacts_back = newImage("/olc/images/CMU/chapters/btn_fastfacts_back_over.gif");
		btn_fastfacts_seeall = newImage("/olc/images/CMU/chapters/btn_fastfacts_seeall_over.gif");
		btn_fastfacts_next = newImage("/olc/images/CMU/chapters/btn_fastfacts_next_over.gif");
		
		btn_article_back = newImage("/olc/images/CMU/chapters/btn_article_back_over.gif");
		btn_article_seeall = newImage("/olc/images/CMU/chapters/btn_article_seeall_over.gif");
		btn_article_next = newImage("/olc/images/CMU/chapters/btn_article_next_over.gif");
		
		btn_students = newImage("/olc/images/CMU/chapters/btn_students_over.gif");
		btn_facultystaff = newImage("/olc/images/CMU/chapters/btn_facultystaff_over.gif");
		btn_announcements_viewall = newImage("/olc/images/CMU/chapters/btn_announcements_viewall_over.gif");
		
		btn_featuredevents_seeall = newImage("/olc/images/CMU/chapters/btn_featuredevents_seeall_over.gif");
		
		arrow_NewsStories_thumb_01 = newImage("/olc/images/CMU/chapters/lvl_NewsStories_arrow_over.gif");
		arrow_NewsStories_thumb_02 = newImage("/olc/images/CMU/chapters/lvl_NewsStories_arrow_over.gif");
		arrow_NewsStories_thumb_03 = newImage("/olc/images/CMU/chapters/lvl_NewsStories_arrow_over.gif");
		
		btn_launchsite_CIT = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		btn_launchsite_CFA = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		btn_launchsite_CHSS = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		btn_launchsite_Tepper = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		btn_launchsite_JohnHeinz = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		btn_launchsite_MCS = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		btn_launchsite_SCS = newImage("/olc/images/CMU/chapters/btn_launchsite_over.gif");
		preloadFlag = true;
	}
}

////////Set Nav State ////////////////////////

function setHLState(){

	var browser=navigator.appName
	var b_version=navigator.appVersion
	var version=parseFloat(b_version)
	
	
	for(i=0;i<navArray.length;i++){
		//alert(navArray[i]);
		
		//document.getElementById(navArray[i] + '_link').onmouseover = "document.toptab_01.src = 'images/home_toptab_prbsolving_on.gif';"
		//document.getElementById(navArray[i] + '_link').onmouseout = "document.toptab_01.src = 'images/home_toptab_prbsolving.gif';"
	
	}
	
	//alert(browser + " :: " + version);

	for(x=0;x<arguments.length;x++){
		
		var currSrc = document.getElementById(arguments[x]).src;
		var tempSrc = currSrc.substring(currSrc.lastIndexOf('/')+1);
		
		var newSrc = tempSrc.substring(0,tempSrc.lastIndexOf('.gif')) + "_on.gif";
		
		document.getElementById(arguments[x]).src = "images/" + newSrc;
			
			//alert(document.getElementById(arguments[x]))
			if(browser != "Netscape"){
				document.getElementById(arguments[x] + '_link').onmouseout = null;
				document.getElementById(arguments[x] + '_link').onmouseover = null;
			} else {
				delete document.getElementById(arguments[x] + '_link').onmouseout;
				delete document.getElementById(arguments[x] + '_link').onmouseover;
			}
			
	}
}



function lvlImage(){
	var imgArray = new Array();
	imgArray[0] = '<img src="/olc/images/CMU/chapters/level_photo_01.jpg" width="748" height="205" alt="" />';
	imgArray[1] = '<img src="/olc/images/CMU/chapters/level_photo_02.jpg" width="748" height="205" alt="" />';
	imgArray[2] = '<img src="/olc/images/CMU/chapters/level_photo_03.jpg" width="748" height="205" alt="" />';
	imgArray[3] = '<img src="/olc/images/CMU/chapters/level_photo_04.jpg" width="748" height="205" alt="" />';
	imgArray[4] = '<img src="/olc/images/CMU/chapters/level_photo_05.jpg" width="748" height="205" alt="" />';
	
	var imgNum = Math.floor(Math.random()*imgArray.length);
	
	document.write(imgArray[imgNum]);
	}
	
	
	
	
	
// Third Column Callout Articles Array //
var articleCounted = 0;
var totalArticles = 5;

function getArticle(step){
		
		var articles = new Array(5) 
		articles[0] = '<p><img src="/olc/images/CMU/chapters/article_3rdCol_image.jpg" width="201" height="117" border="0" alt="" /></p><h2>Practical Problem Solving Headline</h2><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p><a href=""><img src="images/btn_readarticle.gif" width="102" height="15" border="0" alt="Read Article" title="Read Article" /></a></p><h1>practical problem solving</h1>';
		articles[1] = '<p><img src="/olc/images/CMU/chapters/article_3rdCol_image.jpg" width="201" height="117" border="0" alt="" /></p><h2>Interdisciplinary Collaboration Headline</h2><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p><a href=""><img src="images/btn_readarticle.gif" width="102" height="15" border="0" alt="Read Article" title="Read Article" /></a></p><h1>interdisciplinary collaboration</h1>';  
		articles[2] = '<p><img src="/olc/images/CMU/chapters/article_3rdCol_image.jpg" width="201" height="117" border="0" alt="" /></p><h2>Innovation &amp; Creativity Headline</h2><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p><a href=""><img src="images/btn_readarticle.gif" width="102" height="15" border="0" alt="Read Article" title="Read Article" /></a></p><h1>innovation &amp; creativity</h1>'; 
		articles[3] = '<p><img src="/olc/images/CMU/chapters/article_3rdCol_image.jpg" width="201" height="117" border="0" alt="" /></p><h2>Holi Festival - The World Truly is Getting Flatter</h2><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p><a href=""><img src="images/btn_readarticle.gif" width="102" height="15" border="0" alt="Read Article" title="Read Article" /></a></p><h1>the global university</h1>';  
		articles[4] = '<p><img src="/olc/images/CMU/chapters/article2_3rdCol_image.jpg" width="201" height="117" border="0" alt="" /></p><h2>Carnival Weekend - Get Buggy with it</h2><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p><a href=""><img src="images/btn_readarticle.gif" width="102" height="15" border="0" alt="Read Article" title="Read Article" /></a></p><h1>beyond the classroom</h1>';
			
		articleCounted += step;
		
		if(articleCounted < 0){
			articleCounted = totalArticles-1;
		}
		if(articleCounted >= totalArticles){
			articleCounted = 0;
		}
		
		document.getElementById('lvl_3rdCol_Article').innerHTML = '<div>' + articles[articleCounted] + '</div>';	
		//tipCounted++;
	
	}
	//getArticle(0);
	
	


// Third Column Callout Fast Facts Array //
var fastfactCounted = 0;
var totalFastFact = 5;

function getFastFact(step){
		
		var fastfacts = new Array(5) 
		fastfacts[0] = '<p>Carnegie Mellon is annually ranked among the "most wired" universities for its cutting-edge technological resources, including its wireless campus network. With the initiation of its "Andrew" computer network in 1985, Carnegie Mellon became a pioneer in the educational application of computing.</p><h1>fast facts</h1>';
		fastfacts[1] = '<p>Copy for Fast Fact 2</p><h1>fast facts</h1>';  
		fastfacts[2] = '<p>Copy for Fast Fact 3</p><h1>fast facts</h1>'; 
		fastfacts[3] = '<p>Copy for Fast Fact 4</p><h1>fast facts</h1>';  
		fastfacts[4] = '<p>Copy for Fast Fact 5</p><h1>fast facts</h1>';
			
		fastfactCounted += step;
		
		if(fastfactCounted < 0){
			fastfactCounted = totalFastFact-1;
		}
		if(fastfactCounted >= totalFastFact){
			fastfactCounted = 0;
		}
		
		document.getElementById('lvl_3rdCol_FastFacts').innerHTML = '<div>' + fastfacts[fastfactCounted] + '</div>';	
		//tipCounted++;
	
	}
	//getFastFact(0);