function $(obj) { return document.getElementById(obj);}
function showHideList(id){if (document.getElementById){if ($(id).style.display == 'none'){$(id).style.display = 'block';}else{$(id).style.display = 'none';}}}
function highlight(id){if ($){$(id).style.borderColor='#CC0000';$(id).style.backgroundColor='#FFFFCC';}}
function winOpen(url){myWin=open('','winName','width=350,height=525,status=no,toolbar=no,menubar=no,scrollbars=yes'); return true; }
function GP_popupConfirmMsg(msg) {document.MM_returnValue = confirm(msg);}
// Load data
var xmlHttp
function loadData(page, query, ele){$(ele).innerHTML = '<br /><br /><div align=\'center\' style=\'color:#999999\'><img src=\'http://www.realwire.com/images/loading.gif\' /><div id=\'loadTxt\'>one moment</div></div><br /><br />';setTimeout('loadAJAXRequest(\''+page+'\', \''+query+'\', \''+ele+'\')',250);}
function loadAJAXRequest(page, query, ele) {var element = $(ele);if (page.length==0){element.innerHTML="";return}xmlHttp=GetXmlHttpObject();if (xmlHttp==null){element.innerHTML="Browser does not support HTTP Request";return}$('loadTxt').innerHTML = 'loading...';var url=page+'?'+query+"&uniqid="+Math.random();xmlHttp.open("GET", url);xmlHttp.onreadystatechange = function() {if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {element.innerHTML = xmlHttp.responseText;if ( window.contentSize ){contentSize();}if ( window.checkExclusions ){checkExclusions();}} else {if (xmlHttp.readyState == 4 && xmlHttp.status >= 400){element.innerHTML = "There was a problem loading the content...<br />Error mesage: " + xmlHttp.statusText}}};xmlHttp.send(null);}
function loadInfo(page, query, ele){if ($('blockLoad').value == 'true'){$(ele).innerHTML = '<br /><br /><div align="center" id="loadTxt"><font color="red">Please wait until your previous information request has finished loading</font><br /><a href="javascript:;" onclick="loadInfo(\''+page+'\', \''+query+'\', \''+ele+'\')">Then try again</a>.</div><br /><br />'}else{$(ele).innerHTML = '<div align="center" style="color:#999999"><img src="http://www.realwire.com/images/loading.gif" /><div id="loadTxt">one moment...<br />Please wait until your results have been found <br />before making another selection.</div></div><br /><br />';$('blockLoad').value = 'true';setTimeout('loadAJAXInfoRequest(\''+page+'\', \''+query+'\', \''+ele+'\')',250);}}
function GetXmlHttpObject(){ var objXMLHttp=null;if (window.XMLHttpRequest){objXMLHttp=new XMLHttpRequest()}else if (window.ActiveXObject){objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")}return objXMLHttp} 
// social tools
function rwTweet(id,pre){
	var str = '<div style="border:2px solid #78858D;padding:5px 5px 15px 5px;max-height:300px;overflow:auto;">'
	str = str + '<div align="center" style="font-size:16px;padding:5px;"><strong><font color="#647983">Post to Twitter</font></strong></div>'
	str = str + '<div id="popContent"></div>'
	str = str + '<div align="center"><input name="Button" id="SubmitNo" type="button" class="formbtn" value="close window" style="width:275px; font-family:Verdana, Arial, Helvetica, sans-serif;" onClick="document.body.removeChild($(\'BulletinDiv\'));" /></div>'
	str = str + '</div>';
	divAlert(str);
	if($('tu')){$('tu').focus();}
	loadData('socialTools/twitter/post.asp', 'ReleaseID='+id+'&pre='+pre, 'popContent');
	setTimeout('toCount(\'eBann\',\'sBann\',\'{CHAR} characters left\',140)',1500);
	setTimeout('qChar(\'eBann\')',1750)
}
function divAlert(str){
	var ScrollTop = document.body.scrollTop; if (ScrollTop == 0){if (window.pageYOffset)ScrollTop = window.pageYOffset; else ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;}
	var w = 0;var posLeft = 0; posRight = 0; if (self.innerWidth){w=self.innerWidth;}else if (document.documentElement && document.documentElement.clientWidth){w=document.documentElement.clientWidth;}else if (document.body){w=document.body.clientWidth;} posLeft = w/2-300; posRight = w/2+300;
	str = '<img src="http://www.realwire.com/images/close.png" width="24" height="24" style="position:absolute;top:-10px;left:589px;z-index:100002;cursor:pointer;" title="close" onclick="document.body.removeChild($(\'BulletinDiv\'))" />' + str;
	var newdiv = document.createElement('div');newdiv.setAttribute('id','BulletinDiv');newdiv.style.position='fixed';newdiv.style.left=posLeft+'px';newdiv.style.top=ScrollTop+170+'px';newdiv.style.width='602px';newdiv.style.zIndex='100001';newdiv.style.backgroundColor='#FFFFFF';newdiv.style.borderColor='#FFFFFF';newdiv.style.borderWidth='2px';newdiv.style.borderStyle='solid';newdiv.style.padding='0px';newdiv.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';newdiv.style.fontSize='0.8em';newdiv.innerHTML = str;document.body.appendChild(newdiv);
}
function prePop(str){$('eBann').value = str}
/* The following character count script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Steve | http://jsmadeeasy.com/ 
slightly modified by RealWire*/
function getObject(obj) {var theObj;if(document.all) {if(typeof obj=="string") {return document.all(obj);} else {return obj.style;}}if(document.getElementById) {if(typeof obj=="string") {return document.getElementById(obj);} else {return obj.style;}}return null;}
function toCount(entrance,exit,text,characters) {var entranceObj=getObject(entrance);var exitObj=getObject(exit);var length=characters - entranceObj.value.length;if(length <= 20) {$(exit).style.color='#990000';}else{$(exit).style.color='';}if(length <= 10) {$(exit).style.fontWeight='bold';}else{$(exit).style.fontWeight='normal';}if(length <= 0) {length=0;$(exit).style.color='red';entranceObj.value=entranceObj.value.substr(0,characters);}exitObj.innerHTML = text.replace("{CHAR}",length);}
//why leave 20 characters?
function qChar(el){if($(el).value.length == 120){$('sBann').innerHTML = $('sBann').innerHTML + ' <a href="javascript:;" onclick="rtInfo();" style="font-weight:bold">?</a>';}}
function rtInfo(){$('sBann').innerHTML = $('sBann').innerHTML + '<br /><em>we have left 20 characters to allow for re-tweeting, <br />feel free edit this tweet however you like up to the 140 characters allowed by twitter.'}
//check and send tweet
function checkTweet(){
	var err = '';
	if($('eBann').value == ''){err = '<br />Please enter a tweet...'}
	if($('tu').value == ''){err = err + '<br />Please enter your username...'}
	if($('tp').value == ''){err = err + '<br />Please enter your password...'}
	if(err != ''){$('sBann').innerHTML = err}else{loadData('socialTools/twitter/post.asp', 'tu='+Base64.encode($('tu').value)+'&tp='+Base64.encode($('tp').value)+'&t='+escape($('eBann').value), 'popContent');}
}