function searchclicked()
{
	window.document.all["tdsearch"].className = "searchbkg"
	window.document.all["imgfiltercollapsed"].src= "Images/FilterExpanded.gif"
	
	if (window.document.all["searchmain"].style.display == "")
		{
			window.document.all["searchmain"].style.display = "none"
			window.document.all["imgfiltercollapsed"].src= "Images/FilterCollapsed.gif"
		}	
	else
		window.document.all["searchmain"].style.display = ""	
}	

function searchclicked_admin()
{
	window.document.all["tdsearch"].className = "searchbkg"
	window.document.all["imgfiltercollapsed"].src= "../Images/FilterExpanded.gif"
	
	if (window.document.all["searchmain"].style.display == "")
		{
			window.document.all["searchmain"].style.display = "none"
			window.document.all["imgfiltercollapsed"].src= "../Images/FilterCollapsed.gif"
		}	
	else
		window.document.all["searchmain"].style.display = ""	
}	

function CreateNew(surl)
{	
	if(window.document.all["hdmemberType"].value == 2) 
	{
		alert("You are a Guest Member. You do not have the Right to submit content. Please become Permanent Member to avail this facility.");
	}
	else if(window.document.all["hdmemberType"].value == 3)
	{
		alert("You are a Temporary Member. You do not have the Right to submit content. Please become Permanent Member to avail this facility.");
	}
	else
	{	
	window.location.href=surl;
	}
}

function DetailSave()
{
	setformobject();
	setgenvariable();
	if (validateForm(j_objform) == -1)
	{	
		if ((j_mode == "add") || (j_mode== ""))
			j_objform.g_hd_submitmode.value = "savenew";
		else
			j_objform.g_hd_submitmode.value = "savechg";
			
		j_objform.submit();

	}
	return false;
	
}

//Function for MessageAdmin.aspx to send email
function DetailSaveEmail()
{	
	setformobject();
	setgenvariable();
	if (validateForm(j_objform) == -1)
	{	
		if(confirm("Are You sure to send this email."))
		{
			if ((j_mode == "add") || (j_mode== ""))
				j_objform.g_hd_submitmode.value = "savenew";
			else
				j_objform.g_hd_submitmode.value = "savechg";
				
			j_objform.submit();
		}

	}
	return false;
}

//Function for Survey Ques
function DetailSaveSurvey()
{
	setformobject();
	setgenvariable();
	if (validateForm(j_objform) == -1)
	{	
		if (PageValidations())
			{	
				if ((j_mode == "add") || (j_mode== ""))
					j_objform.g_hd_submitmode.value = "savenew";
				else
					j_objform.g_hd_submitmode.value = "savechg";
					
				j_objform.submit();
			}
	}
	return false;	
}

function DetailModify(sUrl)
{
	var selrow;
	selrow = rowselected();
	//passing primary key in querystring to get the detail data
	j_pk_name = window.document.all["g_hd_pk"].value
	sUrl = sUrl + "?"+selrow;
	window.location.href=sUrl;
}


//Function to call the Disclaimer page
function Disclaimer() 
{	
	window.open("../iscr_downloads/disclaimer.asp","Disclaimer","height=350,width=480,resizable=0");
}

function SubmitResource(sVar)
{
	if(window.document.all["hdmemberType"].value == 2) 
	{
		alert("You are a Guest Member. You do not have the Right to submit content. Please become Permanent Member to avail this facility.");
	}
	else if(window.document.all["hdmemberType"].value == 3)
	{
		alert("You are a Temporary Member. You do not have the Right to submit content. Please become Permanent Member to avail this facility.");
	}
	else
	{
		window.location.href=sVar;
	}
}

function DiscussionForum()
{
	alert("Under Construction");
}

