function printContents()
{
	iWidth = window.screen.width;
	iHeight = window.screen.height;
    wt = 630;
    ht = 460;
    lt = (iWidth - wt) / 2;
    tp = (iHeight - ht) / 2;
    window.open("print.php", '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes'); 
}

function preview(file, desc, width, height)
{
 if (desc == null) {
   desc = '';
 }
 
 var left = (screen.width - width) / 2;
 var top = (screen.height - height + 20) / 2;
 window.open("preview.php?file="+file+"&desc="+desc, "_preview_", "width="+width+",height="+height+",top="+top+",left="+left);
}

function getWindowWidth() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    return window.innerWidth - 20;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    return document.body.clientWidth;
  }
  return 0;
}

function placePath() {
	var posX = (getWindowWidth() / 2) + 167;
	document.getElementById('pathPicture').style.left = posX + 'px';
	document.getElementById('pathPicture').style.display = 'block';
	posX = (getWindowWidth() / 2) - 350;
	document.getElementById('pathLine').style.left = posX + 'px';
	document.getElementById('pathLine').style.display = 'block';
}

var commentWin = 0;

function commentWindow() {
	if (commentWin == 0) {
		document.getElementById('commentForm').style.display = 'block';
		commentWin = 1;
	} else {
		document.getElementById('commentForm').style.display = 'none';
		commentWin = 0;
	}
}

function SendToFriend(link) {
 if (typeof( window.innerWidth ) == 'number' ) {
	window.open("send.php?url_query="+link,"","width=430,height=202,status=no,scrollbars=no");
 } else {
	window.open("send.php?url_query="+link,"","width=430,height=192,status=no,scrollbars=no");
	}
}
