function ValidateSearch() {
    if (document.fmSearch.Keywords.value.length > 2) {
        document.fmSearch.Action.value = "search";
        return(true);
    }
    else {
        return(false);
    }
}

function Search() {
    if (ValidateSearch()) document.fmSearch.submit();
}

function AdvancedSearch() {
    document.fmSearch.Action.value = "";
    document.fmSearch.submit();
}
function AddToCart() {
    document.fmProduct.Action.value = 'add';
    document.fmProduct.submit();
}
function SearchByPrice(min, max) {
	var frm = document.fmSearchByPrice;
	if (frm) {
		frm.MinPriceLevel.value = min;
		frm.MaxPriceLevel.value = max;
		frm.submit()
	}
}
function ChangePage(link) {
	if (link.length > 0) {
		location.href = link;
	}
}

function EmailFriend(sURL) {
	document.open(sURL, "SendToFriend", "directories=no,height=560,width=400,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no");
}
function Telefon(sURL) {
	document.open(sURL, "Telefon", "directories=no,height=460,width=410,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no");
}
function Taksit(sURL) {
	document.open(sURL, "Taksit", "directories=no,height=550,width=630,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no");
}
function certificate(sURL) {
	document.open(sURL, "certificate", "directories=no,height=600,width=1000,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no");
}
function YuzukOlcu(sURL) {
	document.open(sURL, "YuzukOlcu", "directories=no,height=560,width=415,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no");
}
function PlayerWindow(sURL) {
	document.open(sURL, "PlayerWindow", "directories=no,height=320,width=430,location=no,menubar=no,status=no,resizable=no,scrollbars=no,toolbar=no");
}

function tv(sURL) {
	document.open(sURL, "TV", "directories=no,height=380,width=470,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no");
}

function ChooseCurrency() {
	var sURL = 'choosecurrency.asp';
	var oWindow = window.open(sURL, "ChooseCurrency", "directories=no,height=110,width=350,location=no,menubar=no,resizable=no,scrollbars=no,toolbar=no");
	oWindow.opener = window;
}
function ApplyCurrency() {
	document.fmCurrency.currency.value="currency";
	document.fmCurrency.submit();
}
function SwitchLanguage(sLanguage) {
	document.fmLanguage.language.value=sLanguage;
	document.fmLanguage.submit();
}
function chat(bGuest) {
	var sURL = 'chat/chat.asp';
	if (bGuest)
		openWindow(sURL, '', 410, 190, "status=no,toolbar=no,resizable=yes,scrollbars=no,menubar=no");
	else
		openWindow(sURL, '', 500, 400, "status=no,toolbar=no,resizable=yes,scrollbars=no,menubar=no");				
}
