// border color for empty fields
EmptyFieldColor = '#ff0000';

// border style for empty fields
EmptyFieldStyle = 'solid';

// border color for filled fields
FillFieldColor = '#000000';

function Submit() {
	document.Search.submit();
}

function OpenWin(ProductID, ImageWidth, ImageHeight, Lang) {
	ImageWidth = eval(ImageWidth) + 44;
	ImageHeight = eval(ImageHeight) + 76;
	ProductWin = window.open('/popup/ViewBigPicture.php?WorkNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=' + ImageWidth + ',height=' + ImageHeight + ' resizable=no,scrollbars=no');
}

function OpenWin2(ProductID, ImageWidth, ImageHeight, Lang) {
	ImageWidth = eval(ImageWidth) + 66;
	ImageHeight = eval(ImageHeight) + 71;
	ProductWin = window.open('/popup/ViewBigPicture.php?WorkNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=' + ImageWidth + ',height=' + ImageHeight + ' resizable=no,scrollbars=no');
}

function ViewPoster(Image, ImageWidth, ImageHeight, Lang) {
	ImageWidth = eval(ImageWidth) + 10;
	ImageHeight = eval(ImageHeight) + 8;
	ImageWin = window.open('/popup/ViewPoster.php?image=' + Image + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=' + ImageWidth + ',height=' + ImageHeight + ',resizable=yes,scrollbars=yes');
}

function ViewExhibition(Image, ImageWidth, ImageHeight, Lang) {
	ImageWidth = eval(ImageWidth) + 10;
	ImageHeight = eval(ImageHeight) + 8;
	ImageWin = window.open('/popup/ViewExhibition.php?image=' + Image + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=' + ImageWidth + ',height=' + ImageHeight + ',resizable=yes,scrollbars=yes');
}

function RecommendWork(ProductID, Lang) {
	RecommendWorkWin = window.open('/popup/Recommend.php?WorkNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=315,height=220 resizable=no,scrollbars=no');
}

function CommentWork(ProductID, Lang) {
	RecommendWorkWin = window.open('/popup/Comment.php?WorkNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=315,height=220 resizable=no,scrollbars=no');
}

function Comment(ProductID, Lang) {
	RecommendWorkWin = window.open('/popup/CommentDetail.php?CommentNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=484,height=387 resizable=no,scrollbars=yes');
}

function PrintWork(ProductID, Lang) {
	PrintWorkWin = window.open('/popup/Print.php?WorkNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=1,width=770,height=400,resizable=yes,scrollbars=yes');
}

function LectureInfo(ID, Lang) {
	LectureInfoWin = window.open('/popup/LectureInfo.php?ID=' + ID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=330,height=220,resizable=yes,scrollbars=no');
}

function FormControl(FormName, FieldNames) {
	var WarnStr = 0;

	EmptyFieldColor = '#ff0000';
	FillFieldColor = '#000000';

	FieldLength = FieldNames.length;
	for (i = 0; i < FieldLength; i++) {
		if (document.forms[FormName].elements[FieldNames[i]].value == '') {
//			WarnStr += WarnMsgs[FieldNames[i]] + ', ';
			WarnStr++;
			document.forms[FormName].elements[FieldNames[i]].style.borderColor = EmptyFieldColor;
			document.forms[FormName].elements[FieldNames[i]].style.borderStyle = 'solid';
		} else {
			document.forms[FormName].elements[FieldNames[i]].style.borderColor = FillFieldColor;
		}
	}

	if (WarnStr != 0) {
//		WarnStr = 'Lütfen '  + WarnStr.substring(0, WarnStr.length - 2) + ' yazınız.';
//		alert(WarnStr);
		return false;
	} else {
		return true;
	}

}


function BizeUlasin(LANG) {
	LectureInfoWin = window.open('/popup/BizeUlasin.php?Lang=' + LANG,'','status=0,toolbar=0,menubar=0,width=505,height=455,resizable=yes,scrollbars=no');
}

function HELP(LANG, REFERER, NUMBER) {
	LectureInfoWin = window.open('/popup/BizeUlasin.php?Lang=' + LANG + '&Topic=' + NUMBER + '&REFERER=' + REFERER,'','status=0,toolbar=0,menubar=0,width=505,height=405,resizable=yes,scrollbars=no');
}
