var $j = jQuery.noConflict();


function showPopup(width, height, name){
	setPosition(width, height, name);
	$j("#"+name).slideDown("slow");
}

function showPopupNoWidth(id){
	setPosition($j("#"+id).width(), $j("#"+id).height(), id);
	$j("#"+id).slideDown("slow");
}

function hidePopup(id){
	$j("#"+id).slideUp("slow");
}

function setPosition(width, height, name) {
	//get window width and height!
    var winWidth = 0, winHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) { //non-ie
        winWidth = window.innerWidth;
        winHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //ie 6+
        winWidth = document.documentElement.clientWidth;
        winHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //ie 4
        winWidth = document.body.clientWidth;
        winHeight = document.body.clientHeight;
    }
    //get scroll left and right!
    var sX = (document.all)?document.documentElement.scrollLeft:window.pageXOffset;
    var sY = 0;//(document.all)?document.documentElement.scrollTop:window.pageYOffset;
    //calculate where the err should go!
    var leftPos = sX+winWidth/2 - width/2;
    var topPos = sY+winHeight/2 - height/2;
    
    //placement!
    var el = document.getElementById(name);
    if (el) {
    	el.style.left = leftPos+"px";
    	el.style.top = topPos+"px";
    	}
}

function resetPopup(){
	$j('#proflink').slideDown('slow');
	$j('#newprof').hide('slow');
	document.getElementById('newprofText').value='';
}