﻿if (!window.Renault) window.Renault=new Object();
window.Renault.__namespace=new Boolean(true);
if (!window.Renault.Animation) window.Renault.Animation=new Object();

Renault.Animation.NullTransformation=function(Value) {
	return Value;
}

Renault.Animation.LinearEaseOut=
Renault.Animation.LinearEaseIn=
Renault.Animation.LinearEaseInOut=function(t,b,c,d) {
	return c*t/d+b;
}

Renault.Animation.QuadEaseIn=function(t,b,c,d) {
	return c*(t/=d)*t+b;
}

Renault.Animation.QuadEaseOut=function(t,b,c,d) {
	return -c*(t/=d)*(t-2)+b;
}

Renault.Animation.QuadEaseInOut=function(t,b,c,d) {
	if ((t/=d/2)<1) return c/2*t*t+b;
	return -c/2*((--t)*(t-2)-1)+b;
}

Renault.Animation.CubicEaseIn=function(t,b,c,d) {
	var Result=c*(t/=d)*t*t+b;
	return Result;
}

Renault.Animation.CubicEaseOut=function(t,b,c,d) {
	var Result=c*((t=t/d-1)*t*t+1)+b;
	return Result;
}

Renault.Animation.CubicEaseInOut=function(t,b,c,d) {
	if ((t/=d/2)<1) return c/2*t*t*t+b;
	return c/2*((t-=2)*t*t+2)+b;
}

Renault.Animation.QuarticEaseIn=function(t,b,c,d) {
	return c*(t/=d)*t*t*t+b;
}

Renault.Animation.QuarticEaseOut=function(t,b,c,d) {
	return -c*((t=t/d-1)*t*t*t-1)+b;
}

Renault.Animation.QuarticEaseInOut=function(t,b,c,d) {
	if ((t/=d/2)<1) return c/2*t*t*t*t+b;
	return -c/2*((t-=2)*t*t*t-2)+b;
}

Renault.Animation.QuinticEaseIn=function(t,b,c,d) {
	return c*(t/=d)*t*t*t*t+b;
}

Renault.Animation.QuinticEaseOut=function(t,b,c,d) {
	return c*((t=t/d-1)*t*t*t*t+1)+b;
}

Renault.Animation.QuinticEaseInOut=function(t,b,c,d) {
	if ((t/=d/2)<1) return c/2*t*t*t*t*t+b;
	return c/2*((t-=2)*t*t*t*t+2)+b;
}

Renault.Animation.SinEaseIn=function(t,b,c,d) {
	return -c*Math.cos(t/d*(Math.PI/2))+c+b;
}

Renault.Animation.SinEaseOut=function(t,b,c,d) {
	return c*Math.sin(t/d*(Math.PI/2))+b;
}

Renault.Animation.SinEaseInOut=function(t,b,c,d) {
	return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
}

Renault.Animation.ExpEaseIn=function(t,b,c,d) {
	return (t==0?b:c)*Math.pow(2,10*(t/d-1))+b;
}

Renault.Animation.ExpEaseOut=function(t,b,c,d) {
	return (t==d?b+c:c)*(-Math.pow(2,-10*t/d)+1)+b;
}

Renault.Animation.ExpEaseInOut=function(t,b,c,d) {
	if (t==0) return b;
	if (t==d) return b+c;
	if ((t/=d/2)<1) return c/2*Math.pow(2,10*(t-1))+b;
	return c/2*(-Math.pow(2,-10*--t)+2)+b;
}

Renault.Animation.CircularEaseIn=function(t,b,c,d) {
	return -c*(Math.sqrt(1-(t/=d)*t)-1)+b;
}

Renault.Animation.CircularEaseOut=function(t,b,c,d) {
	return c*Math.sqrt(1-(t=t/d-1)*t)+b;
}

Renault.Animation.CircularEaseInOutCirc=function(t,b,c,d) {
	if ((t/=d/2)<1) return -c/2*(Math.sqrt(1-t*t)-1)+b;
	return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;
}

