ie5 = (document.all && document.getElementById); ns6 = (!document.all && document.getElementById); timerCookie="";
if (ie5) { ieisaspaz="block"; } if (ns6) { ieisaspaz="table"; }
document.write('
');
document.write('
');
redir="0"; ws=""; addedtocart="no";
function onLoad() { if (window.opera && window.history) { history.navigationMode = 'compatible'; } timerCookie = window.setTimeout(onTick, 200); }
function onTick() { if (timerCookie) { window.clearTimeout(timerCookie); timerCookie = null; }
document.getElementById("cH").innerHTML = document.location.hash;
if (document.getElementById("cH").innerHTML!='' && (document.getElementById("cH").innerHTML!=document.getElementById("cP").innerHTML)) { where = document.location.hash; where = where.split("#"); ws = where[1].split("/");
htmlData(''+ws[0]+'',''+ws[1]+''); } timerCookie = window.setTimeout(onTick, 200); }
function goto(where,params,element) { where=where.replace('.php',''); window.location.hash = where+"/"+params;
if (ie5) { var doc = document.getElementById("hF").contentWindow.document; doc.open("javascript:''");
doc.write("parent.htmlData('"+where+"','"+params+"');"); doc.close(); } }
function onUnload() { if (timerCookie) { window.clearTimeout(timerCookie); } }
function GetXmlHttpObject(handler) { var objXMLHttp=null; if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() }
else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp }
function htmlData(where,params,element) { if (document.location.pathname!="/") { if (redir==0) { redir="1"; document.location.href="http://www.rotamec.co.uk"+document.location.hash; } }
document.body.style.cursor = 'wait'; url = where+".php"; loading(); if (url.length==0) { document.getElementById(where).innerHTML=""; return; } xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) { alert ("Sorry, Your browser does not support HTTP Request, please upgrade to an up to date browser to continue"); return; }
xmlHttp.open("POST", "http://www.rotamec.co.uk/"+url, true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close");
document.getElementById("cH").innerHTML = "#"+where+"/"+params; document.getElementById("cP").innerHTML = "#"+where+"/"+params; document.location.hash = "#"+where+"/"+params;
xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
if (!element) { element="main"; } document.getElementById(element).innerHTML= unescape(xmlHttp.responseText); document.body.style.cursor = 'default'; loading_complete(); bindThickBoxEvents(); } }; xmlHttp.send("ajax=1&"+params);
}
function post(where,params,element) { where=where.replace('.php','');if (where=="login") { loading(); } url = where+".php"; if (url.length==0) { document.getElementById(where).innerHTML=""; return; } xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) { alert ("Sorry, Your browser does not support HTTP Request, please upgrade to an up to date browser to continue"); return; }
xmlHttp.open("POST", "http://www.rotamec.co.uk/"+url, true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { if (!element) { element="main"; } document.getElementById(element).innerHTML= unescape(xmlHttp.responseText); document.body.style.cursor = 'default'; loading_complete(); bindThickBoxEvents(); } }; xmlHttp.send("ajax=1&"+params); }
function mrf() { document.location.hash=document.location.hash+"&"; }
function removeThickBoxEvents() {
$('.thickbox').each(function(i) {
$(this).unbind('click');
});
}
function bindThickBoxEvents() {
removeThickBoxEvents();
tb_init('a.thickbox, area.thickbox, input.thickbox');
}
function login() { document.getElementById("login_but").style.display="none"; document.getElementById("logout_but").style.display="inline"; }
function logout() { document.getElementById("login_but").style.display="inline"; document.getElementById("logout_but").style.display="none"; }
function loading() { } function bnr() { }
function loading_complete() { window.scroll(0,0); }
function form(form,whr,pog,par,ele) { if (ele!=undefined && ele!="") { element=ele; } else { element="main"; }
var data = "go=1"; var theform = document.getElementById(form); var cells = theform.getElementsByTagName("input"); for (var i = 0; i < cells.length; i++) {
if (cells[i].type.toLowerCase()!="submit" && cells[i].type.toLowerCase()!="image" && cells[i].type.toLowerCase()!="reset" && cells[i].type.toLowerCase()!="button" && cells[i].type.toLowerCase()!="file") {
if (cells[i].type.toLowerCase()=="checkbox") { if (cells[i].checked) { if (cells[i].value!=undefined) { var data=data+"&"+cells[i].name+"="+cells[i].value; } else { var data=data+"&"+cells[i].name+"=on"; } } }
if (cells[i].type.toLowerCase()=="radio") { if (cells[i].checked) { var data=data+"&"+cells[i].name+"="+cells[i].value; } }
if (cells[i].type.toLowerCase()=="text" || cells[i].type.toLowerCase()=="hidden" || cells[i].type.toLowerCase()=="password"){ if (cells[i].value!=undefined) { var data=data+"&"+cells[i].name+"="+cells[i].value; } } } }
var cells = theform.getElementsByTagName("textarea"); for (var i = 0; i < cells.length; i++) { if (cells[i].innerHTML!=undefined) { var data=data+"&"+cells[i].name+"="+cells[i].value; } }
var cells = theform.getElementsByTagName("select"); for (var i = 0; i < cells.length; i++) { var y = cells[i].selectedIndex; if (cells[i].options[y].value!="") { var data=data+"&"+cells[i].name+"="+cells[i].options[y].value; } }
if (par!=undefined && par!="") { data=data+"&"+par; }
if (data!=undefined && data!="go=1") { if (pog=="post") { post(whr,data,element); } else { goto(whr,data,element); } } else { alert("You have not filled in required information, please try again. "+data); } }
function updp(pid,q) { q=eval(q); if (q>0) { post('shopping_cart','action=update_quan&pID='+pid+'&quan='+q); }
if (q!=undefined && q=="0") { if (confirm('Are you sure you want remove this item from your cart?')) { post('shopping_cart','action=remove_line&pID='+pid); } else { post('shopping_cart',' '); } } }
function comments() { document.getElementById("comments").value=document.getElementById("com").value; }
function pimg(img,id,w,h) { document.getElementById("productsimage_"+id).innerHTML="
"; }
function quan(whr,wha) {
if (wha=="up") { nq=eval(document.forms[whr].quantity.value)+1; if (nq<100) { document.forms[whr].quantity.value=nq; } }
if (nq==99) { document.getElementById("quanuod_"+whr).style.background=" url('images/header/99.png')"; }
else { document.getElementById("quanuod_"+whr).style.background=" url('images/header/2-99.png')"; }
if (wha=="down") { nq=eval(document.forms[whr].quantity.value)-1; if (nq>0) { document.forms[whr].quantity.value=nq; } }
if (nq<2) { document.getElementById("quanuod_"+whr).style.background=" url('images/header/1.png')"; }
else { document.getElementById("quanuod_"+whr).style.background=" url('images/header/2-99.png')"; } }
function scart(nt,data,q,t) { cart_data=""; document.title=decodeURI(nt); if (data!=undefined) { prods = data.split("*x*"); for (var i = 0; i < prods.length;) { theprod = prods[i].split("|");
if (theprod[1]!=undefined) { cart_data=cart_data+""; } i++; }
if (prods.length>1) { cart_data=cart_data+"";
cart_data=cart_data+''; document.getElementById("shopping_cart_data").innerHTML=cart_data; }
else { document.getElementById("shopping_cart_data").innerHTML="0 items"; }
} else { document.getElementById("shopping_cart_data").innerHTML="0 items"; } }
var selected; function selectRowEffect(object, buttonSelect) { if (!selected) { if (document.getElementById) { selected = document.getElementById('defaultSelected'); } else { selected = document.all['defaultSelected']; } }
if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object;
if (document.checkout_address.shipping[0]) { document.checkout_address.shipping[buttonSelect].checked=true; } else { document.checkout_address.shipping.checked=true; } }
function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; }
function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; }
function popupWindow(url,w,h) { window.open(url,'livechat','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+',screenX=150,screenY=150,top=150,left=150') }
function showItem(id){ var item = document.getElementById(id); if (item) { if (!item.style.display || item.style.display == '' ) { item.style.display = 'none'; } else { item.style.display = ''; } } }