scrigo.js.php 22.5 KB
Newer Older
1 2 3
<?php
	session_start();
	include('../../lib/config.inc.php');
4 5
	$lang = (isset($_SESSION['s']['language']) && $_SESSION['s']['language'] != '')?$_SESSION['s']['language']:'en';
	include_once(ISPC_ROOT_PATH.'/web/strengthmeter/lib/lang/'.$lang.'_strengthmeter.lng');
6 7 8 9
?>

redirect = '';

10 11 12 13 14 15 16 17
function reportError(request) {
	/* Error reporting is disabled by default as some browsers like safari 
	   sometimes throw errors when a ajax request is delayed even if the 
	   ajax request worked. */
	   
	/*alert(request);*/
}

18
function loadContentRefresh(pagename) {
19
	/*
20 21 22 23 24
	var pageContentCallbackRefresh = {
		success: function(o) {
			document.getElementById('pageContent').innerHTML = o.responseText;
		},
		failure: function(o) {
25
			reportError('Ajax Request was not successful.'+pagename);
26 27
		}
	}
28
	*/
29 30
	
  if(document.getElementById('refreshinterval').value > 0) {
31 32 33 34 35 36 37 38 39 40 41
  	/*var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename+"&refresh="+document.getElementById('refreshinterval').value, pageContentCallbackRefresh);*/
	var pageContentObject2 = jQuery.ajax({	type: "GET", 
											url: pagename, 
											data: "refresh="+document.getElementById('refreshinterval').value,
											success: function(data, textStatus, jqXHR) {
												document.getElementById('pageContent').innerHTML = jqXHR.responseText;
											},
											error: function() {
												reportError('Ajax Request was not successful.'+pagename);
											},
										});
42 43 44 45 46
  	setTimeout( "loadContentRefresh('"+pagename+"&refresh="+document.getElementById('refreshinterval').value+"')", document.getElementById('refreshinterval').value*1000 );
  }
}

function capp(module) {
47
	/*
48 49 50 51 52 53 54 55 56 57 58 59 60
	var cappCallback = {
		success: function(o) {
			if(o.responseText != '') {
				if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
					var parts = o.responseText.split(':');
					loadContent(parts[1]);
				} else {
					alert(o.responseText);
				}
			}
			loadMenus();
		},
		failure: function(o) {
61
			reportError('Ajax Request was not successful.'+module);
62 63
		}
	}
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
	*/
	/*var submitFormObj = YAHOO.util.Connect.asyncRequest('GET', 'capp.php?mod='+module, cappCallback);*/
	var submitFormObj = jQuery.ajax({		type: "GET", 
											url: "capp.php", 
											data: "mod="+module,
											success: function(data, textStatus, jqXHR) {
												if(jqXHR.responseText != '') {
													if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
														var parts = jqXHR.responseText.split(':');
														loadContent(parts[1]);
													} else {
														alert(jqXHR.responseText);
													}
												}
												loadMenus();
											},
											error: function() {
												reportError('Ajax Request was not successful.'+module);
											},
									});
84 85 86
}

function submitLoginForm(formname) {
87

88 89 90 91 92 93 94 95 96 97 98 99 100
	
    //* Validate form. TODO: username and password with strip();
    var frm = document.getElementById(formname);
    var userNameObj = frm.username;
    if(userNameObj.value == ''){
        userNameObj.focus();
        return;
    }
    var passwordObj = frm.passwort;
    if(passwordObj.value == ''){
        passwordObj.focus();
        return;
    }   
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
	/*YAHOO.util.Connect.setForm(formname);*/
	/*var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', 'content.php', submitFormCallback);*/
	var submitFormObj = jQuery.ajax({		type: "POST", 
											url: "content.php",
											data: jQuery('#'+formname).serialize(),
											success: function(data, textStatus, jqXHR) {
												if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
													var parts = jqXHR.responseText.split(':');
													//alert(parts[1]);
													loadContent(parts[1]);
													//redirect = parts[1];
													//window.setTimeout('loadContent(redirect)', 1000);
												} else if (jqXHR.responseText.indexOf('LOGIN_REDIRECT:') > -1) {
													// Go to the login page
													document.location.href = 'index.php';
												} else {
													document.getElementById('pageContent').innerHTML = jqXHR.responseText;
												}
												loadMenus();
											},
											error: function() {
												reportError('Ajax Request was not successful.110');
											},
									});