Renault.Animation.Animate=function(ID,Property,Type,Direction,Format,Interval,InitialValue,StopValue,Steps,OnCompleted,Transformation)
{
	if ((window.document.readyState==undefined)||(window.document.readyState==false)) return;
	var Element=document.getElementById(ID);
	//var debugDiv = document.getElementById('flashcontent');
	var PropertyPath=Property.split('.');
	if (!Element.animatedProperties)
		Element.animatedProperties=new Object();
	var PropertyValue=Element[PropertyPath[0]];
	for (var Index=1; Index<PropertyPath.length-1; Index++)
		PropertyValue=PropertyValue[PropertyPath[Index]];
	
	if (InitialValue!=undefined || InitialValue!=null)
	{
		if ((Transformation==undefined)||(Transformation==null))
			Transformation=Renault.Animation.NullTransformation;
		Element.animatedProperties[Property.replace(".","_")]=new Object();
		Element.animatedProperties[Property.replace(".","_")].animationParameters=new Object();
		Element.animatedProperties[Property.replace(".","_")].animationParameters.t=0;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.b=InitialValue;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.c=StopValue;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.d=Steps;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.i=Interval;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.id=ID;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.direction=Direction;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.transformation=Transformation;
		Element.animatedProperties[Property.replace(".","_")].animationParameters.oncompleted=OnCompleted;
	}
	
	
	if (Element.animatedProperties[Property.replace(".","_")]!=null)
	{
	    var EndDirection = Element.animatedProperties[Property.replace(".","_")].animationParameters.direction;
		if (Element.animatedProperties[Property.replace(".","_")].animationParameters.t<=
			Element.animatedProperties[Property.replace(".","_")].animationParameters.d)
		{
			if(Element.animatedProperties[Property.replace(".","_")].animationParameters.direction==Direction)
			{
			    try
			    {
				    PropertyValue[PropertyPath[PropertyPath.length-1]]=Format.replace("{0}",
					    (Direction=='Out'?Element.animatedProperties[Property.replace(".","_")].animationParameters.c:0)+
					    (Direction=='Out'?-1:1)*Element.animatedProperties[Property.replace(".","_")].animationParameters.transformation(
						    Renault.Animation[Type+'Ease'+Direction](
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.t,
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.b,
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.c,
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.d)))
			    }
			    catch (Exception)
			    {
			    }
			    Renault.Animation.debug=false;
			    if (Renault.Animation.debug)
			    {
				    window.status=Format.replace("{0}",
					    (Direction=='Out'?Element.animatedProperties[Property.replace(".","_")].animationParameters.c:0)+
					    (Direction=='Out'?-1:1)*Element.animatedProperties[Property.replace(".","_")].animationParameters.transformation(
						    Renault.Animation[Type+'Ease'+Direction](
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.t,
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.b,
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.c,
						    Element.animatedProperties[Property.replace(".","_")].animationParameters.d)));
			    }
			    Element.animatedProperties[Property.replace(".","_")].animationParameters.t+=1;
			    setTimeout("Renault.Animation.Animate(\""+ID+"\",\""+Property+"\",'"+Type+"','"+Direction+"','"+Format+"',"+Interval+")",Interval);
			}
		}
		else
		{
		    var Status=true;
			var OnCompleted=Element.animatedProperties[Property.replace(".","_")].animationParameters.oncompleted;
			Element.animatedProperties[Property.replace(".","_")].animationParameters.t=null;
			delete Element.animatedProperties[Property.replace(".","_")].animationParameters.t;
			Element.animatedProperties[Property.replace(".","_")]=null;
			delete Element.animatedProperties[Property.replace(".","_")];
			clearTimeout();
			if ((Status)&&(OnCompleted!=undefined)&&(OnCompleted!=null)) OnCompleted({target:Element});
		}
	}
}

if (!window.Renault.Web) Renault.Web=new Object();
window.Renault.Web.__namespace=new Boolean(true);
if (!window.Renault.Web.HttpRequest) Renault.Web.HttpRequest=new Object();
if (!window.Renault.Web.HttpRequest.Browser) Renault.Web.HttpRequest.Browser=new Object();

Renault.Web.HttpRequest.Browser.findPositionX=function(element)
{
	var Position=0;
	if (element.offsetParent)
	{
		Position=element.offsetLeft;
		while (element=element.offsetParent)
			Position+=element.offsetLeft;
	}
	return Position;
}

Renault.Web.HttpRequest.Browser.findPositionY=function(element)
{
	var Position=0;
	if (element.offsetParent)
	{
		Position=element.offsetTop;
		while (element=element.offsetParent)
			Position+=element.offsetTop;
	}
	return Position;
}

Renault.Web.HttpRequest.IsSecuredPage=(window.location.protocol.indexOf("https")!=-1?true:false);
Renault.Web.HttpRequest.Protocol=(Renault.Web.HttpRequest.IsSecuredPage==true?"https://":"http://");
if (navigator.appName=="Microsoft Internet Explorer")
{
	Renault.Web.HttpRequest.Browser.IsIE=true;
}
else
{
	Renault.Web.HttpRequest.Browser.IsIE=false;
	HTMLElement.prototype.contains=function(oElement) {
		if (oElement==this) return true;
		if (oElement==null) return false;
		return this.contains(oElement.parentNode);		
	};
	HTMLElement.prototype.click=function() {
		var evt=this.ownerDocument.createEvent("MouseEvents");
		evt.initMouseEvent("click",true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);
		this.dispatchEvent(evt);
	};
}

