photowin = false; 


function nav( strURL){
	// this function will handle all navigation functionality
	// inserting URL params where necessary
	
	location.replace( strURL );
}

function spawnPhoto(pid,pwidth,pheight) {
	winwidth = pwidth;
	winheight = pheight; 
	
	displayHeight=screen.height; displayWidth=screen.width;
	centeredHeight = (displayHeight-winheight) / 2; centeredWidth = (displayWidth-winwidth) / 2;
	
	if( photowin ) { photowin.close(); }
	var str = 'photowerx/photoview.cfm?pid='+pid+'&css=photowerx.css';
	//alert( str );
	photowin = window.open(str,'photowin','width=' + winwidth + ',height=' + winheight + ',toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1');

	//photowin.moveTo(centeredWidth,centeredHeight); 
	//photowin.focus();		
}

function grabText( obj ) {
	document.getElementById('hold').value = obj.href;
	copy = document.getElementById('hold').createTextRange();
	copy.execCommand("Copy");
}

function jumpToTag( strTag ){
	var str = document.location.pathname+'?0=0';
	rgParams = document.location.search.substring( 1 ).split( '&' );	

	// rip out the current SS if it's there
	for( var i = 0; i < rgParams.length; i++ ){
		if( rgParams[i].indexOf( 'ss' ) != 0 ){
			str += '&'+rgParams[i];
		}
	}
	str += '&ss='+strTag;
	document.location = str;
}