125 126 127 128 129
	/*
	if(redirect != '') {
		loadContent(redirect);
		redirect = '';
	}
130
	document.getElementById('footer').innerHTML = 'Powered by <a href="http://www.ispconfig.org" target="_blank">ISPConfig</a>';
131
	*/
132
	
133 134 135
}

function submitForm(formname,target) {
136
	/*
137 138 139 140 141 142 143 144 145 146 147 148 149 150
	var submitFormCallback = {
		success: function(o) {
			if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
				var parts = o.responseText.split(':');
				//alert(parts[1]);
				loadContent(parts[1]);
				//redirect = parts[1];
				//window.setTimeout('loadContent(redirect)', 1000);
			} else {
				document.getElementById('pageContent').innerHTML = o.responseText;
			}
		},
		failure: function(o) {
			var parts = o.responseText.split(':');
151
			reportError('Ajax Request was not successful. 111');
152 153
		}
	}
154
	*/
155
	
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
	/*YAHOO.util.Connect.setForm(formname);*/
	/*var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', target, submitFormCallback);*/
	var submitFormObj = jQuery.ajax({		type: "POST", 
											url: target,
											data: jQuery('#'+formname).serialize(),
											success: function(data, textStatus, jqXHR) {
												if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
													var parts = jqXHR.responseText.split(':');
													//alert(parts[1]);
													loadContent(parts[1]);
													//redirect = parts[1];
													//window.setTimeout('loadContent(redirect)', 1000);
												} else {
													document.getElementById('pageContent').innerHTML = jqXHR.responseText;
												}
											},
											error: function(jqXHR, textStatus, errorThrown) {
												var parts = jqXHR.responseText.split(':');
												reportError('Ajax Request was not successful. 111');
											},
									});
177 178 179 180 181 182 183 184 185
	/*
	if(redirect != '') {
		loadContent(redirect);
		redirect = '';
	}
	*/
}

function submitUploadForm(formname,target) {
186
	/*
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
	var submitFormCallback = {
		success: function(o) {
			if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
				var parts = o.responseText.split(':');
				//alert(parts[1]);
				loadContent(parts[1]);
				//redirect = parts[1];
				//window.setTimeout('loadContent(redirect)', 1000);
			} else {
				document.getElementById('pageContent').innerHTML = o.responseText;
			}
		},
		upload: function(o) {
        	if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
				var parts = o.responseText.split(':');
				//alert(parts[1]);
				loadContent(parts[1]);
				//redirect = parts[1];
				//window.setTimeout('loadContent(redirect)', 1000);
			} else {
				document.getElementById('pageContent').innerHTML = o.responseText;
			}
        },
		failure: function(o) {
211
			reportError('Ajax Request was not successful. 112');
212 213
		}
	}
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
	*/
	
	/*YAHOO.util.Connect.setForm(formname,true);*/
	/*var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', target, submitFormCallback);*/
	/*
	var submitFormObj = jQuery.ajax({		type: "POST", 
											url: target,
											data: jQuery('#'+formname).serialize(),
											success: function(data, textStatus, jqXHR) {
												if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
													var parts = jqXHR.responseText.split(':');
													//alert(parts[1]);
													loadContent(parts[1]);
													//redirect = parts[1];
													//window.setTimeout('loadContent(redirect)', 1000);
												} else {
													document.getElementById('pageContent').innerHTML = jqXHR.responseText;
												}
											},
											error: function() {
												reportError('Ajax Request was not successful. 112');
											},
									});
	*/		
	//var submitFormObj = jQuery('input[type="file"]').ajaxfileupload({ 'action': target });
239
	
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
	var handleResponse = function(loadedFrame) {
		var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;
		
		try {
			response = JSON.parse(responseStr);
		} catch(e) {
			response = responseStr;
		}
		var msg = '';
		var okmsg = jQuery('#OKMsg',response).html();
		if(okmsg){
			msg = '<div id="OKMsg">'+okmsg+'</div>';
		}
		var errormsg = jQuery('#errorMsg',response).html();
		if(errormsg){
			msg = msg+'<div id="errorMsg">'+errormsg+'</div>';
		}
		return msg;
		
    };
	
	var frame_id = 'ajaxUploader-iframe-' + Math.round(new Date().getTime() / 1000);
	jQuery('body').after('<iframe width="0" height="0" style="display:none;" name="'+frame_id+'" id="'+frame_id+'"/>');
	var submitFormObj = jQuery('input[type="file"]').closest("form").attr({target: frame_id, action: target}).submit();
	jQuery('#'+frame_id).load(function() {
        var msg = handleResponse(this);
		jQuery('#errorMsg').remove();
		jQuery('#OKMsg').remove();
		jQuery('input[name="id"]').before(msg);
      });
	//jQuery('#'+frame_id).remove();
	

273 274 275 276 277 278 279 280 281
	/*
	if(redirect != '') {
		loadContent(redirect);
		redirect = '';
	}
	*/
}