Renault.Web.HttpRequest.Browser.isFlash=new Number(0);
if ((navigator.plugins) && (navigator.plugins.length))
{
	if (navigator.plugins["Shockwave Flash"])
	{
		Renault.Web.HttpRequest.Browser.isFlash=1;
		if (navigator.plugins["Shockwave Flash"].description)
			Renault.Web.HttpRequest.Browser.isFlash=parseInt(navigator.plugins["Shockwave Flash"].description.match(/(\d+)\.\d+/)[1].toString());
	}
	if (navigator.plugins["Shockwave Flash 2.0"])
		Renault.Web.HttpRequest.Browser.isFlash=2
}
else if ((navigator.mimeTypes) && (navigator.mimeTypes.length))
{
	if ((navigator.mimeTypes['application/x-shockwave-flash']) && (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin))
		Renault.Web.HttpRequest.Browser.isFlash=1;
}
else
{
	for(var Index=9;Index>=0;Index--)
	{
		try
		{
			var Flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+Index);
			Renault.Web.HttpRequest.Browser.isFlash=Index;
			break;
		}
		catch(e)
		{
		}
	}
}

Renault.Web.HttpRequest.absoluteLeft=function(element)
{
	var Left=0;
	if (element.offsetParent)
	{
		do
		{
			Left+=element.offsetLeft;
		} while (element=element.offsetParent);
	}
	return Left;
}

Renault.Web.HttpRequest.absoluteTop=function(element)
{
	var Top=0;
	if (element.offsetParent)
	{
		do
		{
			Top+=element.offsetTop;
		} while (element=element.offsetParent);
	}
	return Top;
}

Renault.Web.HttpRequest.getElementsByClassName=function(ClassName,UseStrictName)
{
	if (UseStrictName==undefined)
		UseStrictName=false;
	var Result=new Array();
	var Elements=document.getElementsByTagName("BODY")[0].getElementsByTagName("*");
	for (var Index=0; Index<Elements.length; Index++)
	{   
		var Element=Elements[Index];  
		if (((UseStrictName==false)&&(Element.className.indexOf(ClassName)!=-1))||
			((UseStrictName==true)&&(Element.className==ClassName)))
			Result.push(Element);
	}
	return Result;
}
document.getElementsByClassName=Renault.Web.HttpRequest.getElementsByClassName;

if (!window.Renault.Web.UI) Renault.Web.UI=new Object();
if (!window.Renault.Web.UI.WebControls) Renault.Web.UI.WebControls=new Object();
if (!window.Renault.Web.UI.CssStyleCollection) Renault.Web.UI.CssStyleCollection=new Object();

Renault.Web.UI.CssStyleCollection.GetStyleByClassName=function(name,UseStrictName)
{
	if (UseStrictName==undefined)
		UseStrictName=false;
	var Result=null;
	for (var StyleSheet=0;StyleSheet<document.styleSheets.length;StyleSheet++)
	{
		if (Renault.Web.HttpRequest.Browser.IsIE==true)
		{
			try
			{
				for (var Rule=0;Rule<document.styleSheets[StyleSheet].rules.length;Rule++)
				{
					if (((UseStrictName==true)&&(document.styleSheets[StyleSheet].rules[Rule].selectorText==name))||
						((UseStrictName==false)&&(document.styleSheets[StyleSheet].rules[Rule].selectorText.indexOf(name)!=-1)))
						Result=document.styleSheets[StyleSheet].rules[Rule].style;
				}
			}
			catch (Exception)
			{
			}
		}
		else
		{
			try
			{
				for (var Rule=0;Rule<document.styleSheets[StyleSheet].cssRules.length;Rule++)
				{
					if (((UseStrictName==true)&&(document.styleSheets[StyleSheet].cssRules[Rule].selectorText==name))||
						((UseStrictName==false)&&(document.styleSheets[StyleSheet].cssRules[Rule].selectorText.indexOf(name)!=-1)))
						Result=document.styleSheets[StyleSheet].cssRules[Rule].style;
				}
			}
			catch (Exception)
			{
			}
		}
	}
	return Result;
}

