function popupWindow(url) {
	
	var width = 290;
	//var height = screen.height - 150;
	var height = 80;
	
	if(window.innerWidth){
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/4)-50;
	}else{
		LeftPosition =(parseInt(window.screen.width)- width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;	
	}
		
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height + ',screenX=150,screenY=150,top= ' + TopPosition + ',left=' + LeftPosition + '')
  return false;
}



function centerPopup(obj, width, height, resize){
	if (resize){
		window.resizeTo(width, height);
	}
	
	/*if(window.innerWidth){
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/2)-50;
		alert('here'+LeftPosition);
	}else{
	*/
		LeftPosition =(parseInt(window.screen.width)- width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;					
//	}
	
	window.moveTo( LeftPosition , TopPosition );
	
	return false;
}


function popupPost(param){

	var width = 750;
	var height = screen.height - 150;
	
	if(window.innerWidth){
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/4)-50;
	}else{
		LeftPosition =(parseInt(window.screen.width)- width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;	
	}
		
  window.open('post_window.php?post_id=' + param,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height + ',screenX=150,screenY=150,top= ' + TopPosition + ',left=' + LeftPosition + '')
  return false;  
}

function popupWindow2(url){

	var width = 750;
	var height = screen.height - 150;
	
	if(window.innerWidth){
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/4)-50;
	}else{
		LeftPosition =(parseInt(window.screen.width)- width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;	
	}
		
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height + ',screenX=150,screenY=150,top= ' + TopPosition + ',left=' + LeftPosition + '')
  return false;  
}

function popupWindowCust(url, _width, _height){

	var width = _width;
	var height = _height;
	
	if(window.innerWidth){
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/4)-50;
	}else{
		LeftPosition =(parseInt(window.screen.width)- width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;	
	}
		
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height + ',screenX=150,screenY=150,top= ' + TopPosition + ',left=' + LeftPosition + '')
  return false;  
}