function loadContent(pagename) {
282
	/*
283 284 285 286 287 288 289 290 291 292 293 294 295
	var pageContentCallback2 = {
		success: function(o) {
			if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
				var parts = o.responseText.split(':');
				loadContent(parts[1]);
			} else if (o.responseText.indexOf('URL_REDIRECT:') > -1) {
				var newUrl= o.responseText.substr(o.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
				document.location.href = newUrl;
			} else {
				document.getElementById('pageContent').innerHTML = o.responseText;
			}
		},
		failure: function(o) {
296
			reportError('Ajax Request was not successful. 113');
297 298
		}
	}
299
	*/
300

301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
  /*var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, pageContentCallback2);*/
  var pageContentObject2 = jQuery.ajax({	type: "GET", 
											url: pagename,
											success: function(data, textStatus, jqXHR) {
												if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
													var parts = jqXHR.responseText.split(':');
													loadContent(parts[1]);
												} else if (jqXHR.responseText.indexOf('URL_REDIRECT:') > -1) {
													var newUrl= jqXHR.responseText.substr(jqXHR.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
													document.location.href = newUrl;
												} else {
													document.getElementById('pageContent').innerHTML = jqXHR.responseText;
												}
											},
											error: function() {
												reportError('Ajax Request was not successful. 113');
											},
									});
319 320 321 322
}


function loadInitContent() {
323
	/*
324 325 326 327 328 329 330 331 332 333
  var pageContentCallback = {
		success: function(o) {
			if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
				var parts = o.responseText.split(":");
				loadContent(parts[1]);
			} else {
				document.getElementById('pageContent').innerHTML = o.responseText;
			}
		},
		failure: function(o) {
334
			reportError('Ajax Request was not successful. 114');
335 336
		}
	}
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
	*/
  /*var pageContentObject = YAHOO.util.Connect.asyncRequest('GET', 'content.php?s_mod=login&s_pg=index', pageContentCallback);*/
	var pageContentObject = jQuery.ajax({	type: "GET", 
											url: "content.php",
											data: "s_mod=login&s_pg=index",
											success: function(data, textStatus, jqXHR) {
												if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
													var parts = jqXHR.responseText.split(":");
													loadContent(parts[1]);
												} else {
													document.getElementById('pageContent').innerHTML = jqXHR.responseText;
												}
											},
											error: function() {
												reportError('Ajax Request was not successful. 114');
											},
										});
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
  
  loadMenus();
  keepalive();
  setTimeout("setFocus()",1000);

}