Renault.Web.HttpRequest.Browser.OnSectionClick=function(evt,ChangeValidatorsState)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	var Row=Source;
	while (Row.getAttribute("isHeader")==null)
		Row=Row.parentNode;
	if (Row.style.backgroundImage.lastIndexOf("show")!=-1)
		Row.style.backgroundImage=Row.style.backgroundImage.replace("show","hide");
	else
		Row.style.backgroundImage=Row.style.backgroundImage.replace("hide","show");
	var Container=Row;
	while (Container.nodeName.toLowerCase()!="table")
		Container=Container.parentNode;
	while ((Row.rowIndex+1<Container.rows.length)&&(Container.rows[Row.rowIndex+1].getAttribute("isHeader")==null))
	{
		Row=Container.rows[Row.rowIndex+1];
		var RowState=true;
		if (Row.style.display=="")
		{
			Row.style.display="none";
			RowState=false;
		}
		else
		{
			Row.style.display="";
			RowState=true;
		}
		if ((ChangeValidatorsState)&&(ChangeValidatorsState==true))
		{
			var Validators=Row.getElementsByTagName("span");
			for (var Index=0; Index<Validators.length; Index++)
			{
				if (Validators[Index].controltovalidate)
				{
					ValidatorEnable(Validators[Index],RowState);
				}
			}
		}
	}
}

Renault.Web.HttpRequest.Browser.SectionHeaderClick = function() {
    (function($) {
        window.addEvent("domready", function() {
            $$('tr[isHeader=true]').addEvent('click', HeaderClick);
            $$('tr[isHeader=true]').addEvent('mouseenter', Enter);
            $$('tr[isHeader=true]').addEvent('mouseleave', Leave);
            function Enter(Element) {
                $(Element.target).addClass('HoverItem');
            }
            function Leave(Element) {
                $(Element.target).removeClass('HoverItem');
            }
            function HeaderClick(Element) {
                var Header = $(Element.target.parentNode);
                var Next = Header.getNext('tr');
                if (Next!=null && Next.get('isHeader') == null) {
                    if (Header.get('class').indexOf('ActiveBoxHeader') == -1) {
                        Header.addClass('ActiveBoxHeader');
                        Next.setStyle('display', 'block');
                    }
                    else {
                        Header.removeClass('ActiveBoxHeader');
                        Next.setStyle('display', 'none');
                    }
                }
            }
        });
    })(document.id);
}


Renault.Web.HttpRequest.OnKeyUp=function(evt)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	var Key=(evt.keyCode?evt.keyCode:evt.which);
	if ((Key==13)&&(Source.getAttribute("associatedIButtonControl")!=null)&&(Source.getAttribute("associatedIButtonControl")!=""))
	{
		var Submit=document.getElementById(Source.getAttribute("associatedIButtonControl"));
		if (Submit==null)
		{
			Submit=document.getElementsByIdName(Source.getAttribute("associatedIButtonControl"));
			if (Submit.length>0)
				Submit=Submit[0];
			else
				return true;
		}
		if (Submit==null)
			return true;
		if (Submit.click)
			Submit.click();
		else
			__doPostBack(Submit.name,"");
			return false;
	}
	return true;
}

Renault.Web.HttpRequest.Window=new Object()
Renault.Web.HttpRequest.Window.ClientSize=function()
{
	var Client=document.createElement("div");
	Client.style.position="absolute";
	Client.style.width="0px";
	Client.style.height="0px";
	Client.style.right="0px";
	Client.style.bottom="0px";
	document.body.appendChild(Client);
	var Width=Client.offsetLeft+16;
	var Height=Client.offsetTop+14;
	document.body.removeChild(Client);
	return {width:Width,height:Height};
}

