function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function jumpTo(targ,selObj){
	var loc=selObj.options[selObj.selectedIndex].value;
	if (loc){
		eval(targ+".location='"+loc+"'");
 	}
 	else{
		selObj.selectedIndex=0;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function toggleThis(whichOne) {
	if (document.getElementById(whichOne).style.display == 'none')
		document.getElementById(whichOne).style.display = '';
	else
		document.getElementById(whichOne).style.display = 'none';
}

function submitCustomizationForm(){
var postStringInsert =  
"client_id=" + document.getElementById("client_id").value + 
"&config_id=" + document.getElementById("config_id").value + 
"&config_name=" + document.getElementById("config_name").value + 
"&password=" + document.getElementById("password").value + 
"&file=" + document.getElementById("file").value + 
"&dis_width=" + document.getElementById("dis_width").value + 
"&dis_height=" + document.getElementById("dis_height").value  + 
"&dis_x=" + document.getElementById("dis_x").value + 
"&dis_y=" + document.getElementById("dis_y").value  + 
"&dis_color=" + document.getElementById("dis_color").value + 
"&dis_bor_color=" + document.getElementById("dis_bor_color").value + 
"&dis_fullpage=" + document.getElementById("dis_fullpage").value + 
"&dis_returnpage=" + document.getElementById("dis_returnpage").value  + 
"&dis_fullmode=" + document.getElementById("dis_fullmode").value + 
"&dis_font=" + document.getElementById("dis_font").value + 
"&dis_permalink=" + document.getElementById("dis_permalink").value + 

"&dis_bug=" + document.getElementById("dis_bug").value + 
"&dis_bug_alpha=" + document.getElementById("dis_bug_alpha").value + 
"&dis_bug_width=" + document.getElementById("dis_bug_width").value + 
"&dis_bug_height=" + document.getElementById("dis_bug_height").value + 
"&dis_bug_link=" + document.getElementById("dis_bug_link").value + 

"&dis_thu_show=" + document.getElementById("dis_thu_show").value + 
"&dis_thu_link=" + document.getElementById("dis_thu_link").value + 

"&dis_int_show=" + document.getElementById("dis_int_show").value + 
"&dis_int_file=" + document.getElementById("dis_int_file").value + 
"&dis_int_text=" + document.getElementById("dis_int_text").value + 
"&dis_int_type=" + document.getElementById("dis_int_type").value + 

"&dis_vid_width=" + document.getElementById("dis_vid_width").value + 
"&dis_vid_height=" + document.getElementById("dis_vid_height").value + 
"&dis_vid_stretch=" + document.getElementById("dis_vid_stretch").value + 
"&dis_vid_fit=" + document.getElementById("dis_vid_fit").value + 
"&dis_vid_autostart=" + document.getElementById("dis_vid_autostart").value + 
"&dis_vid_shuffle=" + document.getElementById("dis_vid_shuffle").value + 
"&dis_vid_repeat=" + document.getElementById("dis_vid_repeat").value + 
"&dis_vid_buffer=" + document.getElementById("dis_vid_buffer").value +

"&dis_frame=" + document.getElementById("dis_frame").value + 
"&dis_fra_link=" + document.getElementById("dis_fra_link").value + 
"&dis_background=" + document.getElementById("dis_background").value +
"&dis_bac_link=" + document.getElementById("dis_bac_link").value +

"&men_hide=" + document.getElementById("men_hide").value + 
"&men_show=" + document.getElementById("men_show").value + 
"&men_width=" + document.getElementById("men_width").value + 
"&men_height=" + document.getElementById("men_height").value + 
"&men_bor_color=" + document.getElementById("men_bor_color").value + 
"&men_color=" + document.getElementById("men_color").value + 
"&men_pos_link=" + document.getElementById("men_pos_link").value + 
"&men_floating=" + document.getElementById("men_floating").value + 
"&men_alpha=" + document.getElementById("men_alpha").value + 
"&men_x=" + document.getElementById("men_x").value + 
"&men_y=" + document.getElementById("men_y").value + 

"&con_y=" + document.getElementById("con_y").value + 
"&con_hide=" + document.getElementById("con_hide").value + 
"&con_hidetime=" + document.getElementById("con_hidetime").value + 
"&con_alpha=" + document.getElementById("con_alpha").value +
"&con_color=" + document.getElementById("con_color").value + 

"&con_pla_show=" + document.getElementById("con_pla_show").value + 
"&con_pre_show=" + document.getElementById("con_pre_show").value + 
"&con_nex_show=" + document.getElementById("con_nex_show").value +
"&con_scr_show=" + document.getElementById("con_scr_show").value + 
"&con_vol_show=" + document.getElementById("con_vol_show").value + 
"&con_log_show=" + document.getElementById("con_log_show").value + 
"&con_tim_show=" + document.getElementById("con_tim_show").value + 
"&con_ful_show=" + document.getElementById("con_ful_show").value + 
"&con_bro_show=" + document.getElementById("con_bro_show").value + 
"&con_sha_show=" + document.getElementById("con_sha_show").value + 
"&con_sha_link=" + document.getElementById("con_sha_link").value + 

"&con_but_ico_color=" + document.getElementById("con_but_ico_color").value + 
"&con_but_ico_darkcolor=" + document.getElementById("con_but_ico_darkcolor").value + 
"&con_but_ico_overcolor=" + document.getElementById("con_but_ico_overcolor").value + 
"&con_but_ico_downcolor=" + document.getElementById("con_but_ico_downcolor").value  + 
"&con_vol_start=" + document.getElementById("con_vol_start").value +

"&pla_width=" + document.getElementById("pla_width").value +
"&pla_height=" + document.getElementById("pla_height").value +
"&pla_title=" + document.getElementById("pla_title").value +
"&pla_color=" + document.getElementById("pla_color").value +

"&pla_but_thu_show=" + document.getElementById("pla_but_thu_show").value +
"&pla_showatend=" + document.getElementById("pla_showatend").value +
"&pla_autoscroll=" + document.getElementById("pla_autoscroll").value +
"&pla_but_permalink=" + document.getElementById("pla_but_permalink").value +

"&pos_show=" + document.getElementById("pos_show").value +
"&pos_bro_show=" + document.getElementById("pos_bro_show").value +
"&pos_ads_show=" + document.getElementById("pos_ads_show").value +
"&pos_autoscroll=" + document.getElementById("pos_autoscroll").value +

"&pos_width=" + document.getElementById("pos_width").value +
"&pos_height=" + document.getElementById("pos_height").value +
"&pos_align=" + document.getElementById("pos_align").value +

"&bro_width=" + document.getElementById("bro_width").value +
"&bro_height=" + document.getElementById("bro_height").value +
"&bro_align=" + document.getElementById("bro_align").value +

"&bro_show=" + document.getElementById("bro_show").value +

"&callback=" + document.getElementById("callback").value +
"&baseurl=" + document.getElementById("baseurl").value +
"&enablejs=" + document.getElementById("enablejs").value +
"&playerclip=" + document.getElementById("playerclip").value + 
"&swfurl=" + document.getElementById("swfurl").value + 
"&emailurl=" + document.getElementById("emailurl").value + 
"&siteurl=" + document.getElementById("siteurl").value + 
"&changesinrhythm=" + document.getElementById("changesinrhythm").value +
"&shareservice=" + document.getElementById("shareservice").value;

new ajax ('/ajax/submitCustomizationForm.php', {
postBody: postStringInsert, 
update: $('formSubmitted')});
}