// JavaScript Document
$(document).ready(function(){
//disable all buttons in list-*.php such as delete, enable, disable
$("#action :input[@name=action]").each(function(){
$(this).attr("disabled", "disabled");
});
//add click event to "Clear Selected" button
$("#clear").click(function(){
$("#action :input[@name=action]").each(function(){
$(this).attr("disabled", "disabled");
});
});
//add click event to all checkboxes in list-*.php
$("#action :checkbox").click(function(){
var checked = false;
$("#action :checkbox").each(function(){
if(($(this).attr("checked")) == true){
checked = true;
}
});
if(checked){
$("#action :input[@name=action]").each(function(){
$(this).removeAttr("disabled");
});
}else{
$("#action :input[@name=action]").each(function(){
$(this).attr("disabled", "disabled");
});
}
});
//handle form submit
$("#action").submit(function(){
return confirmSelected();
});
});
function NewWindow(mypage, myname, w, h, scroll, resizable, status)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+',status='+status+'';
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// validate form
function validate(objForm, file, submitOnSuccess)
{
$("#status").ajaxStart(function(){
$(this).html('
Validating Submission...');
});
$.ajax({
type:"POST",
url: file,
data:getRequestBody(objForm),
success:function(xml){
if(xml == 0){
if(submitOnSuccess == null){
$("#status").html('Submission Valid! Processing...
');
objForm.submit();
}else{
$("#status").html('');
}
}else{
$("#status").html('' + xml + '
');
}
}
});
}
/*function confirmPayment(objForm, file, submitOnSuccess) {
$("#status").ajaxStart(function(){
$(this).html('
Validating Submission...');
});
$.ajax({
type:"POST",
url: file,
data:getRequestBody(objForm),
success:function(xml){
if(xml == 0){
if(submitOnSuccess == null){
$("#status").html('Submission Valid! Processing...
');
//alert('We are now processing your payments.\nThis may take a few minutes.\nPlease do not refresh the page.');
objForm.submit();
}else{
$("#status").html('');
}
}else{
$("#status").html('' + xml + '
');
}
}
});
}
*/
function getRequestBody(fobj) {
var str = "";
var ft = "";
var fv = "";
var fn = "";
var els = "";
for(var i = 0;i < fobj.elements.length;i++) {
els = fobj.elements[i];
ft = els.title;
fv = els.value;
fn = els.name;
switch(els.type) {
case "text":
case "hidden":
case "password":
case "textarea":
case "file":
str += fn + "=" + encodeURI(fv) + "&";
break;
case "checkbox":
case "radio":
if(els.checked) str += fn + "=" + encodeURI(fv) + "&";
break;
case "select-one":
str += fn + "=" +
els.options[els.selectedIndex].value + "&";
break;
case "select-multiple":
for(j=0; j
Please select an image from the drop down select.
'); $.ajax({ type:"GET", url:'ajax/getproductimage.php', data:'intFolderID='+intFolderID+'&txtExtension='+txtExtension, success:function(xml){ $('#filelist').html(xml); } }); } //display image when selected function displayIntroImage(intFileID) { $('#imageHolder').html('Please select an image from the drop down select.
'); $.ajax({ type:"GET", url:'ajax/getframeimage.php', data:'imageHolder='+imageHolder+'&intFolderID='+intFolderID+'&txtExtension='+txtExtension+'&txtSelectName='+txtSelectName, success:function(xml){ $('#'+filelist).html(xml); } }); } //display image when selected function displayFrameIntroImage(imageHolder, intFileID) { $('#'+imageHolder).html('
Validating Submission...');
});
$.ajax({
type:"POST",
url:"retreivepassword.php",
data:'txtForgotUsername=' + $('#txtForgotUsername').val(),
success:function(xml){
if(xml == 0){
$('#pwdStatus').html('Your password has been send to your email.');
}else{
$('#pwdStatus').html('' + xml + '