
function resizeIfOdd(){
if(navigator.userAgent.indexOf('Firefox/3') != -1 ||
navigator.userAgent.indexOf('WebKit') != -1)
if(document.documentElement.clientWidth % 2 == 1)
window.resizeBy(-1,0);
};

function forceBrowserEven(){
window.setTimeout('resizeIfOdd()',5);
};

var dyk = new Array()
dyk[0] = "According to figures released by the Annenberg Center for the Digital Future at the University of Southern California, 60.3% of men said they feel as <i>strongly</i> about their online communities as about off-line ones. Only 47.4% of women felt this way.";
dyk[1] = "Did you know that <i>BtoB</i> magazine named Doremus as the top mid-sized b-to-b agency for 2008 & 2010?";


 var DidYouKnow = function() {
	var rnd = Math.round(Math.random() * (dyk.length-1));
	var out = '<div><img src="/i/hdr/hdr_dyk.gif" alt="did you know" /></div>\n' +dyk[rnd];
	return out;
}


var release = new Array();
release[7] = "Doremus San Fran Has Hired Director of Analytics";
release[6] = "Doremus San Fran Launches “Print Forward” Campaign for HP";
release[5] = "New Doremus/CNBC Study Takes a Look At: “The New World of Financial Advisors”";
release[4] = "Doremus San Francisco Wins Social Media Marketing Award";
release[3] = "Doremus Named “Top Agency” by BtoB Magazine";
release[2] = "Doremus Promotes Kate Fullhart to Account Supervisor";
release[1] = "Doremus Promotes Matt Broom to Global Director for Strategic Partnerships";
release[0] = "Doremus Names Matthew Don Director of Digital Strategy and Innovation";


var pdf = new Array();
pdf[7] = '/pr/JasonRelease.pdf';
pdf[6] = '/pr/HPMES.pdf';
pdf[5] = '/pr/CNBCPR.pdf';
pdf[4] = '/pr/DoremusSFwins.pdf';
pdf[3] = '/pr/TopAgency2010.pdf';
pdf[2] = '/pr/KateFullhartPR.pdf';
pdf[1] = '/pr/MattBroom.pdf';
pdf[0] = '/pr/MatthewDonPR.pdf';


var pdfdate = new Array();
pdfdate[7] = 'August 10, 2010';
pdfdate[6] = 'July 29, 2010';
pdfdate[5] = 'July 6, 2010';
pdfdate[4] = 'April 20, 2010';
pdfdate[3] = 'March 8, 2010';
pdfdate[2] = 'March 2, 2010';
pdfdate[1] = 'February 18, 2010';
pdfdate[0] = 'February 4, 2010';



















var PRList= function(type) {
	var r = '';
	var ct = (type == "full") ? 0 : release.length-3;
	for (i = release.length-1; i >= ct; i--) {
		r += '<div class="PressText" onclick="window.open(\''+pdf[i]+'\')" onmouseover="Rollover(this)" onmouseout="Rollout(this)"><p>'+pdfdate[i]+'<br />'+release[i]+' <img src="/i/icon/question_arrow.gif" width="10" height="6" border="0" /></p></div>\n';

	}
	if (type != "full") {
		return r += '<div class="fright PressText" onclick="Nav(\'/about_us/press_releases.html\')" onmouseover="Rollover(this)" onmouseout="Rollout(this)">more </div>\n'	
	} else {
		return r;
	}
}

var PollQuestion = function() {
	return "What will an Obama health care plan cost the public?";
}

