var wCount = 0;

function showPic(theUrl) {
	if (theUrl == "none") return false;
	var xposition=0;
	var yposition=0;
	var width=550;
	var height=410;
    if ((parseInt(navigator.appVersion) >= 4 )){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
	var winFeatures;
	winFeatures = "width=" + width + ","
    + "height=" + height + ","
	+ "resizable,"
	+ "scrollbars,"
	+ "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only
	winname = wCount++;

	window.open(theUrl,winname,winFeatures,"");
}

function displayErrors(empty, errors) {
	var w = openAWindow("","","525","350","1");
	var d = w.document;

	d.open();
	d.write('<html><head><title>Contact Issues</title>');
	d.write('<link rel="stylesheet" type="text/css" href="/include/style.css">');
	d.write('</html><body><table width="100%" border="0" cellpadding="0" cellspacing="0">');
	d.write('<tr><td colspan="2" class="ContentTitle"><font color="#ff0303">We are sorry, but the following issues need to be addressed before we can send your message:</font></td></tr>');
	if (empty.length > 0) {	
		d.write('<tr><td colspan="2" bgcolor="#000000"><img src="/images/shim.gif" width="10" height="1"></td></tr>');
		d.write('<tr><td colspan="2"><b>The following fields cannot be empty:</b></td></tr>');
		d.write('<tr><td width="5"><img src="/images/shim.gif" width="5" height="1"></td>');
		d.write('<td>');
		for (var p=0;p<empty.length;p++) {
			d.write(empty[p].replace("_"," ")+'<br>');
		}
		d.write('</td></tr>');
	}
	d.write('<tr><td colspan="2"><img src="/images/shim.gif" width="1" height="10"></td></tr>');
	d.write('<tr><td colspan="2">');
	for (var r=0;r<errors.length;r++) {
		d.writeln('<b>'+errors[r]+'</b><br>');
	}
	d.write('</td></tr>');
	d.write('<tr><td colspan="2" bgcolor="#000000"><img src="/images/shim.gif" width="10" height="1"></td></tr>');
	d.write('<tr><td colspan="2" align="right"><a href="javascript:window.close();"><font color="#ff0303">');
	d.write('<b>close</b></font></td></tr></table></body></html>');
	d.close();
}
  
// A utility function that returns true if a string contains only 
// whitespace characters.
function isblank(s) {
	for (var i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
	}
	return true;
}
