function toggleDelivery(){
if(document.checkoutform.delivercheck.checked == true){
document.checkoutform.deliveryfirstname.value = document.checkoutform.firstname.value;
document.checkoutform.deliverysecondname.value = document.checkoutform.secondname.value;
document.checkoutform.deliveryaddress1.value = document.checkoutform.address1.value;
document.checkoutform.deliveryaddress2.value = document.checkoutform.address2.value;
document.checkoutform.deliverycity.value = document.checkoutform.city.value;
document.checkoutform.deliverycounty.value = document.checkoutform.county.value;
document.checkoutform.deliverypostcode.value = document.checkoutform.postcode.value;
}else{
document.checkoutform.deliveryfirstname.value = '';
document.checkoutform.deliverysecondname.value = '';
document.checkoutform.deliveryaddress1.value = '';
document.checkoutform.deliveryaddress2.value = '';
document.checkoutform.deliverycounty.value = '';
document.checkoutform.deliverycity.value = '';
document.checkoutform.deliverypostcode.value = '';
}
}
function load(file,target) {
if (target != '')
target.window.location.href = file;
else
window.location.href = file;
}
function processForm(x){
var inputFields = $$('.xstandardfield');
inputFields.each(function(inputField) {
var strName2 = inputField.id;
strName2 = strName2.substring(5);
var thisDivText = document.getElementById(strName2).value;
thisDivText.EscapeUnicode = true;
inputField.value = thisDivText;
}
)
}
function deleteComment(commentid){
var postBody = "commentid=" + commentid ;
new Ajax.Request('inc/inc_articlefunctions.php?action=deletecomment', {
method: 'post',
postBody: postBody ,
onComplete: function(ajaxrequest){
Effect.Fade($('comment_' + commentid ),{duration:0.5}) ;
}
});
}
function addComment(){
var articleid = $('articleid').value ;
var author = escape($('author').value) ;
var comment = escape($('comment').value) ;
var captcha = escape($('captcha_code').value) ;
var url = 'inc/inc_articlefunctions.php?action=addcomment';
var postBody = "articleid=" + articleid ;
postBody += "&author=" + author ;
postBody += "&comment=" + comment ;
postBody += "&captcha_code=" + captcha ;
new Ajax.Updater('commentsholder',url, {
method: 'post',
postBody: postBody ,
onComplete: function(ajaxrequest){
Effect.Appear($('commentadded')) ;
$('author').value = '';
$('comment').value = '';
setTimeout(Effect.Fade($('commentadded')),3000) ;
}
});
}
// Color Picker Script from Flooble.com
// For more information, visit
// http://www.flooble.com/scripts/colorpicker.php
// Copyright 2003 Animus Pactum Consulting inc.
// You may use and distribute this code freely, as long as
// you keep this copyright notice and the link to flooble.com
// if you chose to remove them, you must link to the page
// listed above from every web page where you use the color
// picker code.
//---------------------------------------------------------
var perline = 9;
var divSet = false;
var curId;
var colorLevels = Array('0', '3', '6', '9', 'C', 'F');
var colorArray = Array();
var ie = false;
var nocolor = 'none';
if (document.all) { ie = true; nocolor = ''; }
function getObj(id) {
if (ie) { return document.all[id]; }
else { return document.getElementById(id); }
}
function addColor(r, g, b) {
var red = colorLevels[r];
var green = colorLevels[g];
var blue = colorLevels[b];
addColorValue(red, green, blue);
}
function addColorValue(r, g, b) {
colorArray[colorArray.length] = '#' + r + r + g + g + b + b;
}
function setColor(color) {
var link = getObj(curId);
var field = getObj(curId + 'field');
var picker = getObj('colorpicker');
field.value = color;
if (color == '') {
link.style.background = nocolor;
link.style.color = nocolor;
color = nocolor;
} else {
link.style.background = color;
link.style.color = color;
}
picker.style.display = 'none';
eval(getObj(curId + 'field').title);
}
function setDiv() {
if (!document.createElement) { return; }
var elemDiv = document.createElement('div');
if (typeof(elemDiv.innerHTML) != 'string') { return; }
genColors();
elemDiv.id = 'colorpicker';
elemDiv.style.position = 'absolute';
elemDiv.style.display = 'none';
elemDiv.style.border = '#000000 1px solid';
elemDiv.style.background = '#FFFFFF';
elemDiv.innerHTML = 'Pick a color: '
+ '(No color)
'
+ getColorTable()
+ '