
$(document).ready( function() {

	$('#closeLoginWindow').click( function(e) {
		//$("#loginShowerButton").show();
		winBOXhide('loginBoxWrapper', 330);
		return false;
	});

	$('#openLoginWindow').click( function(e) {
		//$("#loginShowerButton").hide();
		winBOXshow('loginBoxWrapper', 330);
		return false;
	});
	
	setImgSize();

});
function setImgSize() {
	$("img").each(function(i) {
		
		if(this.width>480)
			this.style.width='475px';
	});
}
function isset(v) {
	return ((typeof (v) == 'undefined' || v.length == 0) ? false : true);
}
function XYwin(v) {
	var z = $.browser.msie ? Array(document.body.clientHeight,
			document.body.clientWidth) : Array(window.innerHeight,
			window.innerWidth);
	return (isset(v) ? z[v] : z);
}

function winBOXshow(winId, w) {
	// alert($("#" + winId).css('width'));
	width = w;
	$("#sm_olay").css( {
		height :'100%',
		width :'100%',
		position :'fixed',
		left :0,
		top :0,
		'z-index' :1000,
		opacity :50 / 100
	});
	$("#sm_olay").show();
	
	h=Math.round(document.body.scrollHeight-window.screen.height/2);
	
	$("#" + winId).css( {
		'left' :Math.round((XYwin(1) - width) / 2) + 'px',
		'width' :width + 'px',
		'top' :h + 'px'
	});
	
	$("#" + winId).show();
}

function winBOXhide(winId, w) {
	width = w;
	$("#sm_olay").hide();

	$("#loginBoxWrapper").hide();
}