//refere to func like this, order of paramneters does not matter:
//<a href="javascript:OpenWin({'url':'url', 'name':'window name', 'w':num, 'h':num AND SO ON })">popup link</a>



function OpenWin(popSetts) {


//-- Check function calls ----------------------------
  if (!popSetts['name']) {    popSetts['name']    = 'Popup';}
  if (!popSetts['w']) {       popSetts['w']       = 600;}
  if (!popSetts['h']) {       popSetts['h']       = 700;}
  if (!popSetts['scroll']) {  popSetts['scroll']  = 'Yes';}
  if (!popSetts['loc']) {     popSetts['loc']     = 'No';}
  if (!popSetts['l']) {       popSetts['l']       = 0;}
  if (!popSetts['t']) {       popSetts['t']       = 0;}
  if (!popSetts['menu']) {    popSetts['menu']    = 'No';}
  if (!popSetts['resiz']) {   popSetts['resiz']   = 'No';}
  if (!popSetts['tools']) {   popSetts['tools']   = 'No';}

  /*  
  status = popSetts['name']+' '+
           popSetts['w']+' '+
           popSetts['h']+' '+
           popSetts['scroll']+' '+
           popSetts['loc']+' '+
           popSetts['l']+' '+
           popSetts['t']+' '+
           popSetts['menu']+' '+
           popSetts['resiz']+' '+
           popSetts['tools'];
  */
  
  //---if i and t = 0 calculate center of screen for popup
	if(popSetts['l'] == 0 && popSetts['t'] == 0){
				var swh = screen.height;
				var sww = screen.width;
				sww = (sww/2)-(popSetts['w']/2);
				swh = (swh/2)-(popSetts['h']/2);
				popSetts['l'] = sww;
				popSetts['t'] = swh;
	}
  //-----------------------------------------------------
	

  
  //-- Popps the new window if url is set----------------
  if (popSetts['url']){
  	oWin = window.open(popSetts['url'], popSetts['name'],
                      'width='        + popSetts['w'] +
                      ',height='      + popSetts['h'] +
                      ',scrollbars='  + popSetts['scroll'] +
                      ',location='    + popSetts['loc'] +
                      ',left='        + popSetts['l'] +
                      ',top='         + popSetts['t'] +
                      ',menubar='     + popSetts['menu'] +
                      ',alwaysRaised=Yes'+
                      ',resizable='   + popSetts['resiz'] +
                      ',toolbar='     + popSetts['tools']);
                    


  	agent = navigator.userAgent;
  
    if ((agent.indexOf('Mozilla') != -1) && ((agent.indexOf('Spoofer') == -1) && (agent.indexOf('compatible') == -1))) {
  	  oWin.focus();
  	}
  }
  //-----------------------------------------------------  



}