function contest() {
    pop = window.open("http://bmail.ca/clients/50/contest/contest.htm", "pop", "scrollbars=no,resizable=no,toolbar=no,top=250,left=250,menubar=no,location=no,width=450,height=580");
    pop.focus();
}


function terms() {
    pop = window.open("terms_conditions.html", "terms", "scrollbars=yes,resizable=yes,toolbar=no,top=250,left=250,menubar=no,location=no,width=400,height=420");
    pop.focus();

}

function popUp(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=400,height=400,left = 440,top = 280');");
		}
		
function cityHandler(urlRoot){
    var cityform = document.getElementById("cityform");
    var cityId = cityform.options[cityform.selectedIndex].value;
    var URL = urlRoot + "?c=" + cityId;
    window.location.href = URL;
}

function jobs() {
    pop = window.open("jobs.html", "jobs", "scrollbars=yes,resizable=yes,toolbar=no,top=250,left=250,menubar=no,location=no,width=430,height=460");
    pop.focus();

}
function contest2() {
    pop = window.open("http://www.bettermail.ca/clients/50//contest2/contest.htm", "pop", "scrollbars=no,resizable=no,toolbar=no,top=250,left=250,menubar=no,location=no,width=450,height=580");
    pop.focus();
}
function openComment(id,comment_number) {
if(comment_number!="") {
	cn = '#'+comment_number;
}
else {
	cn = '';
}
    pop = window.open("comments.php?id="+id+cn+"", "pop", "scrollbars=yes,resizable=no,toolbar=no,top=150,left=150,menubar=no,location=no,width=450,height=580");
    pop.focus();	
}
function openReview(id) {
    pop = window.open("comments.php?review=true&id="+id+"", "pop", "scrollbars=yes,resizable=no,toolbar=no,top=150,left=150,menubar=no,location=no,width=450,height=580");
    pop.focus();	
}
function showPic(id) {
	for(i=1;i<5;i++) {
		curSec = "pic_"+i;
		if(i==id) {
			document.getElementById(curSec).style.display="block";
		}
		else {
			document.getElementById(curSec).style.display="none";
		}	
	}	
}
function toggleDiv(sec) {
	if(document.getElementById(sec).style.display=="none") {
		document.getElementById(sec).style.display="block";
	}
	else {
		document.getElementById(sec).style.display="none";
	}
}	
function openWin(winURL,w,h) {
	if(!w) {
		w_f = 450;
	}
	else {
		w_f = w;
	}
	if(!h) {
		h_f = 500;
	}
	else {
		h_f = h;
	}
	window.open(winURL, "popup", "toolbar=no, scrollbars=yes, resizable=no, menubar=no, status=no, width="+w_f+", height="+h_f+"");
}