Renault.Web.HttpRequest.BuildFlash=function(Url,Width,Height,WMode,Scalling,StaticReplacement)
{
	if ((Width=="auto")||(Height=="auto"))
	{
		if (Url.match(/viewSize=(\d+),(\d+)/gi)!=null)
		{
			var Match=Url.match(/viewSize=(\d+),(\d+)/gi);
			Match=Match[0].toLowerCase().replace("viewsize=","").split(",");
			Width=parseInt(Match[0]);
			Height=parseInt(Match[1]);
		}
		else
		{
			Client=Renault.Web.HttpRequest.Window.ClientSize();
			if (Width=="auto")
				Width=Client.width-16;
			if (Height=="auto")
				Height=Client.height-16;
		}
	}
	if ((Scalling==undefined)||(Scalling==null))
		Scalling="default";
	if (StaticReplacement==undefined)
		StaticReplacement="gif";
	var Result="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\""+Renault.Web.HttpRequest.Protocol+"download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" "+
		"width=\""+Width+"\" height=\""+Height+"\" id=\"flashmov\"><param name=\"allowScriptAccess\" value=\"always\" />"+
		"<param name=\"movie\" value=\""+Url.replace("&amp;","&")+"\" /><param name=\"scale\" value=\""+Scalling+"\" />"+
		"<param name=\"wmode\" value=\""+((WMode!=undefined)&&(WMode!=null)&&(WMode!="")?WMode:"opaque")+"\" /><param name=\"quality\" value=\"high\" />"+
		"<embed src=\""+Url+"\" allowScriptAccess=\"always\" quality=\"high\" pluginspage=\""+Renault.Web.HttpRequest.Protocol+"www.macromedia.com/go/getflashplayer\" "+
		"type=\"application/x-shockwave-flash\" scale=\""+Scalling+"\" width=\""+Width+"\" height=\""+Height+"\" wmode=\""+
		((WMode!=undefined)&&(WMode!=null)&&(WMode!="")?WMode:"opaque")+"\" name=\"flashmov\"></embed></object>";
	if ((Renault.Web.HttpRequest.Browser.isFlash==0)&&(StaticReplacement!=null))
		Result="<img src=\""+Url.replace("swf",StaticReplacement)+"\" style=\"width:"+Width+"px; height:"+Height+"px;\"/>";
	return Result;
}

Renault.Web.HttpRequest.InsertFlash=function(Url,Width,Height,WMode,Scalling,StaticReplacement)
{
	document.write(Renault.Web.HttpRequest.BuildFlash(Url,Width,Height,WMode,Scalling,StaticReplacement));
}

Renault.Web.HttpRequest.ShowImportant=function(Url,Width,Height,ScrollBars)
{
	if (Width==undefined)
		Width=600;
	if (Height==undefined)
		Height=500;
	if (ScrollBars==undefined)
		ScrollBars="1";
	else
	{
		switch (typeof(ScrollBars))
		{
			case "boolean":
			{
				ScrollBars=(ScrollBars==true?"yes":"no");
				break;
			}
			case "number":
			{
				ScrollBars=(ScrollBars>1?"yes":"no");
				break;
			}
			default:
			{
				ScrollBars=((ScrollBars.toString().toLowerCase()=="yes")||(ScriptEngine.toLowerCase().toString()=="true")?"yes":"no");
				break;
			}
		}
	}
	if (Url==undefined)
	{
		if (window.location.href.substr(window.location.href.indexOf(window.location.host)+window.location.host.length).match(/.*cars\/.*/gi)!=null)
			Url=Renault.Web.HttpRequest.Protocol+Renault.Web.HttpRequest.HomeUrl+"cars/finance/importantinformation.aspx";
		else
			Url=Renault.Web.HttpRequest.Protocol+Renault.Web.HttpRequest.HomeUrl+"vans/ownerservices/ewaboutinsurance.aspx";
	}
	window.open(Url,"_blank","menubar=no,status=no,location=no,resizable=no,toolbar=no,scrollbars="+ScrollBars+",width="+Width+",height="+Height+",top=10,left=10");
}

Renault.Web.HttpRequest.CurrencyFormat=function(Amount,DecimalDigits,GroupSeparator,DecimalSeparator,Symbol)
{
	if (DecimalDigits==undefined) DecimalDigits=Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalDigits;
	if (GroupSeparator==undefined) GroupSeparator=Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyGroupSeparator;
	if (DecimalSeparator==undefined) DecimalSeparator=Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator;
	if (Symbol==undefined) Symbol=Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol;
	var Buffer=Amount.toString().split('.',2);
	if (Buffer.length==1)
		Buffer.push("00");
	var Fractional=Buffer[1];
	var Integer=parseInt(Buffer[0]);
	if (isNaN(Integer)) return "";
	var Sign=(Integer<0?"-":"");
	Integer=Math.abs(Integer);
	var Result=new String(Integer);
	var Buffer=new Array();
	while (Result.length>3)
	{
		var Group=Result.substr(Result.length-3);
		Buffer.unshift(Group);
		Result=Result.substr(0,Result.length-3);
	}
	if (Result.length>0) Buffer.unshift(Result);
	Result=Buffer.join(GroupSeparator);
	Amount=Sign+Result+DecimalSeparator;
	switch (Fractional.length)
	{
		case 0:
		{
			Amount+="00";
			break;
		}
		case 1:
		{
			Amount+=Fractional+"0";
			break;
		}
		default:
		{
			Amount+=Fractional.substr(0,DecimalDigits);
			break;
		}
	}
	return Symbol.replace("{0}",Amount);
}

