//

 function urlNameGer() {
	var somePath=document.URL;
	var getSrc = "http://www.directpos.de/";
	return getSrc;	
}


// =====================================The ultimative rollover-script============================================================//

// global, so that it's visible for the Event-Handlers
var Images;

// this function has to be called in a eventhandler of the form
// <body onLoad="initImageLoader(ImgSuffixes);">
//
// the array itself is defined in the HTML-Page e.g.:
//<SCRIPT language="JavaScript">
//ImgSuffixes = new Array("_off", "_hover", "_active");
//</SCRIPT>

function initImageLoader(theImgSuffixes) {
	var imgNameArray = getNamedImages();
	var imgUrlArray = getUrlArray(imgNameArray, theImgSuffixes);
	
	//load images on the global variable
	Images = preLoadImages(imgUrlArray); 
}

// returns an Array with the names of all named images of the document
// the inelegant use of the buffer-Variable is due to Netscape
function getNamedImages() {
	var arraySize = 0;
	
	// determine the arraysize. IE 4.0 has no push()-function. :(
	for (var i = 0; i < document.images.length; i++) {
		var buffer = document.images[i].name;
		if (buffer != "") {
			arraySize++;
		}
	}
	
	// fill the array
	var index = 0;
	imgNames = new Array(arraySize);
	
	for (var j = 0; j < document.images.length; j++) {
		var buffer = document.images[j].name;
		if (buffer != "") {
			imgNames[index] = buffer;
			index++;
		}
	}
	return imgNames;
}

// create a Array of Strings with URLs for the preLoadImages()-function
// TheImgNames - Array with Strings of Image names (name="")
// TheSuffixes - Array with Image Suffixes, eg ("", "_on")
function getUrlArray(TheImgNames, TheSuffixes) {
	ImgUrls = new Array(TheImgNames.length * TheSuffixes.length);

	for(var i = 0; i < TheImgNames.length; i++) {
		for(var j = 0; j < TheSuffixes.length; j++) {
			var someString = eval("document." + TheImgNames[i] + ".src");
			var defaultSuffixLength =  TheSuffixes[0].length;
			var dotPos = someString.lastIndexOf(".")
			ImgUrls[i * TheSuffixes.length + j] = someString.substring(0,dotPos-defaultSuffixLength) + TheSuffixes[j] + someString.substring(dotPos, someString.length);
		}
	}
	return ImgUrls;
}


// preloads Images. The URLs have to be defined as strings in 'theImgUrls'
function preLoadImages (theImgUrls) {
	imgObj = new Array();

	for (i = 1; i < theImgUrls.length ; i++) {
		imgObj[i] = new Image();
	    imgObj[i].src = theImgUrls[i];
	}
    
    //alert(theImgUrls.length);
	return imgObj;
}

// swaps Images, if they are loaded completely
function swapImage(imageName, imageObj) {
	if(imageObj.complete == true) {
     imageName.src = imageObj.src;
	}
}


// ====================================================================================================================//



// useful to change more than one frame
//	e.g.: <a href="javascript:changeFrames('frame1;http://foo.com|frame2;http://bar.com');">foo</a> */
function changeFrames(pString) {
	var entryPairs = pString.split("|");
	
	for(i = 0; i < entryPairs.length; i++) {
		var entryPair = entryPairs[i].split(";");
		parent.frames[entryPair[0]].location.href=entryPair[1];
	}
}


function openWindow (url, name, w, h, type) {
	switch(type) {
		case 1:
			NewWin = window.open(url, name, "width="+w+",height="+h+",resizable=no,scrollbars=no,screenY=0,screenX=0,toolbar=no");
			NewWin.focus();
		break;
		
		case 2:
			NewWin = window.open(url, name, "width="+w+",height="+h+",resizable=yes,scrollbars=yes,toolbar=yes");
			NewWin.focus();
		break;
		
 		default:
 			alert("wrong parameter for 'type' in call to 'openwin'");
 		break;
	} 
	return;
}


newWindow=null;

function openWin(sourceFile,winWidth,winHeight,winScroll){
	if(newWindow!=null&&!newWindow.closed&&window.focus)newWindow.focus();
	w=0;
	h=0;
	if((document.all||document.layers||document.getElementById)&&screen){
		w=(screen.width-winWidth)/2
		h=(screen.height-winHeight)/2
	}
	newWindow=window.open(sourceFile,"Popup","width="+winWidth+",height="+winHeight+",toolbar=no,location=no,status=no,menubar=no,scrollbars="+winScroll+",resizable=no,sreenX="+w+",screenY="+h);
	if(w>0&&h>0&&window.moveTo){
		newWindow.moveTo(w,h)
	}
}

//funktion für service/publikationen/sonstiges.html, carre.html, geschaeftsberichte.html, carre2000.html
/*
function pub_test() {
var count=0;
var c = document.forms[3].elements.length-9 ;
    	for(i=0; i<c; i++) {
			if(document.forms[3].elements[i].checked ==true) {
				count++;
			}
		}	
		if(count > 0) {
			return true;
		}else {
			alert("Sie haben keines der Angebote ausgwählt.");
			return false;
		}
}*/