function BackToList(surl)
{
	window.location.href = surl;
	
}
// --------------------------------------
// Initializes page
// --------------------------------------	
function DoResize() {
	// set global variables
	// spacers
	objSpacerLeftNav = document.getElementById("spacerLeftNav");
	objSpacerContent = document.getElementById("spacerContent");
	objSpacerHelpNav = document.getElementById("spacerHelpNav");
	// frames
	objFraLeftNav    = document.getElementById("fraLeftNav");
	objFraContent    = document.getElementById("fraContent");
	objFraHelpNav    = document.getElementById("fraHelpNav");
	// misc
	objUserNavigation = document.getElementById("userNavigation");
	objCover         = document.getElementById("coverSpace");
	objDividerLeft   = document.getElementById("dividerLeft");
	objDividerRight  = document.getElementById("dividerRight");
	objGutterLeft    = document.getElementById("gutterLeft");
	objGutterRight   = document.getElementById("gutterRight");
	
	var NS = (navigator.appName=="Netscape")?true:false;
	//subtracting 8 appears to create the right border size on the right - EJW - 6/22/2004
	objUserNavigation.style.width = ((NS)?window.innerWidth:document.body.clientWidth) - 8;
	
	objSpacerContent.style.width = objUserNavigation.offsetWidth - Math.round(.30 * objUserNavigation.offsetWidth) - 44;
	if(objSpacerHelpNav.style.display != "none")
	{
		objSpacerContent.style.width = 
			objUserNavigation.offsetWidth - Math.round(.30 * objUserNavigation.offsetWidth) - 44;
	}
	else
	{	
		objSpacerContent.style.width =
			objUserNavigation.offsetWidth - Math.round(.15 * objUserNavigation.offsetWidth) - 44;
	}
	
	// resize/reposition (adjust 2px for border)
	// left navigation panel
	if(objSpacerLeftNav.style.display != "none") 
	{
		objFraLeftNav.style.top    = objSpacerLeftNav.offsetTop + "px";
		objFraLeftNav.style.left   = objSpacerLeftNav.offsetLeft + "px";
		objFraLeftNav.style.width  = objSpacerLeftNav.offsetWidth + "px";
		objFraLeftNav.style.height = (objSpacerLeftNav.offsetHeight - 2) + "px";
	}
	
	// workspace panel
	objFraContent.style.top    = objSpacerContent.offsetTop + "px";
	objFraContent.style.left   = objSpacerContent.offsetLeft + "px";
	objFraContent.style.width  = parseInt(objSpacerContent.offsetWidth)+ 6 + "px";
	objFraContent.style.height = (objSpacerContent.offsetHeight - 2) + "px";
	// help navigation panel
	
	if(objSpacerHelpNav.style.display != "none")
	 {
		objFraHelpNav.style.top    = objSpacerHelpNav.offsetTop + "px";
		objFraHelpNav.style.left   = objSpacerHelpNav.offsetLeft + "px";
		objFraHelpNav.style.width  = (objSpacerHelpNav.offsetWidth - 2) + "px";
		objFraHelpNav.style.height = (objSpacerHelpNav.offsetHeight - 2) + "px";
	}
	
	// show left nav, content frames
	objFraLeftNav.style.visibility = "visible";
	objFraContent.style.visibility = "visible";
}

// --------------------------------------
// Resizes left navigation panel.
// --------------------------------------
function ResizeNav(e) {
	var objEvent = (!e) ? window.event : e;
	if(blnIsResizingNav) {
		intNewWidth = intOldWidth + objEvent.clientX - intOldXCoord;
		if(intNewWidth > MIN_LEFTNAV_WIDTH)
		{
			if((objUserNavigation.offsetWidth - 44 - intNewWidth) <= MIN_CONTENT_WIDTH)
			{
				intNewWidth = objUserNavigation.offsetWidth - 44 - MIN_CONTENT_WIDTH;
			}
		}
		else
		{
			intNewWidth = MIN_LEFTNAV_WIDTH;
		}
		
		// resize left nav area
		objSpacerLeftNav.style.width = (intNewWidth) + "px";
		objFraLeftNav.style.width = (intNewWidth) + "px";
		
		if(objSpacerHelpNav.style.display != "none")
		{
			objSpacerContent.style.width = 
				(objUserNavigation.offsetWidth - intNewWidth - offsetSpacerHelpNav.offsetWidth - 8) + "px";
		}
		else
		{	
			objSpacerContent.style.width =
				(objUserNavigation.offsetWidth - intNewWidth - 8) + "px";
		}
	
		// resize content area
		objFraContent.style.left = objSpacerContent.offsetLeft + "px";
		objFraContent.style.width = (objSpacerContent.offsetWidth) + "px";
	}
}

