function openWindow(URL) {
  //for ns don't have spaces in options
  var options = "screenX=0,screenY=0,top=0,left=0,toolbar=yes,location=yes,resizable=yes,menubar=yes,scrollbars=yes,width=";
  options += (screen.width - 100);
  options += ",height=";
  options += (screen.height - 100);
  popupWin = window.open(URL,"_blank",options);
	return false;
}


function openWindowSpecifySize(URL,width,height) {
  //for ns don't have spaces in options
  var options = "screenX=0,screenY=0,top=0,left=0,toolbar=yes,location=yes,resizable=yes,menubar=yes,scrollbars=yes,width=";
  options += width + ",height=" + height;
  popupWin = window.open(URL,"_blank",options);
	return false;
}


function upload(id){
  var form = '/uploadFileForm.php?id=' + id;
  openWindowSpecifySize(form,'',400,100);
}


function gotosite(site) {if (site != "") {self.location=site;}}


function mouseOverSelect() {
  arg = mouseOverSelect.arguments;
  if (document.images){
    eval ('document.' + arg[0] + '.src=arg[1]');
  }
}


function confirmLink(theLink, text){
  var is_confirmed = confirm('Are you sure you want to' + ' :\n' + text + '?');
  if (is_confirmed) {
    theLink.href += '&is_js_confirmed=1';
  }
  return is_confirmed;
}


var pw;
function s(el,name){
	if(el.lastChild.nodeName == 'UL'){
		if(document.defaultView && document.getElementById('prev') && document.defaultView.getComputedStyle){
			pw = (document.getElementById('prev').offsetWidth-document.getElementById('prev').scrollWidth) ? document.getElementById('prev').offsetWidth-document.getElementById('prev').scrollWidth : pw;
			document.getElementById('prev').style.paddingRight = pw+'px';
			document.getElementById('prev').style.overflow     = 'hidden';
		}
	}
	else {
		return;
	}

	if(!window.iemac){
		var w                          = (window.innerWidth) ? document.documentElement.offsetWidth : (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
		var sx                         = getPageOffsetLeft(el);
		var sy                         = getPageOffsetTop(el);
		el.lastChild.style.top         = sy+el.offsetHeight-2+'px';

		if(sx+el.offsetWidth>(w/2)){
			el.lastChild.style.right     = (w-sx-el.offsetWidth) + getPageOffsetLeft(document.getElementById('outer'))  +'px';
		}
		else{
			el.lastChild.style.left      = sx-getPageOffsetLeft(document.getElementById('outer'))+'px';
		}
	}
	else {
		el.lastChild.style.marginLeft  = '116px';
		el.lastChild.style.marginTop   = '18px';
	}
	el.lastChild.style.visibility    = 'visible';
}

function h(el){
  if(el.lastChild.nodeName == 'UL'){
    el.lastChild.style.visibility = 'hidden';
    if(document.defaultView && document.getElementById('prev') && document.defaultView.getComputedStyle){
  		document.getElementById('prev').style.overflow     = 'auto';
		  document.getElementById('prev').style.paddingRight = '0';
		}
  }
}


function getPageOffsetLeft(el) {
  var x;
  x = el.offsetLeft;
  if (el.offsetParent != null) { x += getPageOffsetLeft(el.offsetParent); }
  return x;
}


function getPageOffsetTop(el) {
  var y;
  y = el.offsetTop;
  if (el.offsetParent != null) { y += getPageOffsetTop(el.offsetParent); }
  return y;
}


function ff(){
  var w     = (window.innerWidth) ? document.documentElement.offsetWidth : (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
  var space = (w-954)/2;

  if(space>180){
    var g = document.getElementById('adsense');
    if(g){
    	g.style.position = 'absolute';
	    g.style.top      = '10px';
    	g.style.left     = (w-165)+'px';
	    g.style.display  = 'block';
	}
  }
  
  if(document.location.href.indexOf('http://www.robzand.com/blog/')==0){
	  var ar = document.getElementById('nav').getElementsByTagName('a');
		if(document.location.href.indexOf('http://www.robzand.com/blog/kate-and-rob')==0){
	 	  ar[(ar.length-1)].parentNode.id='selected';
		}
		else{
	 	  ar[1].parentNode.id='selected';
		}
	}
	
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){
		var ar = document.getElementById('flinks').getElementsByTagName('a');
		for(var j=0;j<ar.length;j++){
			ar[j].innerHTML += '&nbsp;&gt;';
		}
		ar = document.getElementById('nav').getElementsByTagName('a');
		for(var j=0;j<ar.length;j++){
			ar[j].innerHTML += '&nbsp;&gt;';
		}		
		window.scrollTo(0,1);		
	}
}


window.onload = ff;
var mvdar     = new Array();
var xmlr     = new Array();