//changes the image of tagImage to what is in strImageSrc
function changeImage(tagImage,strImageSrc)
{
	//gets the properties of tagImage
	tagImage = getDocID(tagImage);
	
	//checks if there is a properties
	if(tagImage != null)
		tagImage.src = strImageSrc;
}//end of changeImage()

//checks which if the browser version * Funciton ONLY for this *
function checkBroswer(tagImage,strImageSrc,boolStuEdu,strAltSrc)
{	
	//for the Safari for the Mac 
	if (navigator.userAgent.indexOf('Safari') !=-1 && navigator.platform.indexOf("Mac") > -1)
	{
		if(boolStuEdu == true)
			changeImage(tagImage,strAltSrc);
		else
			changeImage(tagImage,strAltSrc);
	}//end of if
	else
		changeImage(tagImage,strImageSrc);		
}//end of checkBroswer()

//gets the document properties in order to use them as there are many types of browers with different versions
function getDocID(whichLayer)
{
	var layerProp = ''//holds the proerties of whichLayer

	//gets the whichLayer Properties depending of the differnt bowers the user is using
	if (document.getElementById)//this is the way the standards work
				layerProp = document.getElementById(whichLayer);
	else if (document.all)//this is the way old msie versions work
				layerProp = document.all[whichLayer];
	else if (document.layers)//this is the way nn4 works
				layerProp = document.layers[whichLayer];
				
	return layerProp;
}//end of getDocID()

