// Global Variable Declarations
ns4 = (document.layers)? true:false; // netscape 4?
ie4 = (document.all)? true:false; // internet explorer 4/5?
ns6 = (ns4|ie4)? false:true; // (Netscape 6)

var isLoaded=false;

var screen_top=(screen.height/2)-(500/2);
var screen_left=(screen.width/2)-(300/2);

// Image Functions

function image_swap(in_name,in_state) {
	if (!isLoaded) {
		return true;
	}
	document.images[in_name].src = eval(in_name + "_" + in_state + ".src");
}

// Popups

// Specific functions
function setPopupPosition(in_height,in_width) {
	screen_top=(screen.height/2)-(in_height/2);
	screen_left=(screen.width/2)-(in_width/2);
	if (screen_top<0) {
		screen_top=0;
	}
	if (screen_left<0) {
		screen_left=0;
	}
}

// Window openers
function openContact() {
	contact_width=427;
	contact_height=550;
	popupWin = window.open(js_root + 'home/contact.aspx','contact','width=' + contact_width + ',height=' + contact_height + ',scrollbars=yes,resize=no');
}

function openNewsletter() {
	news_width=417;
	news_height=550;
	popupWin = window.open(js_root + 'home/newsletter.aspx','newsletter','width=' + news_width + ',height=' + news_height + ',scrollbars=yes,resize=no');
}

function openResponsibility() {
	resp_width=417;
	resp_height=550;
	popupWin = window.open(js_root + 'home/responsibility.aspx','responsibility','width=' + resp_width + ',height=' + resp_height + ',scrollbars=yes,resize=no');
}

function openSocietyRules() {
	rules_width=417;
	rules_height=550;
	popupWin = window.open(js_root + 'home/society_rules.aspx','societyrules','width=' + rules_width + ',height=' + rules_height + ',scrollbars=yes,resize=no');
}

function openStonesRules() {
	rules_width=417;
	rules_height=550;
	popupWin = window.open(js_root + 'home/stones_rules.aspx','stonesrules','width=' + rules_width + ',height=' + rules_height + ',scrollbars=yes,resize=no');
}

function openResponsiblity() {
    openResponsibility();
}

function openGmap(in_location,in_context) {
	map_width=500;
	map_height=500;
	popupWin = window.open(js_root + 'gmap/default.aspx?location=' + in_location + '&context=' + in_context,'gmap','width=' + map_width + ',height=' + map_height + ',scrollbars=no,resize=no');
	popupWin.focus();
}

// Global Init

function global_init() {
}
