setTimeout("updateCSS()",100);

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 doOpenPopWindow(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=150,top=150,scrollbars=yes,resizable=no,status=no');
}
function doPostBack(Task, Taskid)
{
//alert("hello");
	document.forms[0].task.value = Task;
	document.forms[0].taskid.value = Taskid;
	document.forms[0].submit();
	
	
}
function FormPanel_FireDefaultButton(event, target) 
        {
		
            if ((event.keyCode == 13 || event.which == 13) && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == 'textarea'))) 
            {
            
            doPostBack(target,'');
      
            }
        return true;
        }
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 doOpenWindowWithScrollBar(FileNameWithPath,Title,Width,Height)
{	
	
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=50,top=150,scrollbars=yes,resizable=no');
}
function doOpenWindowWithScrollBar1(FileNameWithPath,Title,Width,Height)
{	
	
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=250,top=150,scrollbars=yes,resizable=yes');
}
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 doOpenPopWindow1(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=90,top=80,scrollbars=yes,resizable=yes,status=no');
}
function doOpenHelp(sFileName)
{
	doOpenWindowWithScrollBar('HelpFrame.html','Help',442,350);
}
function doOpenNotes(sFileName)
{
	doOpenWindowWithScrollBar('Notes_frame.asp','Notes',442,390);
}
function doOpenDelete(sFileName)
{
	doOpenWindowWithScrollBar('Delete_frame.asp','Delete',400,250);
}

function doOpenBrowse(sFileName)
{
	doOpenWindowWithScrollBar('Browse_frame.asp','Browse',600,500);
}

function doOpenBrowse2(sFileName)
{
	doOpenWindowWithScrollBar('Browse_frame2.asp','Browse',600,500);
}
//left frame functions 


function clickOccured()
{
	if(document.forms[0].searchtxt.value.toUpperCase() == "ENTER NEW SEARCH TERM" || document.forms[0].searchtxt.value.toUpperCase() == "ENTER A SEARCH TERM")
	{
		document.forms[0].searchtxt.value = "";
	}
	
}

function blurOccured()
{
	if(document.forms[0].searchtxt.value.toUpperCase() == "ENTER NEW SEARCH TERM" || document.forms[0].searchtxt.value.toUpperCase() == "")
	{
		document.forms[0].searchtxt.value = "Enter New Search Term";
	}

}
function blurOccured1()
{
	if(document.forms[0].searchtxt.value.toUpperCase() == "ENTER A SEARCH TERM" || document.forms[0].searchtxt.value.toUpperCase() == "")
	{
		document.forms[0].searchtxt.value = "Enter a Search Term";
	}
}


//function for clear text area in notes page
function clickOccured2()
		{
				sNotesStr = document.forms[0].textarea1.value;
				sNotesStr = unescape(sNotesStr);
				if(sNotesStr.toUpperCase() == "TO ADD A NOTE TO THIS FAVORITE SELECT THIS TEXT AND TYPE OVER IT OR JUST CLICK OK.")
				{								
					document.forms[0].textarea1.value = "";
				}	
			}

	function blurOccured3()
			{
				sNotesStr = unescape(document.forms[0].textarea1.value);			

				if(sNotesStr.toUpperCase() == "")
				{
					document.forms[0].textarea1.value = "To add a note to this favorite select this text and type over it or just click ok.";
				}	

			}
//end of function

		
		//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