//starts up the page
function startUp()
{
	var oldonload=window.onload;//holds any prevs onload function from the js file

	//gets the onload window event checks if there is a function that is already in there
	window.onload=function(){
		if(typeof(oldonload)=='function')
			oldonload();
					
		//finds which browser the user is using for Firefox it is the defult
		//for IE 
		if (navigator.userAgent.indexOf('MSIE') != -1)
		{  
			var tagHomeButton = getDocID('divHomeButton');
					
			//for IE 7
			//checks if there the version of is 7
			if (navigator.appVersion.indexOf('MSIE 7') !=-1)
			{
				var tagIECannotRenderHome = getDocID('IECannotRenderHome');//hold the home div of the main
								
				//checks if the page is the home page for the Student and Edu
				if(tagIECannotRenderHome != null)
				{
					tagIECannotRenderHome.style.marginRight = "215px";
					tagIECannotRenderHome.style.right = "-1px";
				}//end of if
				
				//checks if the page is the other pages
				if(tagHomeButton != null)
				{
					tagHomeButton.style.marginLeft = "-1000px";
				}//end of if
			}//end of if
			//for IE6
			//checks if there the version of is 6
			if (navigator.appVersion.indexOf('MSIE 6') !=-1)
			{
				var tagHeader = getDocID('header2');
				var tagHeader11 = getDocID('header11');
				var tagMainHeader = getDocID('divMainHeader');
				var tagLeftSideBG = getDocID('tdLeftSideBG');
				var tagStugo = getDocID('stugo');
				var tagEdugo = getDocID('edugo');
				var tagChallengeHeader = getDocID('imgChallengeHeader');
				var tagStuHeader = getDocID('imgStuHeader');
				var tagEduHeader = getDocID('imgEduHeader');
				var tagEduTool = getDocID('imgEduTool');
				var tagEduSignOn = getDocID('imgSignOn');
				var tagMarkHeader = getDocID('imgMarkHeader');
				var tagPrivacyHeader = getDocID('imgPrivacyHeader');
				var tagLinksHeader = getDocID('imgLinksHeader');
				var tagLegalHeader = getDocID('imgLegalHeader');
				var tagContactHeader = getDocID('imgContactHeader');
				var tagHomeFooter = getDocID('divHomeFooter');
				var tagSubmit = getDocID('cmbSubmit');
				var tagHCLogo = getDocID('imgHCLogo');
				var tagHCHomeLogo = getDocID('imgHCHomeLogo');

				//checks if the page is the other pages
				if(tagHCLogo != null)
				{
					tagHCLogo.height = "92";
				}//end of if
				
				//checks if the page is the home pages
				if(tagMainHeader != null)
				{
					tagMainHeader.style.marginBottom = "-5px";
				}//end of if
				
				//checks if the page is the other pages
				if(tagSubmit != null)
				{
					tagSubmit.src = "../images/submit.gif";
				}//end of if
				
				//checks if the page is the other pages
				if(tagHomeFooter != null)
				{
					tagHomeFooter.style.paddingLeft = "120px";
				}//end of if
				
				//checks if the page is the other pages
				if(tagLeftSideBG != null)
				{
					tagLeftSideBG.style.paddingTop = "200px";
					tagLeftSideBG.height = "625";
				}//end of if
				
				//checks if the page is the other pages
				if(tagHomeButton != null)
				{
					tagHomeButton.style.marginLeft = "-1000px";
					//tagHomeButton.style.marginRight = "-1000px";
				}//end of if
				
				//checks if the page is the Contact page
				if(tagContactHeader != null)
				{
					tagContactHeader.src = "images/HEADING-contact.gif";
				}//end of if
				
				//checks if the page is the Legal page
				if(tagLegalHeader != null)
				{
					tagLegalHeader.src = "images/HEADING-legal.gif";
				}//end of if
				
				//checks if the page is the Links page
				if(tagLinksHeader != null)
				{
					var tagLinksRightSide = getDocID('tdLinksRightSide');
					
					tagLinksRightSide.style.backgroundImage = "url(images/links_rightsidebg.gif)";
					tagLinksHeader.src = "images/HEADING-links.gif";
				}//end of if
				
				//checks if the page is the Privacy page
				if(tagPrivacyHeader != null)
				{
					tagPrivacyHeader.src = "images/HEADING-privacy.gif";
				}//end of if
					
				//checks if the page is the home page
				if(tagStugo != null)
				{
					var tagMainReal = getDocID('header11');
					
					//tagStugo.src = "images/HOME-4stuGo.gif";
					//tagEdugo.src = "images/HOME-4eduGo.gif";
					tagMainReal.marginTop = "5px;";
				}//end of if
				
				//checks if the page is the Challenge page
				if(tagChallengeHeader != null)
				{
					var tagRightside = getDocID('tdRightside');
					
					tagRightside.style.backgroundImage = "url(../images/challenge_rightsidebg.gif)";
					tagChallengeHeader.src = "../images/HEADING-challenge.gif";
				}//end of if
				
				//checks if the page is the Student page
				if(tagStuHeader != null)
				{
					tagStuHeader.src = "../images/HEADING-students.gif";
				}//end of if
				
				//checks if the page is the Educatiors Tool
				if(tagEduTool != null)
				{
					tagEduTool.src = "../images/HEADING-tools.gif";
				}//end of if
				
				//checks if the page is the Educatiors SignOn
				if(tagEduSignOn != null)
				{
					tagEduSignOn.src = "../images/HEADING-signon.gif";
				}//end of if
				
				//checks if the page is the Educatiors
				if(tagEduHeader != null)
				{
					tagEduHeader.src = "../images/HEADING-educators.gif";
				}//end of if
				
				//checks if the page is Make Your Mark
				if(tagMarkHeader != null)
				{
					var tdMarkRightSide = getDocID('tdMarkRightSide');
					
					tdMarkRightSide.style.backgroundImage = "url(../images/mark_rightsidebg.gif)";
					tagMarkHeader.src = "../images/HEADING-mark.gif";
				}//end of if
			}//end of if
		}//end of if
		//for Safari and Mac
		else if (navigator.userAgent.indexOf('Safari') !=-1 || navigator.platform.indexOf("Mac") > -1)
		{		
			var tagStugo = getDocID('stugo');
			var tagEdugo = getDocID('edugo');
		
			//for the Safari for the Mac 
			if (navigator.userAgent.indexOf('Safari') !=-1 && navigator.platform.indexOf("Mac") > -1)
			{
				tagStugo.src = "images/HOME-4stuGo.png";
				tagEdugo.src = "images/HOME-4eduGo.png";
			}//end of if
		}//end of if else
		//for firefox
		else if (navigator.userAgent.indexOf('Firefox') !=-1)
		{
		}//end of if else
		//for Opera
		else if (navigator.userAgent.indexOf('Opera') !=-1)
		{
		}//end of if else          
	}//end of window.onload=function()
}//end of startUp()