function Bookmark(bookmarkUrl, bookmarkTitle)
{
	if (document.all) window.external.AddFavorite(bookmarkUrl, bookmarkTitle);
}

function SetAsHomepage(obj, homepageUrl)
{
	this.style.behavior = "url(#default#homepage)"; 
	this.setHomePage(homepageUrl);
}

function ChangeImage(image, onSwitch)
{
	if (image && onSwitch >= 0)
	{
		var switchValue = "";
		if (onSwitch == 1) switchValue = "_on";
		var extensionPosition = image.src.toString().lastIndexOf(".");
		var extension = image.src.toString().substring(extensionPosition, image.src.toString().length);
		var newExtensionPosition = 0;
		if (onSwitch == 0) newExtensionPosition = image.src.toString().lastIndexOf("_on.");
		if (newExtensionPosition > 0) extensionPosition = newExtensionPosition;
		var newImage = image.src.toString().substring(0,extensionPosition) + switchValue + extension;

		image.src = newImage;
	}
}

function GetURL(webUrl)
{
	document.location = webUrl;
}
















function CustomOpenNewWin(actionIndex, formId, fieldId)
{
	if (actionIndex >= 0 && formId >= 0 && fieldId > 0)
	{
		var nameOfTheForm = "";
		if (document.forms && document.forms[formId] && document.forms[formId].name)
		{
			var objCurrentForm = document.forms[formId];
			//readOnly = true
			nameOfTheForm = objCurrentForm.name;
			var boxName = "file" + fieldId;
			var objBox = eval("objCurrentForm.file" + fieldId);
			if (objBox)
			{
				var windowFeatures = "width=350,height=230";
				var urlToOpen = "upload.aspx?FormName=" + nameOfTheForm + "&InputBox=" + boxName + "&randomizeName=1";
				if (actionIndex == 1 && objBox.value.length > 0) urlToOpen = "deleteFile.asp?FormName=" + nameOfTheForm + "&InputBox=" + boxName + "&fileToDelete=" + objBox.value;
				if (actionIndex == 1 && objBox.value.length > 0 || actionIndex != 1) OpenNewWin(urlToOpen, windowFeatures);
			}
		}
	}
}

function OpenNewWin(windowUrl, features)
{
	if (windowUrl.length > 0 && features != undefined)
	{
		win = window.open(windowUrl, null, features);
	}
}

function MenuOn(indexer, imageName)
{
	var arrowCell = document.getElementById("arrowCell_" + indexer);
	var arrow = document.getElementById("arrow_" + indexer);
	var txtCell = document.getElementById("txtCell_" + indexer);
	if (arrowCell && arrow && txtCell)
	{
		arrow.src = "img/" + imageName;
		txtCell.style.color = "#be5020";
		//txtCell.className='menuOn';
	}
}

function MenuOff(indexer, imageName)
{
	var arrowCell = document.getElementById("arrowCell_" + indexer);
	var arrow = document.getElementById("arrow_" + indexer);
	var txtCell = document.getElementById("txtCell_" + indexer);
	if (arrowCell && arrow && txtCell)
	{
		arrow.src = "img/" + imageName;
		txtCell.style.color = "white";
		//txtCell.className='menuOff';
	}
}


function HeaderMenuOn(indexer)
{
	var coloredHeaderCel1 = document.getElementById("coloredHeaderCel1_" + indexer);
	var txtHeaderCell = document.getElementById("txtHeaderCell_" + indexer);
	if (coloredHeaderCel1 && txtHeaderCell)
	{
		coloredHeaderCel1.style.background = "white";
		txtHeaderCell.style.background = "#ff0000";
		txtHeaderCell.style.color = "white";
		//txtHeaderCell.className='smallWhite';
	}
}

function HeaderMenuOff(indexer)
{
	var coloredHeaderCel1 = document.getElementById("coloredHeaderCel1_" + indexer);
	var txtHeaderCell = document.getElementById("txtHeaderCell_" + indexer);
	if (coloredHeaderCel1 && txtHeaderCell)
	{
		coloredHeaderCel1.style.background = "#ff0000";
		txtHeaderCell.style.background = "#ffffff";
		txtHeaderCell.style.color = "black";
		//txtHeaderCell.className='smallBlack';
	}
}

function MenuItemOn(itemId)
{
	var itemObj = document.getElementById(itemId);
	if (itemObj)
	{
		itemObj.style.background = "#e37373";
	}
}

function MenuItemOff(itemId)
{
	var itemObj = document.getElementById(itemId);
	if (itemObj)
	{
		itemObj.style.background = "#cc0000";
	}
}

 
