document.onLoad = updateCSS();

function getSearchAsArray(sQuery) {
	   
		var results = new Array()
			var sQueryValue = ""
		var input = unescape(location.search.substr(1))
		if (input) {
			var srchArray = input.split("&")
			var tempArray = new Array()
			for (var i = 0; i < srchArray.length; i++) {
				tempArray = srchArray[i].split("=")
				results[tempArray[0]] = tempArray[1]
				if(sQuery == tempArray[0])
				{
					sQueryValue = tempArray[1];
				}
			}
		}
		
		return sQueryValue;
}

function updateCSS()
{
	sUpdatedCSSName = getSearchAsArray("updateCSS");

	if(sUpdatedCSSName != "")
	{
		//alert(sUpdatedCSSName);
		var oObj = document.getElementsByTagName("link");
		//alert(oObj[0].getAttribute("href"));
		oObj[0].setAttribute("href",sUpdatedCSSName,0);
	}
}



	function swapImage(imageNumber)
		{
				switch(imageNumber)
				{
					//Case 1 - 7 used in LeftFrame.aspx - By Sunita on 2006 05 16 03 02 PM
					case 1:
					document.forms[0].img1.src = "../Player Files/images/checkyourunder_MO.jpg";
					break;
					case 2:
					document.forms[0].img2.src = "../Player Files/images/browrescbychap_MO.jpg";
					break;
					case 3:
					document.forms[0].img3.src = "../Player Files/images/searchrescbytop_MO.jpg";
					break;
					case 4:
					document.forms[0].img4.src = "../Player Files/images/accessurfav_MO.jpg";
					break;
					case 5:
					document.forms[0].img5.src = "../Player Files/images/view_posted_course_contentH.jpg";
					break;
					case 6:
					document.forms[0].img6.src = "../Player Files/images/access_lib_MO.JPG";
					break;
					case 7:
					document.forms[0].img7.src = "../Player Files/images/view_gradebook_MO.JPG";
					break;
					case 9:
					document.forms[0].img9.src = "../Player Files/images/mim_browrescbychap_MO.JPG";
					break;
					
					//Case 15 - 17 used in BottomFrame.aspx - By Sunita on 2006 05 16 03 02 PM
					case 15:
					document.forms[0].img1.src = "../Player Files/images/help_MO.jpg";
					break;
					case 16:
					document.forms[0].img2.src = "../Player Files/images/update_ur_profile_MO.jpg";
					break;
					case 17:
					document.forms[0].img3.src = "../Player Files/images/log_off_MO.jpg";
					break;
				}
		}
		function restoreImage(imageNumber)
		{
			switch(imageNumber)
			{
				//Case 1 - 7 used in LeftFrame.aspx - By Sunita on 2006 05 16 03 02 PM
				case 1:
				document.forms[0].img1.src = "../Player Files/images/checkyourunder.jpg";
				break;
				case 2:
				document.forms[0].img2.src = "../Player Files/images/browrescbychap.jpg";
				break;
				case 3:
				document.forms[0].img3.src = "../Player Files/images/searchrescbytop.jpg";
				break;
				case 4:
				document.forms[0].img4.src = "../Player Files/images/accessurfav.jpg";
				break;
				case 5:
				document.forms[0].img5.src = "../Player Files/images/view_posted_course_content.jpg";
				break;
				case 6:
				document.forms[0].img6.src = "../Player Files/images/access_lib.JPG";
				break;
				case 7:
				document.forms[0].img7.src = "../Player Files/images/view_gradebook.JPG";
				break;
				case 9:
				document.forms[0].img9.src = "../Player Files/images/mim_browrescbychap.JPG";
				break;				
				//Case 15 - 17 used in BottomFrame.aspx - By Sunita on 2006 05 16 03 02 PM
				case 15:
				document.forms[0].img1.src = "../Player Files/images/help.jpg";
				break;
				case 16:
				document.forms[0].img2.src = "../Player Files/images/update_ur_profile.jpg";
				break;
				case 17:
				document.forms[0].img3.src = "../Player Files/images/log_off.jpg";
				break;
			}
		}
	function doPostBack(task,taskid)
{
	document.forms[0].task.value=task
	document.forms[0].taskid.value=taskid
	document.forms[0].submit()
}
function doOpenPopWindow1(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=250,top=150,scrollbars=yes,resizable=yes,status=no');
}
function doOpenPopWindow2(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=150,top=150,scrollbars=yes,resizable=yes,status=no');
}
function doOpenPopWindow(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=250,top=150,scrollbars=no,resizable=no,status=no');
}
function doOpenPopWindow3(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=50,top=50,scrollbars=no,resizable=no,status=no');
}
function doOpenWindowWithScrollBar(FileNameWithPath,Title,Width,Height)
{	
	
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=50,top=50,scrollbars=yes,resizable=yes');
}

function doOpenWindowWithScrollBar_02(FileNameWithPath,Title,Width,Height)
{	
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=50,top=50,scrollbars=yes,resizable=no');
}
function doOpenWindow(FileNameWithPath,Title)
{	
	window.open(FileNameWithPath,Title,'width=800,height=600,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}
function getQueryStringItem() 
{
	var sResult = new Array()
	var sQuery = unescape(location.search.substr(1))
	var sSearch = sQuery.split("&")
	var sTempArr = new Array()
	for (var iCounter = 0; iCounter < sSearch.length; iCounter++)
	{
		sTempArr = sSearch[iCounter].split("=")
		sResult[sTempArr[0]] = sTempArr[1]
	}
	return sResult
}

	//print function for all browser
	
	var detect = navigator.userAgent.toLowerCase();
	var OS,browser,version,total,thestring;

	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}
	if (checkIt('msie'))
		browser = "Internet Explorer";
	if (checkIt('win'))  
		OS = "Windows";

	function checkForIEWin()
	{
		if(OS == "Windows" && browser == "Internet Explorer")
		return true;
	}

	//alert(checkForIEWin());

	function doPrint()
	{
		if (checkForIEWin())
		{
			parent.mainFrame.focus();
			window.print();
		}
		else
		{
			parent.print();
		}
	}
	//print function for all browser end