if (!window.Renault) window.Renault=new Object();
if (!window.Renault.Modules) window.Renault.Modules=new Object();
if (!window.Renault.Modules.CommonControls) window.Renault.Modules.CommonControls=new Object();
if (!window.Renault.Modules.CommonControls.Section) window.Renault.Modules.CommonControls.Section=new Object();

Renault.Modules.CommonControls.Section.OnMouseOver=function(evt)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	while ((Source.nodeName.toLowerCase()!="table")&&
		(Source.getAttribute("label")==null))
		Source=Source.parentNode;
	if (Source.nodeName.toLowerCase()=="table")
		return;
	Source.style.cursor="pointer";
}

Renault.Modules.CommonControls.Section.OnMouseOut=function(evt)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	while ((Source.nodeName.toLowerCase()!="table")&&
		(Source.getAttribute("label")==null))
		Source=Source.parentNode;
	if (Source.nodeName.toLowerCase()=="table")
		return;
	Source.style.cursor="auto";
}
	
Renault.Modules.CommonControls.Section.OnClick=function(evt)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	while ((Source.nodeName.toLowerCase()!="table")&&
		(Source.getAttribute("label")==null))
		Source=Source.parentNode;
	if (Source.nodeName.toLowerCase()=="table")
		return;
	while (Source.nodeName.toLowerCase()!="tr")
		Source=Source.parentNode;
	var Container=Source;
	while (Container.nodeName.toLowerCase()!="table")
		Container=Container.parentNode;
	var Cover=null;
	if ((!Container.parentNode.id)||(Container.parentNode.id!=Container.id+"_Cover"))
	{
		var Parent=Container.parentNode;
		var Cover=document.createElement("div");
		Parent.replaceChild(Cover,Container);
		Cover.className="Section";
		Cover.appendChild(Container);
		Cover.id=Container.id+"_Cover";
		Cover.initialValue=Container.scrollHeight;
		Cover.targetValue=Container.rows[0].scrollHeight;
		Cover.style.overflow="hidden";
		Cover.style.height=Container.scrollHeight+"px";
	}
	else
	{
		Cover=Container.parentNode;
		Cover.style.overflow="hidden";
	}
	var InitialValue=Cover.initialValue;
	if ((parseInt(Cover.style.height.replace(/\D/gi,""))>Cover.targetValue)||(Cover.style.height=="auto"))
	{
		Renault.Animation.Animate(Cover.id,"style.height","Cubic","Out","{0}px",10,-Cover.targetValue,Cover.initialValue,50,
			Renault.Modules.CommonControls.Section.OnHideComplete,function(Value) { return Math.round((Value<0?0:Value)); });
	}
	else
	{
		Renault.Animation.Animate(Cover.id,"style.height","Cubic","In","{0}px",10,Cover.targetValue,Cover.initialValue-Cover.targetValue,50,
			Renault.Modules.CommonControls.Section.OnShowComplete,function(Value) { return Math.round((Value<0?0:Value)); });
	}
}

Renault.Modules.CommonControls.Section.OnHideComplete=function(evt)
{
	var Headers=evt.target.getElementsByTagName("div");
	for (var Index=0; Index<Headers.length; Index++)
	{
		if (Headers[Index].getAttribute("label")!=null)
		{
			Headers[Index].className="Show";
			break;
		}
	}
}

Renault.Modules.CommonControls.Section.OnShowComplete=function(evt)
{
	var Headers=evt.target.getElementsByTagName("div");
	for (var Index=0; Index<Headers.length; Index++)
	{
		if (Headers[Index].getAttribute("label")!=null)
		{
			Headers[Index].className="Hide";
			break;
		}
	}
	evt.target.style.overflow="visible";
	evt.target.style.height="auto";
}

if (!window.Renault) window.Renault=new Object();
if (!window.Renault.Web) window.Renault.Web=new Object();
if (!window.Renault.Web.UI) window.Renault.Web.UI=new Object();
if (!window.Renault.Web.UI.WebControls) window.Renault.Web.UI.WebControls=new Object();
if (!window.Renault.Web.UI.WebControls.DataGrid) window.Renault.Web.UI.WebControls.DataGrid=new Object();

