var email = "enquiries"
var domain = "hi-fiworld.co.uk"
var eml_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

function checkit(thisForm) {
if (thisForm.forename.value=="") {
alert("Please supply your forename.");
thisForm.forename.focus();
thisForm.forename.select();
return false;
}

if (thisForm.surname.value=="") {
alert("Please supply your surname.");
thisForm.surname.focus();
thisForm.surname.select();
return false;
}

if (thisForm.details.value=="") {
alert("Please supply a few details.");
thisForm.details.focus();
thisForm.details.select();
return false;
}

if (eml_val.test(thisForm.email.value) &! thisForm.email.value=="") {
thisForm.submit();
return true; }
else {
alert("Please supply a valid e-mail address.");
thisForm.email.focus();
thisForm.email.select();
return false;
}
}

function flit(sName) {
document[sName].src = "images/menu_on.gif";
}
function foff(sName) {
document[sName].src = "images/menu_off.gif";
}

function nextfield(target) {
if(window.event && window.event.keyCode == 13) {
document.getElementById(target).focus();
return false; }
else
return true;
}

function onField(txtfield) {
txtfield.className='stdinputbox stdinputover'
}

function offField(txtfield) {
if (txtfield.type=='text') {
txtfield.className='stdinputbox'
} else {
txtfield.className='stdinputboxc'
}
}

function onFieldNL(txtfield) {
if (txtfield.value==txtfield.id)
txtfield.value = "";
txtfield.className='postover'
}

function offFieldNL(txtfield) {
if (txtfield.value=="")
txtfield.value=txtfield.id;
txtfield.className='post'
}

function onFieldEH(txtfield) {
if (txtfield.value==txtfield.id)
txtfield.value = "";
txtfield.className='stdinputbox stdinputover'
}

function offFieldEH(txtfield) {
if (txtfield.value=="")
txtfield.value=txtfield.id;
txtfield.className='stdinputbox'
}

function onFieldNL(txtfield) {
if (txtfield.value==txtfield.id)
txtfield.value = "";
txtfield.className='postover'
}

function offFieldNL(txtfield) {
if (txtfield.value=="")
txtfield.value=txtfield.id;
txtfield.className='post'
}

function copyContent(inputfield) {
txtobject=document.getElementById(inputfield);
varcopy=txtobject.createTextRange();
varcopy.execCommand("copy");
}

var iHandle
function openWindow(varURL) {
iHandle = window.open(varURL);return
}

function displayimage(varURL,iWidth,iHeight) {
if (iHandle != null) iHandle.close();var iLeft = (screen.width - iWidth) / 2;
var iTop = (screen.height - iHeight) / 2;
iHandle = window.open(varURL,'guest','status=no,width=' + iWidth +',height=' + iHeight + ',left=' + iLeft + ',top=' + iTop + ',scrollbars=no,resizable=no');
}

function swapimage(imgname) {
var newimg = document.getElementById("midimg");
if ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1)) {
	newimg.style.filter="progid:DXImageTransform.Microsoft.Fade(Overlap=1.00);";
	newimg.filters[0].apply();
	newimg.src="images/"+imgname;
	newimg.filters[0].play();
	}
else
	newimg.src="images/"+imgname;
}

function addToFavorites() {
var title="Carcierge";
var urlAddress="http://www.carcierge.co.uk";
if (window.sidebar) { 
window.sidebar.addPanel(title, self.location.href,""); 
} else if( document.all ) {
window.external.AddFavorite(self.location.href, title);
} else if( window.opera && window.print ) {
return true;
}
}

