

$(document).ready(function(){
	 $("#oButton").click(function(event){
	
	  		openwin.getWin();

	  		var tmpWindow = $("#newWindow");
				var newLeft=event.pageX - 150;
				var newTop=event.pageY - 400;
				tmpWindow.css({
					left:newLeft+'px',
					top:newTop+'px'
				});

	 });
});
var openwin = {};
openwin.getWin = function(){

		 var obj = $("#open");

		 if(obj.html() != '' ){
				 openWindow = $("#newWindow");
				 openWindow.slideToggle("slow");
		
		 }else{
	
				 var openWindow = $(openwin.getHtml());

				 openWindow.css({
				
						 'font-size':'12px',
						 'position':'absolute',
						 'margin':'20px',
						 'left':'150px',
						 'top':'600px',
						 'width':'600px',
						 'height':'300px',
						
						 'background-color':'#FFFFFF',
						 'border': '1px solid #000',
						 'z-index': '50',
						 'padding':'10px'
				 });
					openWindow.appendTo($("#open"));
				
			}
		 /*

		 openWindow.find("#show").click(function(){
		 	openwin.showWindow();
		 }).end();
		*/
		
		/*

		 openWindow.find("#newWindow").click(function(){
		 	openwin.closeWindow();
		 }).end();
		 */
}


openwin.getHtml = function(){

		 html  = '<div id="newWindow" onclick="openwin.closeWindow()">';
		 html  += '<div style="text-align:right">';
		 html += ('<input type="image" src="' + resourceURL + '/images/icon/close.gif" onclick="openwin.closeWindow()" >');
		 html  += '</div>';
		 
		 html += '<iframe src="' + viewUserContactInformationURL + '" width="600px" height="330px" frameborder="no" border="0" marginwidth="0" marginheight="0"></iframe>';
		 
		 html += '</div>';
		
		 return html;
}

openwin.showWindow = function(){
 		$("#newWindow").hide();

}

openwin.closeWindow = function(){
 		$("#newWindow").hide();
}