Renault.Web.UI.WebControls.DataGrid.SetUniqueRadioButton=function(evt,NameTemplate)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	if (Source.nodeName.toLowerCase()=="label")
		Source=document.getElementById(Source.getAttribute("for"));
	if (Source==null)
		return;
	Regex=new RegExp(NameTemplate);
	for (var Index=0; Index<document.forms[0].elements.length; Index++)
	{
		Element=document.forms[0].elements[Index];
		if ((Element.type=="radio")&&(Element.name!=Source.name))
			if (Regex.test(Element.name))
			{
				Element.checked=false;
				if (Element.Control!=undefined) ToyBox.Web.UI.WebControls.CheckBox.OnStateChange(Element.Control,false);
			}
	}
}

Renault.Web.UI.WebControls.DataGrid.ValidateRadioButton=function(evt,NameTemplate,ErrorMessage)
{
	if (!evt) evt=window.event;
	var Source=(evt.srcElement?evt.srcElement:evt.target);
	Regex=new RegExp(NameTemplate);
	for (var Index=0; Index<document.forms[0].elements.length; Index++)
	{
		Element=document.forms[0].elements[Index];
		if ((Element.type=="radio")&&(Regex.test(Element.name))&&(Element.checked==true))
			return true;
	}
	alert(ErrorMessage);
	return false;
}

if (!window.Renault.Globalization) window.Renault.Globalization=new Object();
if (!window.Renault.Globalization.CultureInfo) window.Renault.Globalization.CultureInfo=new Object();
if (!window.Renault.Globalization.CultureInfo.CurrentCulture) window.Renault.Globalization.CultureInfo.CurrentCulture=new Object();
if (!window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat) window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat=new Object();
if (!window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalDigits) window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalDigits=new Number(2);
if (!window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator) window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator=new String(".");
if (!window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyGroupSeparator) window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyGroupSeparator=new String(",");
if (!window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol) window.Renault.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol=new String("&pound;{0}");