var PollAnswers = function() {
	return '<form method="post" action="" name="poll">\n' +
	'<input type="hidden" name="poll_id" value="389">\n' +
	'<select name="poll_answer" class="poll_select">\n' +
	'<option value="">Select one</option>\n' +
	'<option value="a1">Yes</option>\n' +
	'<option value="a2">No</option>\n' +
	'<option value="a3"> <textarea name="poll" cols="" rows="2">Maybe</textarea></option>\n' +
	'</select>\n' +
	'<span class="org_normal" onclick="popup(\'http://interactives.hostway.com/cgi-bin/slither/Driver.py/InterActives/Poll/Poll.process\',389,700,300)" onmouseover="Rollover(this)" onmouseout="Rollout(this)">Submit</span>\n' +
	'</form>\n';
}
/*
	desc: 
		searches src string for "2." which is contained in the "over" or "on" 
		images. if found removes the 2. otherwise, it adds it back in.
	
	params: 
		n - reference to the embedded image
	
	ex use: 
		onMouseOut="ImgSwap('Image2')"
*/
var ImgSwap = function(n) {
	var isrc = document.images[n].src;
	var newsrc = ((isrc.indexOf("2.") > -1)) ? isrc.replace(/2\./,".") : isrc.replace(/1\./,"12.");
	document.images[n].src = newsrc;
}
/*
	desc:
		loops thru all the images on the page
		looking for the prefix of embedded logos
		with that is preloads the rollovers
		'Preloader' is in the top nav of every page
	
	params:
		pre - prefix to embedded logos
	
	ex use:
		window.onload = function() { Preloader('Image',/2./,"."); }
*/
var Preloader = function(pattern,replacement) {
	for (var each in document.images) {
		var iRef, isrc;
		if (iRef = document.images[each].name) {
			if (isrc = document.images[each].src) {
				var newsrc = isrc.replace(pattern,replacement);
				document.images[each].src = newsrc;
				document.images[each].src = isrc;
			}
		}
	}
}

var Nav = function(page,newwin) {
	if (newwin) { window.open(page); return; }
document.location = page;
}


var Rollover = function(_t) {
 	var cName = _t.className;
 	if (cName.indexOf('On') > -1) { return; }
 	if (cName.indexOf('Over') == -1) {
 		_t.className = cName + 'Over';
	}
}
	
var Rollout = function(_t) {
var cName = _t.className;
if (cName.indexOf('On') > -1) { return; }
if (cName.indexOf('Over') != -1) {
	_t.className = cName.substr(0,cName.length-4);
}
}

var lastDiv;
var hideandseek = function(sMenuId) {
	var cName = sMenuId.className;
	
	if (lastDiv == undefined) { lastDiv = document.getElementById('case1'); }
	if (lastDiv) {
		lastDiv.className = 'case_topic';
		lastTopic = lastDiv.id + 'On';
		document.getElementById(lastTopic).className = 'case_topic_body';
	}
	cName = 'case_topicOn';
	sMenuId.className = cName;
	var sMenuId2 = sMenuId.id + 'On';
	document.getElementById(sMenuId2).className = 'case_topic_bodyOn';
	lastDiv = sMenuId;	
}

var Highlite = function(n) {
	if (n.id == cid) { return; }	
	var cName = n.className;
 	if (cName.indexOf('Over') == -1) {
 		n.className = cName + 'Over';
	} else {
		n.className = cName.substr(0,cName.length-4);
	}
}

var TurnOn = function(n) {
	var ccn = document.getElementById(n).className;
	document.getElementById(n).className = ccn;
}

