﻿/**
 * sub window plugin
 *
 * Copyright (c) 2009 PRIME-X
 *
 */

(function($){

	$.fn.subwin = function(settings){

		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			default_width: 750,
			default_height: 700
			},settings);
		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
		
		settings.width = settings.width || settings.default_width;
		settings.height = settings.height || settings.default_height;
		
		function open_subwin(url,w,h){
			var sWin = window.open(url, "",  "width=" + w +", height=" + h + ",scrollbars=yes" );
			return;
		};

		this.each(function(){
			var _url = $(this).attr('href');
			$(this).attr('href','javascript:void(0);');
			//$(this).attr('target',null);
			$(this).removeAttr('target');
			$(this).click(function(){
				open_subwin(_url,settings.width,settings.height);
				return false;
			});
		});
		
	};

})(jQuery);

$(function(){
	$('a.subW').subwin();
});

var subopen

function requestOpen(url){

subopen=window.open(url,"","resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,directories=no,status=no,location=yes,width=780");

if (!subopen.opener) subopen.opener=self;

if (window.focus) subopen.focus();

}

function other(url){

subopen=window.open(url,"","resizable=yes,scrollbars=yes,toolbar=no,menubar=yes,directories=no,status=no,location=yes,width=780,height=740");

if (!subopen.opener) subopen.opener=self;

if (window.focus) subopen.focus();

}
