function swapImg(inImage, t){
	if (t == 1){
		if (inImage.src.indexOf('_on.gif') == -1) {
			inImage.src = inImage.src.slice(0,inImage.src.length-4) + '_on.gif';
		}
	}
	else {
		inImage.src = inImage.src.slice(0,inImage.src.length-7) + '.gif';
	}
}

function showBar() {
    document.getElementById('stars').style.visibility = 'visible';
}
function hideBar() {
    document.getElementById('stars').style.visibility = 'hidden';
}

function showStars(count) {
    for (i = 1; i <= count; i++) {
        document.getElementById('ctl00_ContentPlaceHolder1_Vote_' + i).src = "../images/stars_on.png"; //eval('star' + i).src.replace('off', 'on');
    }
}
function hideStars() {
    for (i = 1; i <= 10; i++) {
        document.getElementById('ctl00_ContentPlaceHolder1_Vote_' + i).src = "../images/stars_off.png"; //eval('star' + i).src.replace('on', 'off');
    }
}

function castVote(vote) {
    if (vote > 0 && vote <= 10) {
        window.location = "vote.aspx?vote=" + vote;
    } else {
        alert("Invalid Vote");
    }
}

function openWin(url, height, width) {
	var height = height;
	var width = width;
	var scroll = 0;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'holewin','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}
function openWin2(url, height, width) {
	var height = height;
	var width = width;
	var scroll = 1;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'holewin','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}

function expandDiv(inDiv, inHieght) {
	var temp = document.getElementById(inDiv);
	temp.style.height = (temp.style.height == inHieght ? '' : inHieght);
}