var TurnOff = function(n) {
	var ccn = document.getElementById(n).className;
	document.getElementById(n).className = ccn.substr(0,(ccn.length-4));
}
/* 	var cid:
	the first id of a given set. 
	should be highlited to begin 
*/
var cid = 'ida';
var i = new Image();
var Enlarge = function(n,_t) {
	if (_t.id == cid) { return; }
	var t_src = document.images[n].src;
	var n_src = t_src.replace(/thumbs\/t_/,"stage\/");
	document.images['stage'].src = n_src;
	TurnOn(_t.id);
	TurnOff(cid);
	cid = _t.id;
	
	var s_src = document.images['stage'].src;
	var p_src = s_src.replace(/stage\//,"popups\/pop_");
	i.src = p_src;
}

var findI = function() {
	var s_src = document.images['stage'].src;
	var p_src = s_src.replace(/stage\//,"popups\/pop_");
	return p_src;
}

var ClientPopup = function() {
if (i.width <= 0){ return; }
var temp = i.src.split("/");
var client = temp[5];
var _w = i.width;
var _h = i.height + 67;

var pars = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+_w+',height='+_h;

var newWin = window.open('','ClientWin',pars)

newWin.document.write('<html>');
	newWin.document.write('<head>');
	newWin.document.write('<title>client work</title>');
	newWin.document.write('<script type="text/JavaScript" src="/scripts/utils.js"></script>');
	newWin.document.write('<!--Start VisitorTrack Code 4.0--><script type="text/javascript">imgsrc = location.protocol + "//www.visitortracklog.com/loghit.asp?id=105763&vr=4.0&rp=" + escape(document.referrer) + "&pa=" + escape(document.URL);document.write("<img border="0" alt="" src="" + imgsrc + "">");</script><!--End VisitorTrack Code--><link rel="stylesheet" type="text/css" href="/css/global.css">');
	newWin.document.write('</head>');
	newWin.document.write('<body onblur="self.close()">');
	newWin.document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">');
	newWin.document.write('<tr>');
	newWin.document.write('<td><img src="/i/s.gif" width="13" height="39" alt="" /></td>');
	newWin.document.write('<td><img src="/i/pop/doremus.gif" width="144" height="27" alt="" /></td>');
	newWin.document.write('<td align="right" valign="middle"><div class="CloseLink" onclick="self.close()" onmouseover="Rollover(this)" onmouseout="Rollout(this)">close</div></td>');
	newWin.document.write('</tr><tr>');
	newWin.document.write('<td><img src="/i/s.gif" width="13" height="28" alt="" /></td>');
	newWin.document.write('<td colspan="2" width="100%" align="left"><img src="/i/pop/cl_'+client+'.gif" alt="" /></td>');
	newWin.document.write('</tr><tr>');
	newWin.document.write('<td colspan="3"><img src="'+i.src+'" /></td>');
	newWin.document.write('</tr></table></body></html>');
newWin.document.close();
}

var popup = function(url,poll_id,width,height) {
	if (document.forms['poll'].poll_answer.selectedIndex == 0) { return; }
	var answer = document.forms['poll'].poll_answer.options[document.forms['poll'].poll_answer.selectedIndex].value;
	window.open(url+"?poll_id="+poll_id+"&poll_answer="+answer,"popup","toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=yes,width="+width+",height="+height)
}

var UtilPopup = function(url,width,height) {
	window.open(url,"util","toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,width="+width+",height="+height)
}


var imagesforList = new Array();
imagesforList[0] = "/i/gb/reskinart.jpg";
imagesforList[1] = "/i/gb/reskinart1.jpg";
imagesforList[2] = "/i/gb/reskinart2.jpg";
imagesforList[3] = "/i/gb/reskinart3.jpg";
imagesforList[4] = "/i/gb/reskinart4.jpg";
imagesforList[5] = "/i/gb/reskinart5.jpg";
imagesforList[6] = "/i/gb/reskinart28.jpg";
imagesforList[7] = "/i/gb/reskinart27.jpg";
imagesforList[8] = "/i/gb/reskinart8.jpg";
imagesforList[9] = "/i/gb/reskinart9.jpg";
imagesforList[10] = "/i/gb/reskinart10.jpg";
imagesforList[11] = "/i/gb/reskinart11.jpg";
imagesforList[12] = "/i/gb/reskinart12.jpg";
imagesforList[13] = "/i/gb/reskinart26.jpg";
imagesforList[14] = "/i/gb/reskinart25.jpg";
imagesforList[16] = "/i/gb/reskinart16.jpg";
imagesforList[17] = "/i/gb/reskinart17.jpg";
imagesforList[18] = "/i/gb/reskinart18.jpg";
imagesforList[19] = "/i/gb/reskinart19.jpg";
imagesforList[20] = "/i/gb/reskinart23.jpg";
imagesforList[21] = "/i/gb/reskinart21.jpg";
imagesforList[15] = "/i/gb/reskinart22.jpg";


 


var imageList = function(type) {
	var imgL = '';
	var x = (Math.floor(Math.random() * imagesforList.length)) ;
	return imgL = '<img src="'+imagesforList[x]+'" border=0>'
	
	}