function setFocus() {
/*
	var flag=false;
		for(z=0;z<document.forms.length;z++) {
			var form = document.forms[z];
			var elements = form.elements;
			for (var i=0;i<elements.length;i++) {
				var element = elements[i];
				if(element.type == 'text' &&
					!element.readOnly &&
					!element.disabled) {
						element.focus();
						flag=true;
						break;
					}
			}
			if(flag)break;
		}
*/
380 381 382 383
	try {
		document.pageForm.username.focus();
	} catch (e) {
	}
384 385 386 387
}


function loadMenus() {
388
	/*
389 390 391 392 393
	var sideNavCallback = {
		success: function(o) {
			document.getElementById('sideNav').innerHTML = o.responseText;
		},
		failure: function(o) {
394
			reportError('Ajax Request was not successful. 115');
395 396
		}
	}
397
	*/
398
	
399 400 401 402 403 404 405 406 407 408 409
  /*var sideNavObject = YAHOO.util.Connect.asyncRequest('GET', 'nav.php?nav=side', sideNavCallback);*/
  var sideNavObject = jQuery.ajax({			type: "GET", 
											url: "nav.php",
											data: "nav=side",
											success: function(data, textStatus, jqXHR) {
												document.getElementById('sideNav').innerHTML = jqXHR.responseText;
											},
											error: function() {
												reportError('Ajax Request was not successful. 115');
											},
									});
410
	
411
	/*
412 413 414 415 416
	var topNavCallback = {
		success: function(o) {
			document.getElementById('topNav').innerHTML = o.responseText;
		},
		failure: function(o) {
417
			reportError('Ajax Request was not successful. 116');
418 419
		}
	}
420
	*/
421
	
422 423 424 425 426 427 428 429 430 431 432
  /*var topNavObject = YAHOO.util.Connect.asyncRequest('GET', 'nav.php?nav=top', topNavCallback);*/
  var topNavObject = jQuery.ajax({			type: "GET", 
											url: "nav.php",
											data: "nav=top",
											success: function(data, textStatus, jqXHR) {
												document.getElementById('topNav').innerHTML = jqXHR.responseText;
											},
											error: function(o) {
												reportError('Ajax Request was not successful. 116');
											},
								});
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448

}

function changeTab(tab,target) {
	//document.forms[0].next_tab.value = tab;
	document.pageForm.next_tab.value = tab;
	submitForm('pageForm',target);
}
	
function del_record(link,confirmation) {
  if(window.confirm(confirmation)) {
          loadContent(link);
  }
}

function loadContentInto(elementid,pagename) {
449
	/*
450 451 452 453 454
	var itemContentCallback = {
		success: function(o) {
			document.getElementById(elementid).innerHTML = o.responseText;
		},
		failure: function(o) {
455
			reportError('Ajax Request was not successful. 118');
456 457
		}
	}
458
	*/
459 460
	

461 462 463 464 465 466 467 468 469 470
  /*var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback);*/
  var pageContentObject2 = jQuery.ajax({	type: "GET", 
											url: pagename,
											success: function(data, textStatus, jqXHR) {
												document.getElementById(elementid).innerHTML = jqXHR.responseText;
											},
											error: function() {
												reportError('Ajax Request was not successful. 118');
											},
										});
471 472
}

473
function loadOptionInto(elementid,pagename) {
474
	/*
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
	var itemContentCallback = {
		success: function(o) {
			var teste = o.responseText;
			var elemente = teste.split('#');
			el=document.getElementById(elementid);
			el.innerHTML='';
			for (var i = 0; i < elemente.length; ++i){

				var foo2 = document.createElement("option");
				foo2.appendChild(document.createTextNode(elemente[i]));
				foo2.value=elemente[i];
				el.appendChild(foo2);
			}
		},
		failure: function(o) {
490
		reportError('Ajax Request was not successful. 119');
491 492
		}
	}
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
	*/
	/*var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback);*/
	var pageContentObject2 = jQuery.ajax({	type: "GET", 
											url: pagename,
											success: function(data, textStatus, jqXHR) {
												var teste = jqXHR.responseText;
												var elemente = teste.split('#');
												el=document.getElementById(elementid);
												el.innerHTML='';
												for (var i = 0; i < elemente.length; ++i){

													var foo2 = document.createElement("option");
													foo2.appendChild(document.createTextNode(elemente[i]));
													foo2.value=elemente[i];
													el.appendChild(foo2);
												}
											},
											error: function() {
												reportError('Ajax Request was not successful. 119');
											},
										});
514 515
}

