/**
 * 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: 770,
			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, resizable=yes" );
			return;
		};

		this.each(function(){
			var _url = $(this).attr('href');
			$(this).attr('href','javascript:void(0);');
			$(this).attr('target',null);
			$(this).click(function(){
				open_subwin(_url,settings.width,settings.height);
				return false;
			});
		});
		
	};

})(jQuery);

$(function(){
	$('a.subW').subwin();
});


(function($){

	$.fn.subwin2 = function(settings){

		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			default_width: 680,
			default_height: 750
			},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, resizable=yes" );
			return;
		};

		this.each(function(){
			var _url = $(this).attr('href');
			$(this).attr('href','javascript:void(0);');
			$(this).attr('target',null);
			$(this).click(function(){
				open_subwin(_url,settings.width,settings.height);
				return false;
			});
		});
		
	};

})(jQuery);

$(function(){
	$('a.subW2').subwin2();
});


(function($){

	$.fn.subwin3 = function(settings){

		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			default_width: 870,
			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, resizable=yes" );
			return;
		};

		this.each(function(){
			var _url = $(this).attr('href');
			$(this).attr('href','javascript:void(0);');
			$(this).attr('target',null);
			$(this).click(function(){
				open_subwin(_url,settings.width,settings.height);
				return false;
			});
		});
		
	};

})(jQuery);

$(function(){
	$('a.subW3').subwin3();
});


(function($){

	$.fn.subwin4 = function(settings){

		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			default_width: 700,
			default_height: 500
			},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, resizable=yes" );
			return;
		};

		this.each(function(){
			var _url = $(this).attr('href');
			$(this).attr('href','javascript:void(0);');
			$(this).attr('target',null);
			$(this).click(function(){
				open_subwin(_url,settings.width,settings.height);
				return false;
			});
		});
		
	};

})(jQuery);

$(function(){
	$('a.subW4').subwin4();
});


(function($){

	$.fn.subwin5 = function(settings){

		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			default_width: 500,
			default_height: 300
			},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, resizable=yes" );
			return;
		};

		this.each(function(){
			var _url = $(this).attr('href');
			$(this).attr('href','javascript:void(0);');
			$(this).attr('target',null);
			$(this).click(function(){
				open_subwin(_url,settings.width,settings.height);
				return false;
			});
		});
		
	};

})(jQuery);

$(function(){
	$('a.subW5').subwin5();
});



