var btnJoinOver = new Image; 
var btnJoinOff = new Image;
var tabHomeOn = new Image;
var tabJoinOnr = new Image;
var tabContactOn  = new Image;
var tabHomeOff= new Image;
var tabJoinOff = new Image;
var tabContactOff  = new Image;
var btnCancelOver  = new Image;
var btnCancelOff  = new Image;

btnCancelOver.src = '/images/buttons/cancel_over.jpg'; 
btnCancelOff.src = '/images/buttons/cancel.jpg';
btnJoinOver.src = '/images/buttons/top_button_over.jpg'; 
btnJoinOff.src = '/images/buttons/top_button.jpg';
tabHomeOn = '/images/nav/nav_home_b.jpg';
tabJoinOn = '/images/nav/nav_join_b.jpg';
tabContactOn  = '/images/nav/nav_contact_b.jpg';
tabHomeOff= '/images/nav/nav_home_a.jpg';
tabJoinOff = '/images/nav/nav_join_a.jpg';
tabContactOff  = '/images/nav/nav_contact_a.jpg';

function roll_over(img_name, img_src) {
    document[img_name].src = img_src;
    }

function autotab(original,destination){
    if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
    destination.focus()
    }
	
	

function confirmDelete(id) {
	var answer = confirm("Are you sure that you want to permanently delete this entry?")
	if (answer){
		window.location = 'default.asp?DeleteID=' + id ;
	}
	else{
		alert('that was close')
	}
}
function confirmCommentDelete(id) {
	var answer = confirm("Are you sure that you want to permanently delete this entry?")
	if (answer){
		window.location = 'managecomments.asp?action=DELETE&CID=' + id ;
	}
	else{
		alert('that was close')
	}
}
function confirmCatDelete(id) {
	var answer = confirm("Are you sure that you want to permanently delete this entry?")
	if (answer){
		window.location = 'CategoryEdit.asp?DeleteID=' + id ;
	}
	else{
		alert('that was close')
	}
}
function confirmCommentHide(id) {
	var answer = confirm("Are you sure that you want to Hide this entry?")
	if (answer){
		window.location = 'managecomments.asp?action=HIDE&CID=' + id ;
	}
}

function confirmCommentUnHide(id) {
	var answer = confirm("Are you sure that you want to Display this comment?")
	if (answer){
		window.location = 'managecomments.asp?action=UNHIDE&CID=' + id ;
	}
}


function confirmIPBlock(id) {
	var answer = confirm("Are you sure that you want to Block this IP address?")
	if (answer){
		window.location = 'managecomments.asp?action=BLOCK&CID=' + id ;
	}
}

function confirmIPunBlock(id) {
	var answer = confirm("Are you sure that you want to UNBLOCK this IP address?")
	if (answer){
		window.location = 'managecomments.asp?action=UNBLOCK&CID=' + id ;
	}
}

function ShowHide(nr){
	if (document.getElementById)
	{
		current = (document.getElementById(nr).style.display == 'block') ? 'none' : 'block';
		document.getElementById(nr).style.display = current;
	}
}
function swapImg(frmPoster){
	var imgPath = "/blog/photos/";
	imgName = frmPoster.options[frmPoster.selectedIndex].text;
	imgName = imgName.replace(' ','_') + '.jpg';
	imgName = imgName.replace('&uuml;','u');
	imgName = imgName.replace('ü','u');
	document.posterImg.src = imgPath+imgName;
}	


function NewPopUp(xbit){
  
   var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      myWidth = window.innerWidth;
      myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      //IE 4 compatible
      myWidth = document.body.clientWidth;
      myHeight = document.body.clientHeight;
    }
    document.getElementById("PopupBox").style.left=parseInt((myWidth-700)/2);
  document.getElementById("PopupBox").style.top=parseInt((myHeight-550)/2);
  var xurl;
  xurl="/newpopup.asp?ID="+xbit;
  document.getElementById("PopupBox").style.visibility="visible";
  document.getElementById("PopupFrame").src=xurl;
  document.getElementById("PopupBack").style.visibility="visible";
}
