﻿//Functions to change product images on product view page.
function Product_changeimage_colour(ColourID)
{
    changeZoomImage('/Uploads/Products/Colours/' + ColourID + '.jpg', '/GDI/ProductColour.ashx?t=2&id=' + ColourID);
    document.getElementById('ctl00_ctl00_Content_Content_ColourDDL').value = ColourID;
}

function Product_changeimage_alternative(ID, ImageID)
{
    changeZoomImage('/Uploads/Products/Images/' + ImageID + '.jpg', '/GDI/ProductImage.aspx?t=7&id=' + ID);
}

function changeZoomImage(ImageURL, SmallImageURL)
{
MagicZoom_stopZooms();

var zoomLink = document.getElementById('ctl00_ctl00_Content_Content_ProductLink');
zoomLink.innerHTML = "<img src='" + SmallImageURL + "' />";
zoomLink.href = ImageURL;

MagicZoom_findZooms();
}




function MyAccount_Link_NotLoggedIn_Click(TextBoxToFocusOn)
{
    alert("Login first at the top of the page or sign up");
    document.getElementById(TextBoxToFocusOn).focus();
}

//Newsletter Sign Up
window.onload=function()
{
var deftxt='Email Address';
var def=document.getElementById('hktjy-hktjy');
def.onfocus = function()
{this.value=(this.value==deftxt)?'':this.value;}
def.onblur= function()
{if(this.value=='')	{this.value=deftxt;}
else this.value;}

def.focus();
def.blur();

var Focustxt = document.getElementById('Focustxt');
Focustxt.focus();
Focustxt.blur();

}