pic1 = new Image(); 
pic1.src = "/images/005.gif"; 

var browser_type = 'msie';
var W=navigator.userAgent.toLowerCase();
if(W.indexOf("opera")!=-1){browser_type='opera';}else
if(W.indexOf("msie")!=-1){browser_type='msie';} else
if(W.indexOf("mozilla")!=-1){browser_type='firefox';}


function notice() {
	var width = "320";
	var height = "200";
	var left = (screen.width  - width)  / 2;
	var top = (screen.height - height) / 3 + document.body.scrollTop;
	
	if (browser_type == "msie") {
	
		document.getElementById('body_background').style.display = "block";
		document.getElementById('body_background').style.height = document.body.scrollHeight+"px";
		
		document.getElementById('notice_div').style.top = top;
		document.getElementById('notice_div').style.left = left;
		document.getElementById('notice_div').style.width = width;
		document.getElementById('notice_div').style.height = height;
		document.getElementById('notice_div').style.display = "block";
	}
	else {
		window.open("/notice.html",'mywin','left='+left+',top='+top+',width='+width+',height='+height+',toolbar=0,resizable=0');
	}
	
	return true;
}


function popup(url, width, height) {
	var left = (screen.width  - width)  / 2;
	var top = (screen.height - height) / 3 + document.body.scrollTop;
	
	if (browser_type == "msie") {
		document.getElementById('body_background').style.display = "block";
		document.getElementById('body_background').style.height = document.body.scrollHeight+"px";
		
		document.getElementById('popup_frame').src = url;
		document.getElementById('forgot_div').style.top = top;
		document.getElementById('forgot_div').style.left = left;
		document.getElementById('forgot_div').style.width = width;
		document.getElementById('forgot_div').style.height = height;
		document.getElementById('forgot_div').style.display = "block";
	}
	else {
		window.open(url,'mywin','left='+left+',top='+top+',width='+width+',height='+height+',toolbar=0,resizable=0');
	}
	return true;
}


function deleteConfirm(url) {
	var delete_confirm = '{/literal}{$delete_confirm}{literal}';
	if (delete_confirm != "off") {
		message = 'Are you sure you want to permenantly delete this items?';
		
		if (confirm(message)) {
			if (browser_type == "firefox") {
				self.location.href = url;
			}
			else {
				document.getElementById('link').href = url;
				document.getElementById('link').click();
			}
		}
	}
	else {
		if (browser_type == "firefox") {
			self.location.href = url;
		}
		else {
			document.getElementById('link').href = url;
			document.getElementById('link').click();
		}
	}
}

function button_link(url) {
	if (browser_type == "firefox") {
		self.location.href = url;
	}
	else {
		document.getElementById('link').href = url;
		document.getElementById('link').click();
	}
}


function closeWin() {
	document.getElementById('body_background').style.display = "none";
	document.getElementById('notice_div').style.display = "none";
}


function closeWin2() {
	document.getElementById('body_background').style.display = "none";
	document.getElementById('forgot_div').style.display = 'none';
}
