var koval = 0;
function goInit(initval,scd){if(!document.getElementsByTagName)return;var a=document.getElementsByTagName("a");for(var b=0;b<a.length;b++){var c=a[b];if(c.getAttribute("href")&&c.getAttribute("rel")=="external")c.target="_blank"}
if (scd == 9) { downCount(10); }
knav(1,initval);
}
function knav(knsw,navslide) {
switch (knsw) {
case 0:
clearTimeout(knto);
break;
case 1:
knto = setTimeout(function(){kslide(navslide)},200);
break;
} }
function kslide(slidenav) {
var npos = (slidenav * 160);
if (npos != koval) {
var mslide = document.getElementById("menuslider");
k1 = new Tween(mslide.style,'left',Tween.regularEaseOut,koval,npos,0.5,'px');
k1.start();
koval = npos;
}
}
function mainema() {
var full1 = 'info@randfdcastings.com';
document.write('<a href=\"' + 'mail' + 'to:' + full1 + '?subject=Website%20Enquiry\" title=\"Click To Email Us\">' + full1 + '</a>')
}
function downCount(cdn) {
if (cdn == 0) {
var baseh = 'http://www.randfdcastings.com/index.html';
window.location = baseh; } else {
document.getElementById("redcd").innerHTML = cdn;
cen = cdn-1;
tts = setTimeout("downCount(cen)",1000);
}
}
function enqCheck() {
var alertMsg = "The form cannot be sent because:\n";
var l_Msg = alertMsg.length;
var enqc1 = document.getElementById("enq_name");
var enqc2 = document.getElementById("enq_email");
var enqc3 = document.getElementById("enq_tel");
if (enqc1.value == "" || enqc1.value == null) { alertMsg += " - You have not provided your name\n"; enqc1.style.backgroundColor="#FFBDBD"; } else { enqc1.style.backgroundColor="#FFFFFF"; }
if (enqc2.value == "" || enqc2.value == null) {
if (enqc3.value == "" || enqc3.value == null) { alertMsg += " - You must provide a Telephone Number or an Email Address\n"; enqc2.style.backgroundColor="#FFBDBD"; enqc3.style.backgroundColor="#FFBDBD"; } else { enqc2.style.backgroundColor="#FFFFFF"; enqc3.style.backgroundColor="#FFFFFF"; } }
if (alertMsg.length == l_Msg){
return true;
}else{
alert(alertMsg);
return false;
}
}
function numOnly(numobj) {
var nums1 = numobj.value;
numobj.value = nums1.replace(/[^0-9]+/g,"");
}
