/**
 * Popupwindow - jQuery plugin for new windows
 * @requires jQuery
 *
 * http://rip747.wordpress.com/2007/03/02/the-return-of-popupwindow-jquery-plugin/
 *
 * Copyright (c) 2007 Tony Petruzzi (http://rip747.wordpress.com)
 *
 */
jQuery.fn.popupwindow=function(p){var profiles=p||{};return this.each(function(index){var setting,parameters,mysettings,b,a;mysettings=(jQuery(this).attr("rel")||"").split(",");settings={height:600,width:600,toolbar:0,scrollbars:0,status:0,resizable:1,left:0,top:0,center:0,location:0,directories:0,menubar:0,copyhistory:0};if(mysettings.length==1&&mysettings[0].split(":").length==1){a=mysettings[0];if(typeof profiles[a]!="undefined"){settings=jQuery.extend(settings,profiles[a])}}else{for(var i=0;i<mysettings.length;i++){b=mysettings[i].split(":");if(typeof settings[b[0]]!="undefined"&&b.length==2){settings[b[0]]=b[1]}}}if(settings.center==1){settings.top=(screen.height-(settings.height+110))/2;settings.left=(screen.width-settings.width)/2}parameters="height="+settings.height+",width="+settings.width+",toolbar="+settings.toolbar+",scrollbars="+settings.scrollbars+",status="+settings.status+",resizable="+settings.resizable+",left="+settings.left+",screenX="+settings.left+",top="+settings.top+",screenY="+settings.top+",location="+settings.location+",directories="+settings.directories+",menubar="+settings.menubar+",copyhistory="+settings.copyhistory;jQuery(this).bind("click",function(){var name="PopUpWindow"+index;window.open(this.href,name,parameters).focus();return false})})};