// JavaScript Document

<!--//

// Window Opener

function openWindow(winURL,winName,features) {
  window.open(winURL,winName,features);
}

function AddToBookmarks()
{
	window.external.AddFavorite('http://www.luxuryeye.co.uk','LuxuryEye.co.uk');
}


function ClientValidation(source, args)
{
       args.IsValid = document.getElementById("chkTandC").checked;
       //alert(Form1.txtEmail.value);
}

function SetMaxHeight(img)
{
	var ratio=0;
	var newWidth=0;
	var newHeight=0;
	ratio = img.height/img.width;
	//alert(ratio);
	if (img.height > 247)
	{
		newWidth = img.width/ratio;
		img.height = 247;
		img.width = newWidth;
		//alert(newWidth);
		//alert(img.width);
	}
	/*if (img.width > 200)
	{
		newHeight = img.width/ratio;
		img.width = 200;
		img.height = newHeight;
	}*/
}

//-->
function LoadImage(sImageName)
{
	var sPath = "/Images/" + sImageName;
	document.imgMain.src = sPath;
	//document.imgMain2.src = sPath;
	//document.imgLarge.src= sPath;

}

function setBlankImage(oImg,sImageName){
	oImg.onerror = null;
	oImg.src = "/Images/"+sImageName ;
}

function setNoImage(oImg,sImageName){
	oImg.onerror = null;
	oImg.src = "/Images/"+sImageName ;
}

function CheckLogin(form)
{
	var str='';
	if (form.txtLogin.value == '')
		str += 'Please enter your Luxury Eye ID\n';
	if (form.txtPassword.value == '')
		str += 'Please enter your password\n';
	
	if (str != '')
	{
		alert(str);
		return false;
	}
	else
		return true;
}



window.parent.name = 'launcher';

	function ShowLayer(name)
	{
		if(document.layers)	   //NN4+
		{
			document.layers[name].visibility = "show";
		}
		else if(document.getElementById)	  //gecko(NN6) + IE 5+
		{
			var obj = document.getElementById(name);
			obj.style.visibility = "visible";
			obj.style.height = "50px";
			obj.style.width = "400px";
		}
		else if(document.all)	// IE 4
		{
			document.all[name].style.visibility = "visible";
		}
	}
	
	function HideLayer(name)
	{
		if(document.layers)	   //NN4+
		{
			document.layers[name].visibility = "hide";
		}
		else if(document.getElementById)	  //gecko(NN6) + IE 5+
		{
			var obj = document.getElementById(name);
			obj.style.visibility = "hidden";
		}
		else if(document.all)	// IE 4
		{
			document.all[name].style.visibility = "hidden";
		}
	}
	
	function CheckSubscriptionForm(form)
	{
		var str='';
		
		if (form.chkTandC.checked == false)
			str += 'Please accept Terms & Conditions\n';
		
		if (form.chkAnnual.checked == false && form.chkMonthly.checked == false)
			str += 'Please select annual or monthly payment\n';
			
		if (form.chkAnnual.checked == true)
		{
			if (form.chkCheque.checked == false && form.chkCreditCard.checked == false)
				str += 'Please select Cheque or Credit Card\n';
		}
		
		if (form.chkMonthly.checked == true)
		{
			if (form.chkStandingOrder.checked == false && form.chkContinousPayment.checked == false)
				str += 'Please select Standing Order or Continous Payment\n';
		}

		
		if (str != '')
		{
			alert(str);
			return false;
		}
		else
			return true;
	}
	
function ConfirmDelete()
{
var confirmed = window.confirm("Are you sure you want to refuse this order ?")
return(confirmed);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  //window.moveTo(400,400);//
}
