/* -----------------------------------------------

NIKE - FIND THE RIGHT SHOE FOR YOU

nike_rx4u.js
- this is included into the html page with a button to open RX4U tool

opens tool in new window and sends any relevant info to new window

usage:

to open tool in new window from this page
javascript:rx4u.openRX4U('niketown','R','M');

activity codes
"R" - running
"W" - walking
"T" - training

gender codes
"M" - mens
"W" - womens

NOTE:
activity and gender parameters are optional and will default
to tool presets if not specified

to close tool from button on this page
javascript:closeRX4U();

----------------------------------------------- */


/* -----------------------------------------------
	create namespace
------------------------------------------------*/

var rx4u = new Object();

// set site name (eg. niketown, nikerunning)
// used for site specific tool configurations
rx4u.site_name = "niketown";

// show unavailable products? yes/no
rx4u.show_unavailable = "no"


/* -----------------------------------------------
	functions - public
------------------------------------------------*/

rx4u.openRX4U = function(sitename,activity,gender) {

	var url = "http://www.nike.com/prescribe/index.jhtml?site=" + sitename + "&activity=" + activity + "&gender=" + gender + "&show_unavailable=" + rx4u.show_unavailable;
	var win = "winRX4U";
	var w = 667;
	var h = 376;
	var win_x = (screen.availWidth - w)/2;
	var win_y = (screen.availHeight - h)/2;
	var features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",screenX="+win_x+",screenY="+win_y+",top="+win_y+",left="+win_x;
	
	window.open(url,win,features);

}

rx4u.closeRX4U = function() {

	winRX4U.close();

}


