var IE = document.all?true:false
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

function getMouseXY(e) {

	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft
		tempY = event.clientY + document.body.scrollTop
	} else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX
		tempY = e.pageY
	}

 if(!e) e = window.event;
    var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
    window.document.documentElement : window.document.body || null;

    tempY = e.pageY ? e.pageY : e.clientY + body.scrollTop;
    tempX = e.pageX ? e.pageX : e.clientX + body.scrollLeft;

	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}
	// show the position values in the form named Show
	// in the text fields named MouseX and MouseY
	document.position.X.value = tempX
	document.position.Y.value = tempY
	return true
}


function viewColors(id,n){
w=500;
ref="index.php?app=colors&style=single&id="+id+"&_name="+n
self.open( ref, "Colors", "width="+w+",height="+w+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}


function galerieBook(url,w){
ref=url+"&style=diabook";
h=500;
self.open( ref, "galerieBook", "width="+w+",height="+h+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}

function galerieDiashow(url,w){
ref=url+"&style=diashow";
h=500;
self.open( ref, "galerieBook", "width="+w+",height="+h+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}

function BigImg(url,w,h){
w=(w+10);
h=(h+10);
//ref=url+"&style=book";
ref=url;
self.open( ref, "bigImg", "width="+w+",height="+h+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}

function BigSImg(url,w){
w=(w+100);
ref=url
self.open( ref, "bigSImg", "width="+w+",height="+w+",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}

function popUp(url){
self.open( url, "contentPopUp", "width=800,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}

function db_content(sid,table,field,id,printing,lang)
{
url="viewfield.php?_sid="+sid+"&lang="+lang+"&paket_id="+id+"&printing="+printing+"&table="+table+"&field="+field;
self.open( url, "fieldcontent", "width=450,height=500,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
self.focus;
}

function printDoc(url)
{
	self.open( url, "printDoc", "width=800,height=550,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1");
	self.focus;
}

function tip(lang,id,table,sid,hint)
{
url="tip.php?_sid="+sid+"&lang="+lang+"&table="+table+"&id="+id+"&hint="+hint;
self.open( url, "tip", "width=400,height=200,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=0,resizable=0");
self.focus;
}

function regNL()
{
self.open( "", "newsletter", "width=400,height=200,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars=0,resizable=0");
self.focus;
}

function printPopup() {
	parent.frames[1].focus();
	parent.frames[1].print();
}

function checkCard(){
	if(document.card.sendername.value == "")  {
		alert("Bitte Name eingeben!");
		document.card.sendername.focus();
		return false;
	}
	if(document.card.receivermail.value == "")  {
		alert("Bitte eMail eingeben!");
		document.card.receivermail.focus();
		return false;
	}
	if(document.card.sendermessage.value == "")  {
		alert("Bitte Nachricht eingeben!");
		document.card.sendermessage.focus();
		return false;
	}
}
function checkContact(){
	if(document.contact.sendername.value == "")  {
		alert("Bitte Name eingeben!");
		document.contact.sendername.focus();
		return false;
	}
	if(document.contact.sendermail.value == "")  {
		alert("Bitte eMail eingeben!");
		document.contact.sendermail.focus();
		return false;
	}
	if(document.contact.sendermessage.value == "")  {
		alert("Bitte Nachricht eingeben!");
		document.contact.sendermessage.focus();
		return false;
	}
}

function dispDeliverAddrRow()
{
	var selVisible=document.getElementById('deliver_adr_row');
	if(document.adress_edit.deliver_addr_merge.checked == true)
	{
		selVisible.style.display = "block";
	}
	else
	{
		selVisible.style.display = "none";
	}
}

function viewHB()
{
	var selVisible=document.getElementById('hint_box');
	if(selVisible.style.display == 'none')
	{
		selVisible.style.display = 'block';
		if (IE) {
			posY=Number (document.all.position.Y.value);
			posX=Number (document.all.position.X.value);
			/*alert(posX+" / "+posY);*/
			selVisible.style.top=(posY+20);
			selVisible.style.left=(posX+20);
		}
		else
		{
			posY=Number (document.position.Y.value);
			posX=Number (document.position.X.value);
			/*alert(posX+" / "+posY);*/
			selVisible.style.top=(posY+20);
			selVisible.style.left=(posX+20);
		}
	}
	else
	{
		selVisible.style.display = 'none';
	}
}

