// path variabel
var basepath,basepathformulare,basepathmedien
basepath = '/internet/sfsunimarket.nsf/';
basepathformulare = '/internet/sfsunimarket.nsf/sfsunimarket.nsf/';
basepathmedien = '/internet/sfsmedien.nsf/';
basepathreplace = 'internet/sfsunimarket.nsf';
basepathmedienreplace = 'internet/sfsmedien.nsf/';
// window variabel
windowopen = false;
windowopenEkk = false;
// open window
function open_window(url,width,height) {
var hwin_w=(screen.width-width)/2;
var hwin_h=(screen.height-height)/2;
var window_option="alwaysRaised=yes,resizable=no,scrollbars=yes,toolbar=no,width=" + width + ",height=" + height + ","
var tmpURL = "";
// basePath prüfen und reagieren
if (url.indexOf(".nsf") > -1){
tmpURL = url;
}
else {
tmpURL = basepath + url;
}
if (windowopen) {
if (hwin.closed) {
hwin = window.open(tmpURL,"popup",window_option + scroll);
} else {
hwin.location.href = tmpURL;
hwin.resizeTo(width,height);
hwin.focus();
}
} else {
hwin = window.open(tmpURL,"popup",window_option + scroll);
windowopen = true;
}
}
// open URL in new window
function Go_global(target) {
var url = document.MOUrlSelecter.MOUrl.value;
if (url == 0) {
alert("Bitte wählen Sie Ihr Land aus.");
return;
}
if (target == "_blank") {
window.open(url,"","")
}
else {
location.href = url;
}
}
// open panorama window
function panorama(image) {
var strAltText;
if(language == "CL")
strAltText = "";
else if(language == "DE")
strAltText = "Virtuelle Panoramasicht 360°";
else if(language == "FR")
strAltText = "Panorama virtuel sur 360°";
else if(language == "IT")
strAltText = "Panoramica virtuale 360°";
else if(language == "EN")
strAltText = "Virtuelle Panoramasicht 360°";
else if(language == "ES")
strAltText = "Vista panorámica virtual de 360°";
document.write('
');
}
// open window panorama
function OpenPanorama(imageid) {
var width=505;
var height=330;
var window_option="alwaysRaised=yes,resizable=no,scrollbars=no,width=" + width + ",height=" + height + ","
var url=basepath + "fPanorama?ReadForm&img=" + imageid + "&lg=" + language
if (windowopen) {
if (hwin.closed) {
hwin = window.open(url,"panorama",window_option + scroll);
} else {
hwin.location.href = url;
hwin.resizeTo(width,height);
hwin.focus();
}
} else {
hwin = window.open(url,"panorama",window_option + scroll);
windowopen = true;
}
}
// open window CTF SearchResult
function PrintCTF() {
var width=700;
var height=600;
var window_option="alwaysRaised=yes,resizable=no,scrollbars=yes,width=" + width + ",height=" + height + ","
var url = location.href + "&action=print";
if (windowopen) {
if (hwin.closed) {
hwin = window.open(url,"CTFPrint",window_option + scroll);
} else {
hwin.location.href = url;
hwin.resizeTo(width,height);
hwin.focus();
}
} else {
hwin = window.open(url,"CTFPrint",window_option + scroll);
windowopen = true;
}
}
// openHelp
function openHelp(pageid) {
open_window(basepath + "popup/" + pageid,785,431);
}
// openUpLoad
function openUpLoad(lg) {
var width=470;
var height=350;
var tmpDocID = window.document.forms["FormBuilder"].UpLoadDocID.value;
if (tmpDocID == "") {
open_window(basepath + "fUpLoad?OpenForm&LG=" + lg,width,height);
}
else{
open_window(basepath + "/requests/" + tmpDocID + "?EditDocument&LG=" + lg,width,height);
}
}
// close window
function close_window() {
if (windowopen) {
if (!hwin.closed)
hwin.close();
}
}
// validateNumber
function validateNumber(field) {
var strString = field.value;
var strValidChars = field.value;
var posComma = strString.indexOf(",");
if (posComma > -1) {
field.value = strString.replace(/,/, ".");
}
// check for valid numeric strings
var strValidChars = "0123456789.-";
var strChar;
var blnResult = true;
if (strString.length == 0) return false;
for (i = 0; i < strString.length && blnResult == true; i++){
strChar = strString.charAt(i);
if (strValidChars.indexOf(strChar) == -1) {
field.value = "";
break;
}
}
}
// toggleCheckAll
function ToggleCheckAll(button) {
var sa=true;
if(button.checked)
sa=false;
for (var i=0;i count){
var strText;
if(language == "CL")
strText = "error";
else if(language == "DE")
strText = "error";
else if(language == "FR")
strText = "error";
else if(language == "IT")
strText = "error";
else if(language == "EN")
strText = "error";
else if(language == "ES")
strText = "error";
var strTextTotal = strText.replace("##Count#", count);
alert(strTextTotal );
elm[i].checked=false;
}else{
checked=checked + 1
}
}
}
}
function altnavpopup(message){
var isImg = message.indexOf("/$FILE/");
if (isImg < 0) {
source = message;
var bcolor = '#F3F3F3'
if (source.length >= 70){
ddrivetip(''+source+'
',bcolor);
} else {
ddrivetip(source,bcolor);
}
}
else {
source = '
';
var bcolor = '#FFF'
ddrivetip(source,bcolor);
}
}
function altnavpopout(){
hideddrivetip();
}
//---- Include Function Bibliothek -----
function writeimage(imageid,source) {
document.write('
');
}
function writeusemap(imageid,source,usemap) {
document.write('
');
}
// create image link
function writeimagelink(imageid,linkid,source) {
document.write('
');
}
// replace /srv/
function act_server() {
// Alle Links durchlaufen und pruefen
var anzHrefs = document.getElementsByTagName("a").length;
for (var i = 0;i <= anzHrefs - 1;i++) {
var currentLink = document.getElementsByTagName("a")[i].href;
//TAG /srv/ im Link, $Q$ suchen
var posSRV = currentLink.indexOf("/srv/");
var posQ = currentLink.indexOf("$Q$");
if (posSRV > 0) {
var newLink = currentLink.replace("/srv/", "/"+Server_name+"/");
document.getElementsByTagName("a")[i].href = newLink;
}
if (posQ > 0) {
var newLink = currentLink.replace("$Q$", sQuery);
document.getElementsByTagName("a")[i].href = newLink;
}
}
}
// replacePath
function replacePath(){
elements = document.getElementsByName("ReplacePath")
var hrefPath;
var imgPath;
var newPath;
for(var i = 0; i < elements.length; i++){
if (elements[i].src) {
imgPath = elements[i].src
newPath = imgPath.replace(/##MEDIENPATH#/,basepathmedienreplace);
elements[i].src = newPath
elements[i].style.display = ""
}else{
// BasePathMedien setzen
hrefPath = elements[i].href
if (hrefPath.indexOf("##MEDIENPATH#") > 0) {
newPath = hrefPath.replace(/##MEDIENPATH#/,basepathmedienreplace);
} else if (hrefPath.indexOf("@@MEDIENPATH@") > 0) {
newPath = hrefPath.replace(/@@MEDIENPATH@/,basepathmedienreplace);
} else if (hrefPath.indexOf("@@BASEPATH@") > 0) {
newPath = hrefPath.replace(/@@BASEPATH@/,basepathreplace);
}
elements[i].href = newPath
elements[i].style.display = ""
}
}
}
// create text link for download
function writetxtdownload(imageid,linktext,target,source) {
document.write("" + linktext + "");
}
// create image link for download
function writeimgdownload(imageid,linkid,target,source) {
document.write("
");
}
// writeDownload
function writeDownload(source_object,typ){
var cookie = Get_Cookie("SECURITYLOGIN");
if (cookie != null){
if (loginarea == ""){
var cookietype = "PUBLICAREA Link Download"
} else {
cookietype = loginarea;
}
if (cookietype != ""){
xmlConnection();
url = basepath + 'aAjax_WriteDownload?OpenAgent&cookie='+cookie+'&value='+source_object+'&language='+language+'&loginarea='+loginarea+'&cookietype='+cookietype+'&typ='+typ+'&cache='+Date();
xmlhttp.open("POST",url, true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send('null');
}
}
}
// create text link
function writelink(linkid,linktext) {
document.write('' + linktext + '');
}
// create webform link
function wForm(linkform,linktext) {
document.write('' + linktext + '')
}
// create text linkRepID
function writelinkRepID(linkid,linktext,repid) {
var url="http://" + location.hostname + "/__" + repid + ".nsf/PageID/" + linkid;
document.write('' + linktext + '');
}
// create text link with popup
function writelinkpopup(linkid,linktext,popup) {
document.write('' + linktext + '');
}
// create externel link
function writeextlink(object,linkid,target,flag,source) {
if(flag=="0") {
var popup="
";
document.write('' + linkid + popup + '');
}
else{
document.write('
');
}
}
// write ankerlink
function writeankerlink(anker,ankertxt,titleflag,flag) {
var title
var br
if (titleflag=="0") {
title = " ";
br = "";
}
else {
title = "" + ankertxt + "";
br = "
";
}
if (flag=="0") {
document.write(' ' + ankertxt + '');
}
else {
document.write(br + '' + title + '');
}
}
// create DocDownload for registration
function docdwreg(docui,docui1,linktext,source,variante,alt) {
// docui=Download Document
// docui1=Ressourcen Document
var link="aGoToDocDownload?OpenAgent&LG="+language+"&DOC="+docui;
//variante1 = Thumbnail
//variante2 = Textlink
if (variante=="1") {
var thumbnail="
";
document.write(''+thumbnail+'');
}
else {
document.write(''+linktext+'');
}
}
// AGBFalse
function AGBFalse(page){
if(page == ""){
document.location = basepath
}
else{
document.location = basepath + "PageID/" + page
}
}
// submitProfile
function submitProfile() {
{
form = document.SecurityProfile;
ok = true;
/**/
if (form.Firma.value == '')
{
form.Firma.style.border ='1px solid #CC3333';
ok=false;
form.Firma.focus();
} else {
form.Firma.style.border ='1px solid #CCC';
}
/**/
if (form.Vorname.value == '')
{
form.Vorname.style.border ='1px solid #CC3333';
ok=false;
form.Vorname.focus();
} else {
form.Vorname.style.border ='1px solid #CCC';
}
/**/
if (form.Name.value == '')
{
form.Name.style.border ='1px solid #CC3333';
ok=false;
form.Name.focus();
} else {
form.Name.style.border ='1px solid #CCC';
}
/**/
if (ok==true)
{
return "http://www.sfsservices.biz";
} else {
return false;
}
}
}
// Define bookmarks
function bookmark() {
//***---This text will be shown to the visitor if it has Netscape.
netscape="First push OK and then hit CTRL+D to add a bookmark to this site."
if (navigator.appName=='Microsoft Internet Explorer') {
window.external.AddFavorite(location.href, document.title);
}
else if (navigator.appName=='Netscape')
{
alert(netscape);
}
}
// DATE-validation:
function dateValidate(sDate,sMask,sDelimiter,sErrorMessage){
if (sErrorMessage == null) sErrorMessage = "Invalid Date Entry.";
bSuccess = false;
stDateParts = new Object();
if ((sMask.length == 3) && (sDelimiter.length == 1)) {
iFirstPos = sDate.indexOf(sDelimiter);
iLastPos = sDate.indexOf(sDelimiter, iFirstPos+1);
stDateParts[sMask.charAt(0).toUpperCase()]= sDate.substring(0, iFirstPos);
stDateParts[sMask.charAt(1).toUpperCase()]= sDate.substring(iFirstPos + 1, iLastPos);
stDateParts[sMask.charAt(2).toUpperCase()]= sDate.substring(iLastPos + 1, sDate.length);
day = stDateParts.D;
month = stDateParts.M;
year = stDateParts.Y;
if ((year != null)&&(year.length > 0)&&(year.length < 5)&&
(month != null)&&(month.length > 0)&&(month.length < 3)&&
(day != null)&&(day.length > 0)&&(day.length < 3)) {
if ((year > 0) && (year < 10000)) {
if ((month > 0) && (month < 13)) {
if ((day > 0) && (day < 32)) {
if ((month == 4) || (month == 6) ||(month == 9) ||(month == 11)) {
if (day < 31) {
bSuccess = true;
}
}
else if (month == 2){
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
if (day < 30) {
bSuccess = true;
}
}
else {
if (day < 29) {
bSuccess = true;
}
}
}
else {
bSuccess = true;
}
}
}
}
}
}
if ((bSuccess == false) && (sErrorMessage != "")) alert(sErrorMessage);
return bSuccess;
}
// visibleQuestion
function visibleQuestion(id,div){
alert("thomas");
if (document.getElementById(id).checked == "true"){
document.getElementById(div).style.visible = "block";
} else {
document.getElementById(div).style.visible = "none";
}
}
// Left
function Left(str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else
return String(str).substring(0,n);
}
// Right
function Right(str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else {
var iLen = String(str).length;
return String(str).substring(iLen, iLen - n);
}
}
// replaceID
function replaceIt(string,suchen,ersetzen)
{
ausgabe = "" + string;
while (ausgabe.indexOf(suchen)>-1) {
pos= ausgabe.indexOf(suchen);
ausgabe = "" + (ausgabe.substring(0, pos) + ersetzen +
ausgabe.substring((pos + suchen.length), ausgabe.length));
}
return ausgabe
}
// CheckNumber
function CheckNumber() {
form = document.seitesenden;
var strAltText;
if(language == "CL")
strAltText = "The inserted code is not valid!";
else if(language == "DE")
strAltText = "Der eingegebene Code stimmt nicht über ein!";
else if(language == "FR")
strAltText = "Le code enregistré est erroné!";
else if(language == "IT")
strAltText = "Il codice inserito non è corretto!";
else if(language == "EN")
strAltText = "The inserted code is not valid!";
else if(language == "ES")
strAltText = "El código grabado es incorrecto!";
if (form.PruefKeySend.value == form.PruefKey.value){
return true;
}else{
form.PruefKeySend.value = '';
form.PruefKeySend.style.border ='1px solid red';
alert(strAltText);
form.PruefKeySend.focus();
return false;
}
}
// setCursor
function setCursor(mode){
document.body.style.cursor=mode;
}