If level1 is locked change texture

Hello guys.
I need to change texture when the level1 is locked and unlocked.
Here is the script:

#pragma strict
var Level1Locked = true;
var Level1Unlocked = false;
var UnlockedTexture = Texture2D;
var LockedTexture = Texture2D;
function OnGUI() 
{
if (Level1Locked == true)
renderer.material.mainTexture  = LockedTexture;
}

And then i want something like that : if level1 is unlocked change texture to UnlockedTexture
I get the following error : Cannot convert ‘System.Type’ to ‘UnityEngine.Texture’…

Just write

if (Level1Locked == true)
renderer.material.mainTexture  = LockedTexture;
} else { 
    renderer.material.mainTexture  = UnlockedTexture;
}

Also its good practice to have the first letter of your variable be lower case. just in case its actually calling something other than the variable. So make your first letters of ur vars lowercase instead of capital.