﻿window.onload=function() {
	autoPOP();
	kitabanyaPOP();
}

/* ------------------------------------
 * popup
------------------------------------ */

function autoPOP()
{
	var x = document.getElementsByTagName('a');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('className') == 'popup' || x[i].getAttribute('class') == 'popup')
		{
			x[i].onclick = function () {
			return winOpen(this.href)
			}
		}
	}
};

function winOpen(url) {
	window.open(
		url,
		'popup',
		'width=560,height=700,scrollbars=1'
	);

	return false;
};

/* ------------------------------------
 * popup02
------------------------------------ */
function autoPOP()
{
	var x = document.getElementsByTagName('a');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('className') == 'popup02' || x[i].getAttribute('class') == 'popup02')
		{
			x[i].onclick = function () {
			return winOpen(this.href)
			}
		}
	}
};

function winOpen(url) {
	window.open(
		url,
		'popup02',
		'width=500,height=700,scrollbars=1'
	);

	return false;
};

/* ------------------------------------
 * popupKitabanya
------------------------------------ */
function kitabanyaPOP()
{
	var x = document.getElementsByTagName('a');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('className') == 'popupKitabanya' || x[i].getAttribute('class') == 'popupKitabanya')
		{
			x[i].onclick = function () {
			return winOpen(this.href)
			}
		}
	}
};

function winOpen(url) {
	window.open(
		url,
		'popupKitabanya',
		'width=620,height=700,scrollbars=1'
	);

	return false;
};