if (!window.Renault.Web.HttpRequest.Flash) window.Renault.Web.HttpRequest.Flash=new Object();
Renault.Web.HttpRequest.Flash.LoadTitle=function(Target)
{
	if (Renault.Web.HttpRequest.Browser.isFlash<=0) return;
	Target=document.getElementById(Target);
	var Index=1; var Title=null; var Elements=null;
	while (((Title==undefined)||(Title==null))&&(Index<7))
	{
		Elements=Target.getElementsByTagName("h"+Index.toString());
		for (var Item=0; Item<Elements.length; Item++) { Title=Elements[Item]; if (Title.innerHTML!="") break; else Title=null; }
		Index++;
	}
	Index=1; var SubTitle=null;
	while (((SubTitle==undefined)||(SubTitle==null))&&(Index<7))
	{
		Elements=Target.getElementsByTagName("h"+Index.toString())
		for (var Item=0; Item<Elements.length; Item++)
		{ SubTitle=Elements[Item]; if (SubTitle==Title) SubTitle=null; if ((SubTitle!=null)&&(SubTitle.innerHTML!="")) break; else SubTitle=null; }
		Index++;
	}
	var Color=null; var BackgroundColor=null;
	if (SubTitle!=null)
	{
		var SubTitleText=((SubTitle.childNodes.length==1)&&(SubTitle.childNodes[0].nodeType==1)?SubTitle.childNodes[0]:SubTitle);
		Color=(SubTitleText.currentStyle?SubTitleText.currentStyle.color:document.defaultView.getComputedStyle(SubTitleText,null).getPropertyValue("color"));
		if (Color==null) Color="E5E5E5"; else if (Color.indexOf("#")==0) Color=Color.replace("#","").toUpperCase(); else
		{
			Color=Color.replace(/[^0-9,]/gi,"");
			var R=parseInt(Color.split(',')[0]).toString(16).toUpperCase();
			var G=parseInt(Color.split(',')[1]).toString(16).toUpperCase();
			var B=parseInt(Color.split(',')[2]).toString(16).toUpperCase();
			Color=(R.length==1?"0"+R:R)+(G.length==1?"0"+G:G)+(B.length==1?"0"+B:B);
		}
		BackgroundColor=(SubTitleText.currentStyle?SubTitleText.currentStyle.backgroundColor:document.defaultView.getComputedStyle(SubTitleText,null).getPropertyValue("background-color"));
		if (BackgroundColor.match(/(#[0-9a-f]{3,6})|(rgb\s*\([0-255]{1,3}\s*,\s*[0-255]{1,3},\s*[0-255]{1,3}\))/gi)!=null) { SubTitle.style.backgroundColor="transparent"; if (BackgroundColor.indexOf("#")==0) BackgroundColor=BackgroundColor.replace("#","").toUpperCase(); else
		{
			BackgroundColor=BackgroundColor.replace(/[^0-9,]/gi,"");
			var R=parseInt(BackgroundColor.split(',')[0]).toString(16).toUpperCase();
			var G=parseInt(BackgroundColor.split(',')[1]).toString(16).toUpperCase();
			var B=parseInt(BackgroundColor.split(',')[2]).toString(16).toUpperCase();
			BackgroundColor=(R.length==1?"0"+R:R)+(G.length==1?"0"+G:G)+(B.length==1?"0"+B:B);
		} } else BackgroundColor=null;
		SubTitle.innerHTML="<img src=\"/TextGen.axd?color="+Color+(BackgroundColor!=null?"&background="+BackgroundColor:"")+"&name=HelveticaNeueLT Com 57 Cn&size=25.5&bold=true&uppercase=true&transparent=true&text="+SubTitleText.innerHTML.replace(/<[^>]*>/g,"")+"\" alt=\""+SubTitleText.innerHTML.replace(/<[^>]*>/g,"")+"\" />";
	}
	Color=null;
	if (Title!=null)
	{
		var TitleText=((Title.childNodes.length==1)&&(Title.childNodes[0].nodeType==1)?Title.childNodes[0]:Title);
		Color=(TitleText.currentStyle?TitleText.currentStyle.color:document.defaultView.getComputedStyle(TitleText,null).getPropertyValue("color"));
		if (Color==null) Color="F7B100"; else if (Color.indexOf("#")==0) Color=Color.replace("#","").toUpperCase(); else
		{
			Color=Color.replace(/[^0-9,]/gi,"");
			var R=parseInt(Color.split(',')[0]).toString(16).toUpperCase();
			var G=parseInt(Color.split(',')[1]).toString(16).toUpperCase();
			var B=parseInt(Color.split(',')[2]).toString(16).toUpperCase();
			Color=(R.length==1?"0"+R:R)+(G.length==1?"0"+G:G)+(B.length==1?"0"+B:B);
		}
		BackgroundColor=(TitleText.currentStyle?TitleText.currentStyle.backgroundColor:document.defaultView.getComputedStyle(TitleText,null).getPropertyValue("background-color"));
		if (BackgroundColor.match(/(#[0-9a-f]{3,6})|(rgb\s*\([0-255]{1,3}\s*,\s*[0-255]{1,3},\s*[0-255]{1,3}\))/gi)!=null) { Title.style.backgroundColor="transparent"; if (BackgroundColor.indexOf("#")==0) BackgroundColor=BackgroundColor.replace("#","").toUpperCase(); else
		{
			BackgroundColor=BackgroundColor.replace(/[^0-9,]/gi,"");
			var R=parseInt(BackgroundColor.split(',')[0]).toString(16).toUpperCase();
			var G=parseInt(BackgroundColor.split(',')[1]).toString(16).toUpperCase();
			var B=parseInt(BackgroundColor.split(',')[2]).toString(16).toUpperCase();
			BackgroundColor=(R.length==1?"0"+R:R)+(G.length==1?"0"+G:G)+(B.length==1?"0"+B:B);
		} } else BackgroundColor=null;
		Title.innerHTML="<img src=\"/TextGen.axd?color="+Color+(BackgroundColor!=null?"&background="+BackgroundColor:"")+"&name=HelveticaNeueLT Com 57 Cn&size=25.5&bold=true&uppercase=true&transparent=true&text="+TitleText.innerHTML.replace(/<[^>]*>/g,"")+"\" alt=\""+TitleText.innerHTML.replace(/<[^>]*>/g,"")+"\" />";
	}
}

if (!window.Renault.Web.HttpCookie) Renault.Web.HttpCookie=new Object();
Renault.Web.HttpCookie.Create=function(Name,Value,Days)
{
	var Expires=""
	if (Days)
	{
		var CookieDate=new Date();
		CookieDate.setTime(CookieDate.getTime()+(Days*24*60*60*1000));
		var Expires="; expires="+CookieDate.toGMTString();
	}
	document.cookie=Name+"="+Value+Expires+"; path=/";
}

Renault.Web.HttpCookie.Read=function(Name)
{
	var NameEQ=Name+"=";
	var Cookies=document.cookie.split(';');
	for (var Index=0;Index<Cookies.length;Index++)
	{
		var Cookie=Cookies[Index];
		while (Cookie.charAt(0)==' ') Cookie=Cookie.substring(1,Cookie.length);
		if (Cookie.indexOf(NameEQ)==0) return Cookie.substring(NameEQ.length,Cookie.length);
	}
	return null;
}

Renault.Web.HttpCookie.Delete=function(Name)
{
	Renault.Web.HttpCookie.CreateCookie(Name,"",-1);
}