516
function keepalive() {
517
	/*
518 519 520 521 522
	var pageContentCallbackKeepalive = {
		success: function(o) {
			setTimeout( keepalive, 1000000 );
		},
		failure: function(o) {
523
			reportError('Session expired. Please login again.');
524 525
		}
	}
526
	*/
527
	
528 529 530 531 532 533 534 535 536 537
  	/*var pageContentObject3 = YAHOO.util.Connect.asyncRequest('GET', 'keepalive.php', pageContentCallbackKeepalive);*/
	var pageContentObject3 = jQuery.ajax({	type: "GET", 
											url: "keepalive.php",
											success: function(data, textStatus, jqXHR) {
												setTimeout( keepalive, 1000000 );
											},
											error: function() {
												reportError('Session expired. Please login again.');
											},
										});
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663
  	//setTimeout( keepalive, 1000000 );
}



var pass_minimum_length = 5;
var pass_messages = new Array();

var pass_message = new Array();
pass_message['text'] = "<?php echo $wb['password_strength_0_txt']?>";
pass_message['color'] = "#d0d0d0";
pass_messages[0] = pass_message;

var pass_message = new Array();
pass_message['text'] = "<?php echo $wb['password_strength_1_txt']?>";
pass_message['color'] = "red";
pass_messages[1] = pass_message;

var pass_message = new Array();
pass_message['text'] = "<?php echo $wb['password_strength_2_txt']?>";
pass_message['color'] = "yellow";
pass_messages[2] = pass_message;

var pass_message = new Array();
pass_message['text'] = "<?php echo $wb['password_strength_3_txt']?>";
pass_message['color'] = "#00ff00";
pass_messages[3] = pass_message;

var pass_message = new Array();
pass_message['text'] = "<?php echo $wb['password_strength_4_txt']?>";
pass_message['color'] = "green";
pass_messages[4] = pass_message;

var pass_message = new Array();
pass_message['text'] = "<?php echo $wb['password_strength_5_txt']?>";
pass_message['color'] = "green";
pass_messages[5] = pass_message;

function pass_check(password) {
	var length = password.length;
	var points = 0;
	if (length < pass_minimum_length) {
		pass_result(0);
		return;
	}
	
	if (length < 5) {
		pass_result(1);
		return;
	}
	
	if (pass_contains(password, "ABCDEFGHIJKLNMOPQRSTUVWXYZ")) {
		points += 1;
	}
	
	if (pass_contains(password, "0123456789")) {
		points += 1;
	}
	
	if (pass_contains(password, "`~!@#$%^&*()_+|\=-[]}{';:/?.>,<\" ")) {
		points += 1;
	}
	
	if (points == 0) {
		if (length >= 5 && length <=6) {
			pass_result(1);
		} else if (length >= 7 && length <=8) {
			pass_result(2);
		} else {
			pass_result(3);
		}
	} else if (points == 1) {
		if (length >= 5 && length <=6) {
			pass_result(2);
		} else if (length >= 7 && length <=10) {
			pass_result(3);
		} else {
			pass_result(4);
		}
	} else if (points == 2) {
		if (length >= 5 && length <=8) {
			pass_result(3);
		} else if (length >= 9 && length <=10) {
			pass_result(4);
		} else {
			pass_result(5);
		}
	} else if (points == 3) {
		if (length >= 5 && length <=6) {
			pass_result(3);
		} else if (length >= 7 && length <=8) {
			pass_result(4);
		} else {
			pass_result(5);
		}
	} else if (points >= 4) {
		if (length >= 5 && length <=6) {
			pass_result(4);
		} else {
			pass_result(5);
		}
	}
}



