function confirmDelete(nextLocation){

	if (confirm("Are you sure you want to delete?")){
		window.location = nextLocation;
	}
}

function ask_use_credit(loc){
	if (confirm("Are you sure you want to publish this ad?")){
		window.location = loc;
	}
}

function ask_use_credit_published(loc){
	if (confirm("This ad is already published, are you sure you want to extend the expiration date?")){
		window.location = loc;
	}
}
function ask_extend(loc){
	if (confirm("Are you sure you want to extend the expiration date?")){
		window.location = loc;
	}
}






// Example:
// onMouseOver="toolTip('tool tip text here')";
// onMouseOut="toolTip()";
// -or-
// onMouseOver="toolTip('more good stuff', '#FFFF00', 'orange')";
// onMouseOut="toolTip()"; 
/*
MOVE this to the <body>:
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="JavaScript"><!--
initToolTips(); //--></script>
*/
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 30;
offsetY = -16;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmouseover = moveToMouseLoc;
  }
}
function toolTip(msg, styleClassName)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!styleClassName) styleClassName = "tooltip";
    var content =
    '<table class="' + styleClassName + '" border="0" cellspacing="0" cellpadding="10"><td>' +
    '<table border="0" cellspacing="0" cellpadding="0">' +
	'<td align="center">&nbsp\;' + msg +
    '&nbsp\;</td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}





function mOvr(src,bgClrOvr,brdClrOvr){ 
	if (document.all||document.getElementById) {
		src.style.cursor = 'hand';
		src.style.backgroundColor=bgClrOvr;
		src.style.borderColor=brdClrOvr;
	}
} 


function mOut(src,bgClrOut,brdClrOut){
	if (document.all||document.getElementById) {
		src.style.cursor = 'default';
		src.style.backgroundColor=bgClrOut;
		src.style.borderColor=brdClrOut;
	}
} 

function mClk(dst){
	parent.location=dst;
}

function switchImage(imgName, imgSrc) {
	if (document.images) {
    	if (imgSrc != "none") {
      		document.images[imgName].src = imgSrc;
    	}
  	}
}



function check_form_login() {

	if (document.login_form.loginId.value.length == 0) {
		document.login_form.loginId.focus();
		document.images['check_loginId'].src='art/red.gif';
		return false;
	}
	else {
		document.images['check_loginId'].src='art/ok.jpg';
	}

	if (document.login_form.loginPwd.value.length == 0) {
		document.login_form.loginPwd.focus();
		document.images['check_loginPwd'].src='art/red.gif';
		return false;
	}
	else {
		document.images['check_loginPwd'].src='art/ok.jpg';
	}

	return true;
}

function check_form(formName) {

	if (document.forms[formName].name.value.length == 0) {
		document.forms[formName].name.focus();
		document.images['checkName'].src='art/red.gif';
		return false;
	}
	else {
		document.images['checkName'].src='art/ok.jpg';
	}

	if (document.forms[formName].email.value.length == 0) {
		document.forms[formName].email.focus();
		document.images['checkEmail'].src='art/red.gif';
		return false;
	}
	else {
		document.images['checkEmail'].src='art/ok.jpg';
	}

	if (document.forms[formName].message.value.length < 2) {
		document.forms[formName].message.focus();
		document.images['checkMessage'].src='art/red.gif';
		return false;
	}
	else {
		document.images['checkMessage'].src='art/ok.jpg';
	}
	
	// Everything seems fine.

	document.forms[formName].validated.value = 'true';

	// Lock submit button, prevents accidential double clicks
	document.forms[formName].submit.disabled = true;

	return true;
}

function ptrOver(where,bgClr) {
	var text;
	if (where == 'item') {
		document.getElementById('search_arrow_cond').style.visibility = 'hidden';
		document.getElementById('search_arrow_state').style.visibility = 'hidden';
		document.getElementById('search_arrow_item').style.visibility = 'visible';
		text = 'Alternativ 1';
	}
	if (where == 'state') {
		document.getElementById('search_arrow_cond').style.visibility = 'hidden';
		document.getElementById('search_arrow_item').style.visibility = 'hidden';
		document.getElementById('search_arrow_state').style.visibility = 'visible';
		text = 'Alternativ 2';
	}
	if (where == 'cond') {
		document.getElementById('search_arrow_state').style.visibility = 'hidden';
		document.getElementById('search_arrow_item').style.visibility = 'hidden';
		document.getElementById('search_arrow_cond').style.visibility = 'visible';
		text = 'Alternativ 3';
	}
	document.getElementById('search_menu').style.backgroundColor = bgClr;
	document.getElementById('search_arrow').style.backgroundColor = bgClr;
	document.getElementById('search_menu_info').innerHTML = text;	
}

function ptrOut() {
	document.getElementById('search_arrow_item').style.visibility = 'hidden';	
	document.getElementById('search_arrow_state').style.visibility = 'hidden';	
	document.getElementById('search_arrow_cond').style.visibility = 'hidden';	
	document.getElementById('search_menu').style.backgroundColor = '';
}

function ptrClik(alt) {
	var altItem = document.getElementById('search_alt_item');
	var altState = document.getElementById('search_alt_state');
	var altCond = document.getElementById('search_alt_cond');
	if (alt == 'item') {
		altState.style.visibility = "hidden";
		altCond.style.visibility = "hidden";
		altItem.style.visibility = "visible";
		document.getElementById('search_menu').style.backgroundColor = '#77AADD';
	}
	if (alt == 'state') {
		altItem.visibility = "hidden";
		altCond.visibility = "hidden";
		altState.visibility = "visible";
		document.getElementById('search_menu').style.backgroundColor = '#DD77AA';
	}
	if (alt == 'cond') {
		altState.visibility = "hidden";
		altItem.visibility = "hidden";
		altCond.visibility = "visible";
		document.getElementById('search_menu').style.backgroundColor = '#DDAA77';
	}
	return true;
}

function showContent(content) {
	var id = 'page_specific_links';
	document.getElementById(id).innerHTML = content;
//	document.getElementById(id).style.visibility = 'visible';
}

function arwShow(id) {
	document.getElementById(id).style.visibility = 'visible';
}

function arwHide(id) {
	document.getElementById(id).style.visibility = 'hidden';
}

// Example:
// simplePreload( '01.gif', '02.gif' ); 
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
