/***************************************************
*pld_cms.js V4.0 15_12_05                          *
*         COPYRIGHT www.pldproductions.com         *
*      May not be used copied or reproduced        *
*        without written permission                *
***************************************************/

function formcheck_blank(formname){
regExpURL=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
form_element=eval("document.forms[formname]");
elements_len=form_element.elements.length;
counter=0;
while(counter<elements_len){
if(form_element.elements[counter].value==""){
alert("Please complete the field to proceed");
form_element.elements[counter].focus();
form_element.elements[counter].style.backgroundColor="#FFE79D";
return false;
}
if(form_element.elements[counter].name=="email" || form_element.elements[counter].name=="email_check"){
if(!regExpURL.test(form_element.elements[counter].value)){
alert("The e-mail address entered is not valid, please correct.");
form_element.elements[counter].focus();
form_element.elements[counter].select();
return false;
}
if(form_element.elements["email"].value != form_element.elements["email_check"].value){
alert("Your e-mail address must appear in both e-mail fields and be exactly the same to proceed");
form_element.elements["email"].focus();
form_element.elements["email"].select();
return false;
}
}
counter++;
}
}

function pageSet(page,width,height){
var scr;
scr=screen.width;
posWinL=(scr/2)-(width/2)+"px";
var newWindow;
newWindow=window.open(page,"newWin","width="+width+",height="+height+",left="+posWinL+",top=120px,resizable=no,scrollbars=no");
}

function pageSet_help(page,width,height){
var scr;
scr=screen.width;
posWinL=(scr/5)-(width/2)+"px";
var newWindow;
newWindow=window.open(page,"newWin","width="+width+",height="+height+",left=0,top=120px,resizable=yes,scrollbars=yes");
}

function closer(){
window.close();
}

function form_refocus(){
refocus=document.forms[0].submit;
refocus.focus();
}

function check_menu_order(formname){
form_element=eval("document."+formname);
elements_len=form_element.elements.length;
var el_count=new Array(elements_len);
var el_tally=new Array(elements_len);
co=0;
while(co<elements_len){
el_count[co]=form_element.elements[co].value;
el_tally[co]=0;
co++;
}
counter=0;
while(counter<elements_len){
i=0;
while(i<elements_len){

if(form_element.elements[counter].value==el_count[i]){
el_tally[counter]++;
if(el_tally[counter]>1){
alert("You have more than one menu item with the number "+form_element.elements[counter].value+" allocated. Please correct.");
form_element.elements[counter].focus();
return false;
}
}
i++;
}
counter++;
}
}

function confirm_delete(){
if(confirm("Are you sure you wish to proceed with the deletion? There will be no way to \"undo\" this action")){
return true;
}
else{
return false;
}
}

function confirm_mail(){
if(confirm("Are you sure you wish to send the e-mail to all recipients?\n\nClick \"OK\" to proceed and \"Cancel\" to stop")){
pageSet('mail_send.php?',500,400);
}
else{
return false;
}
}

function set_target(){

}

function trigger(){
setTimeout("status_bar()",4*1000);
}

function status_bar(){
window.location.reload(true);
window.parent.send.location.reload(true);
}
