function aolRedirect(linkString) {
	if (navigator.userAgent.indexOf("AOL") != -1) {
		location.href = linkString;
	} else {
		window.open("http://" + document.domain + "/qc/ssi/redirectPopup.html","","titlebar=no,toolbar=no,width=300,height=250");
	}
}


function browserRedirect(externalLinkStr, internalLinkStr) {
	if (navigator.userAgent.indexOf("AOL") != -1) {
		location.href = internalLinkStr;
	} else {
		location.href = externalLinkStr;
	}
}

function setEnglish() {
	if (getCookie() != "no") {
		putCookie("no");
	}
	location.href="/";
}

function setFrench() {
	if (getCookie() != "yes") {
		putCookie("yes");
	}
}


function redirectFrench() {
	if (getCookie() == "yes") {
		location.href = "/qc/";
	}
}

function putCookie(setStr) {
	var now = new Date();
	now.setTime(now.getTime() + (31536000000));
	exp = "; expires=" + now.toGMTString();
	document.cookie = "french=" + setStr + "; path=/" + exp;
}

function getCookie() {
	var cookiecontent = "no";
	
	if (document.cookie.length > 0) {
		var cookiename = "french=";
		var cookiebegin = document.cookie.indexOf(cookiename);
		var cookieend = 0;
		
		if (cookiebegin > -1) {
			cookiebegin += cookiename.length;
			cookieend = document.cookie.indexOf(";",cookiebegin);
			if (cookieend < cookiebegin) { 
				cookieend = document.cookie.length;
			}
			cookiecontent = document.cookie.substring(cookiebegin,cookieend);
		}
	}
	
	return cookiecontent;
}

function openPoll(pollURL) {
	window.open(pollURL,"","titlebar=no,toolbar=no,width=300,height=250");
}

function openNewWindow(newURL) {
	window.open(newURL,"","");
}

function openNewWindowDims(newURL, width, height) {
	window.open(newURL,"","titlebar=no,toolbar=no,width=" + width + ",height=" + height);
}

function openNewWindowDimsNS(newURL, width, height) {
	window.open(newURL,"","titlebar=no,toolbar=no,scrollbars=yes,width=" + width + ",height=" + height);
}

function retrieveId(ls_id) {
	var selected_array = new Array();
	var tag = new Array('div','span');
	var j = 0;
	for(k=tag.length-1;k>=0;k--) {
		var tag_array=document.getElementsByTagName(tag[k]);
		for(i=tag_array.length-1;i>=0;i--) {
			if(tag_array[i].id==ls_id) {
				selected_array[j]=tag_array[i];j++;
			}
		}
	}
	return selected_array;
}

function setSize(lp_id,num,mini,maxi) {
	var selected_array = retrieveId(lp_id);
	for(i=selected_array.length-1;i>=0;i--) {
		var ls_id = selected_array[i].style;
		if(ls_id.fontSize=="")
			ls_id.fontSize="11px";
	}
	for(i=selected_array.length-1;i>=0;i--) {
		var ls_id = selected_array[i].style;
		var ls_size2 = parseInt(ls_id.fontSize.substr(0, 2),10);
		if (ls_size2+num>=mini && ls_size2+num<=maxi) {
			ls_id.fontSize=ls_size2+num;
		} else {
			if (num<0) {
				ls_id.fontSize=mini;
			} else {
				ls_id.fontSize=maxi;
			}
		}
	}
}