// --------------------------------------
// Hides the context menu
// --------------------------------------
function HideContextMenu()
 {
	if(window.top.document.getElementById("_objContextMenu"))
		window.top.document.getElementById("_objContextMenu").style.visibility = "hidden";
	if(window.top.document.getElementById("_objFraContextMenu"))
		window.top.document.getElementById("_objFraContextMenu").src = "/blank.html";
}

// --------------------------------------
// ResizeScrollableArea
// --------------------------------------	
function DashBoard_ResizeScrollableArea() {
	try
	{
		objUserNavigation = window.top.document.getElementById("userNavigation");
		objSpacerContent = window.top.document.getElementById("spacerContent");
		objScrollableArea = document.getElementById("scrollableArea");
		objScrollableArea.style.height = parseInt(objSpacerContent.offsetHeight)-2 + "px";
		objScrollableArea.style.width = parseInt(objSpacerContent.offsetWidth) + 5 + "px";
	}
	catch (e)
	{
		/* do nothing */
	}
}

// --------------------------------------
// ResizeScrollableArea
// --------------------------------------	
function ResizeScrollableArea() {
	try
	{
		objUserNavigation = window.top.document.getElementById("userNavigation");
		objSpacerContent = window.top.document.getElementById("spacerContent");
		objScrollableArea = document.getElementById("scrollableArea");
		objScrollableArea.style.height = parseInt(objSpacerContent.offsetHeight)-80 + "px";
		objScrollableArea.style.width = parseInt(objSpacerContent.offsetWidth) + 5 + "px";
	}
	catch (e)
	{
		/* do nothing */
	}
}


// --------------------------------------
// left Menu ResizeScrollableArea
// --------------------------------------	
function Left_ResizeScrollableArea() 
{
	try
	{
		objLeftNav = window.top.document.getElementById("spacerLeftNav");
		objScrollableArea = document.getElementById("left_scrollableArea");
		objScrollableArea.style.height = objLeftNav.offsetHeight + "px";
		objScrollableArea.style.width = objLeftNav.offsetWidth + "px";
	}
	catch (e)
	{
		/* do nothing */
	}
}

var selLinkID = "";
var selLinkImg = "";
function LinkMouseClick(id,imgid)
{
	if (window.document.getElementById(id).style.display == "none")
	{
		window.document.getElementById(id).style.display = ""	
		window.document.getElementById(imgid).src = "images/minus.jpg";
		
		if (selLinkImg != "")
		{
			if (selLinkID != id)
				window.document.getElementById(selLinkID).style.display = "none"	
			if (selLinkImg != imgid)
				window.document.getElementById(selLinkImg).src = "images/plus1.gif";
		}
		selLinkImg = window.document.getElementById(imgid).id
		selLinkID = window.document.getElementById(id).id
	}
	else
	{
		window.document.getElementById(id).style.display = "none"	
		window.document.getElementById(imgid).src = "images/plus1.gif";
	}
}

function LinkMouseClicked(id,imgid)
{
	if (window.document.getElementById(id).style.display == "none")
	{
		window.document.getElementById(id).style.display = ""	
		window.document.getElementById(imgid).src = "../images/listimage.jpg";
		
		if (selLinkImg != "")
		{
			if (selLinkID != id)
				window.document.getElementById(selLinkID).style.display = "none"	
			if (selLinkImg != imgid)
				window.document.getElementById(selLinkImg).src = "../images/listimage.jpg";
		}
		selLinkImg = window.document.getElementById(imgid).id
		selLinkID = window.document.getElementById(id).id
	}
	else
	{
		window.document.getElementById(id).style.display = "none"	
		window.document.getElementById(imgid).src = "../images/listimage.jpg";
	}
}