function popwin(url, name, width, height, scroll){
	openWin=window.open(url, name, 'height='+height+',width='+width+',scrollbars='+scroll+',resizable=0');
	openWin.focus();
}
/////

function jumpTo(URL_List)
{
   var URL = URL_List.options[URL_List.selectedIndex].value;
   var urlArray = new Array();
   urlArray = URL.split('/');
   if(URL != 0)
   {
      top.location.href = URL;
   }
}

/* functions and variables for fixing multiple submit issues */
submitInUse = 0;
saInUse = new Image();
saInUse.src =  "/img/buttons/search_on.gif";
postInUse = new Image();
postInUse.src =  "/img/buttons/post_on.gif";
previewInUse = new Image();
previewInUse.src =  "/img/buttons/preview_on.gif";

function submitLock(whichBtn) {
	if (submitInUse == 0) {
		submitInUse = 1;
		
		if (document.images && eval(whichBtn + "InUse.complete")) {
			//alert(eval(whichBtn + "InUse.src"));
			document.getElementById(whichBtn).src = eval(whichBtn + "InUse.src");
			setTimeout('submitInUse=0;', 30000);
		}
		return true;
	}
	else {
		return false;
	}
}

function embedQuickTime(MovieLoc,Width,Height)
{
	document.write('<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" height="' + Height + '" width="' + Width + '">');
	document.write('<param name="src" value="' + MovieLoc+ '">');
	document.write('<param name="AutoPlay" value="true">');
	document.write('<param name="Controller" value="true">');
	document.write('<embed src="' + MovieLoc + '" height="' + Height + '" width="' + Width + '" type="video/quicktime" autoplay="true" controller="true"></embed>');
	document.write('</object>');
}

function valueStrip(regSearch,features)
{
	var results =  features.match(regSearch);
	if (results != null) return results[2];
	else return 0;
}

var original_source=new Array()
function swapyouintheface() {
    for(i = 0; i < document.images.length; i++){
	  original_source[i] = document.images[i].src; 
      document.images[i].src='http://www.stereogum.com/ads/as_rc-470.jpg';
    }
	document.getElementById('lookwhatyoudid').innerHTML = '<b>MAKE IT STOP</b>';
	document.getElementById('lookwhatyoudid').attributes['onclick'].value = 'javascript:makeitstop();return false;';
	return false;
	urchinTracker('/as/athf');
}

function makeitstop() {
		for(i = 0; i < document.images.length; i++){
		document.images[i].src = original_source[i];
	}
	document.getElementById('lookwhatyoudid').innerHTML = 'click here for too much advertisement';
	document.getElementById('lookwhatyoudid').attributes['onclick'].value = 'javascript:swapyouintheface();return false;';
	return false;
}

function popper(theURL,winName,features) {
	var posWin = null;
	var gotIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;	
	var gotNS = (navigator.appName == 'Netscape') ? true : false;
	var gotNN6 = (gotNS && (parseInt(navigator.appVersion) >= 5)) ? true : false;
// REGULAR EXPRESSIONS TO STRIP OUT THE WIDTH AND HEIGHT VARS -----------------
	var widthMatch = /(width=)(\d+)/i;
	var heightMatch = /(height=)(\d+)/i;
	var scrollMatch = /(scrollbars=)([a-zA-Z0-9])/i;
	var numMatch = /\d+/;
	
	var width = valueStrip(widthMatch,features);
	var height = valueStrip(heightMatch,features);
	var scrollbars = valueStrip(scrollMatch,features);
	
	if (posWin!=null && !posWin.closed) posWin.close();
	
	if (gotIE) {
	var left = (screen.Width/2) - width/2;
	var top = (screen.Height/2) - height/2;
	posWin = window.open(theURL,winName,"scrollbars=0,left="+left+",top="+top+",width="+width+",height="+height+",scrollbars="+scrollbars);
	posWin.focus();
	}
	else if (gotNS && !gotNN6) {
	var left = (screen.availWidth/2) - width/2;
	var top = (screen.availHeight/2) - height/2;
	posWin = window.open(theURL,winName,"screenX="+left+",screenY="+top+",innerWidth="+width+",innerHeight="+height+",scrollbars="+scrollbars);
	posWin.focus();
	}
	else if (gotNN6) {
	var left = (screen.availWidth/2) - width/2;
	var top = (screen.availHeight/2) - height/2;
	posWin = window.open(theURL,winName,"screenX="+left+",screenY="+top+",width="+width+"px,height="+height+"px,scrollbars="+scrollbars);
	posWin.focus();
	}
	else {
	posWin = window.open(theURL,winName,"scrollbars=0,width="+width+",height="+height+",scrollbars="+scrollbars);
	posWin.focus();
	}
}
