/* * * * * * * * * * * * *
 *   Utility Functions   *
 * * * * * * * * * * * * */

 function FP_openNewWindow(w,h,nav,loc,sts,menu,scroll,resize,name,url) {//v1.0
	var windowProperties=''; if(nav==false) windowProperties+='toolbar=no,'; else
	windowProperties+='toolbar=yes,'; if(loc==false) windowProperties+='location=no,';
	else windowProperties+='location=yes,'; if(sts==false) windowProperties+='status=no,';
	else windowProperties+='status=yes,'; if(menu==false) windowProperties+='menubar=no,';
	else windowProperties+='menubar=yes,'; if(scroll==false) windowProperties+='scrollbars=no,';
	else windowProperties+='scrollbars=yes,'; if(resize==false) windowProperties+='resizable=no,';
	else windowProperties+='resizable=yes,'; if(w!="") windowProperties+='width='+w+',';
	if(h!="") windowProperties+='height='+h; if(windowProperties!="") 
	{
		if( windowProperties.charAt(windowProperties.length-1)==',')
			windowProperties=windowProperties.substring(0,windowProperties.length-1); 
	}
	window.open(url,name,windowProperties);
}
 
// String.startsWith implementation
function String_startsWith(testStr)
{
	if (this.length < testStr.length)
		return false;
	else if (this.length == testStr.length)
		return ((this == testStr) ? true : false);
	else {
		temp = this.substring(0, testStr.length);
		return ((temp == testStr) ? true : false);
	}
}


// String.endsWith implementation
function String_endsWith(testStr)
{
	if (this.length < testStr.length)
		return false;
	else if (this.length == testStr.length)
		return ((this == testStr) ? true : false);
	else {
		temp = this.substring(this.length - testStr.length);
		return ((temp == testStr) ? true : false);
	}
}


/* * * * * * * * * * * * * *
 *   Used By               *
 * RadPanelBar (Left Menu) *
 * * * * * * * * * * * * * */
 
var itemWasExpanded = false;

////Commented out in order to remove excessive animation
//function LeftMenuClicking(sender, eventArgs)
//{
//itemWasExpanded = eventArgs.Item.Expanded;
//}    

//function OnClientItemClickedHandler(sender, eventArgs)
//{           
//if(itemWasExpanded)
//    eventArgs.Item.Collapse();
//}

// attach implementation functions to methods
String.prototype.startsWith = String_startsWith;
String.prototype.endsWith = String_endsWith;