function pass_result(points, message) {
	if (points == 0) {
		width = 10;
	} else {
		width = points*20;
	}
	document.getElementById("passBar").innerHTML = '<div style="float:left; height: 10px; padding:0px; background-color: ' + pass_messages[points]['color'] + '; width: ' + width + 'px;" />';
	document.getElementById("passText").innerHTML = pass_messages[points]['text'];
}
function pass_contains(pass, check) {
	for (i = 0; i < pass.length; i++) {
		if (check.indexOf(pass.charAt(i)) > -1) {
			return true;
		}
	}
	return false;
}

function addAdditionalTemplate(){
	var tpl_add = document.getElementById('template_additional').value;
664
	
665 666 667 668
	  var tpl_list = document.getElementById('template_additional_list').innerHTML;
	  var addTemplate = document.getElementById('tpl_add_select').value.split('|',2);
	  var addTplId = addTemplate[0];
	  var addTplText = addTemplate[1];
669
	if(addTplId > 0) {
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701
	  var newVal = tpl_add + '/' + addTplId + '/';
	  newVal = newVal.replace('//', '/');
	  var newList = tpl_list + '<br>' + addTplText;
	  newList = newList.replace('<br><br>', '<br>');
	  document.getElementById('template_additional').value = newVal;
	  document.getElementById('template_additional_list').innerHTML = newList;
	  alert('additional template ' + addTplText + ' added to customer');
	} else {
	  alert('no additional template selcted');
	}
}

function delAdditionalTemplate(){
	var tpl_add = document.getElementById('template_additional').value;
	if(tpl_add != '') {
		var tpl_list = document.getElementById('template_additional_list').innerHTML;
		var addTemplate = document.getElementById('tpl_add_select').value.split('|',2);
		var addTplId = addTemplate[0];
		var addTplText = addTemplate[1];
		var newVal = tpl_add;
		newVal = newVal.replace(addTplId, '');
		newVal = newVal.replace('//', '/');
		var newList = tpl_list.replace(addTplText, '');
		newList = newList.replace('<br><br>', '<br>');
		document.getElementById('template_additional').value = newVal;
		document.getElementById('template_additional_list').innerHTML = newList;
		alert('additional template ' + addTplText + ' deleted from customer');
  } else {
  	alert('no additional template selcted');
  }
  
}
702 703 704 705 706 707 708 709 710 711 712

function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759

function loadwebip(elementid,pagename) {
	/*
	var itemContentCallback = {
		success: function(o) {
			var teste = o.responseText;
			var elemente = teste.split('#');
			el=document.getElementById(elementid);
			el.innerHTML='';
			for (var i = 0; i < elemente.length; ++i){

				var foo2 = document.createElement("option");
				foo2.appendChild(document.createTextNode(elemente[i]));
				foo2.value=elemente[i];
				el.appendChild(foo2);
			}
		},
		failure: function(o) {
		reportError('Ajax Request was not successful. 119');
		}
	}
	*/
	/*var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback);*/
	var pageContentObject2 = jQuery.ajax({	type: "GET", 
											url: pagename,
											success: function(data, textStatus, jqXHR) {
												var teste = jqXHR.responseText;
												var elemente = teste.split('#');
												el=document.getElementById(elementid);
												el.innerHTML='';
												for (var i = 0; i < elemente.length; ++i){

													var foo2 = document.createElement("option");
													foo2.appendChild(document.createTextNode(elemente[i]));
													foo2.value=elemente[i];
													el.appendChild(foo2);
												}
											},
											error: function() {
												reportError('Ajax Request was not successful. 119');
											},
										});
	var ruby = document.getElementById('ruby');
	ruby.style.display = 'none'; 
}