/* SS head Scripts */

function open_window(link,w,h) //opens new window
{
	var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
	newWin = window.open(link,'newWin',win);
	newWin.focus();
}

function open_printable_version(link) //opens new window
{
	var win = "menubar=no,location=no,resizable=yes,scrollbars=yes";
	newWin = window.open(link,'perintableWin',win);
	newWin.focus();
}

function confirmDelete(id, ask, url) //confirm order delete
{
	temp = window.confirm(ask);
	if (temp) //delete
	{
		window.location=url+id;
	}
}



function confirmUnsubscribe() //unsubscription confirmation
{
	temp = window.confirm('Are you sure you want to terminate your account?');
	if (temp) //delete
	{
		window.location="index.php?killuser=yes";
	}
}

function validate() // newsletter subscription form validation
{
	if (document.subscription_form.email.value.length<1)
	{
		alert("Please enter your email correctly");
		return false;
	}
	if (document.subscription_form.email.value == 'Email')
	{
		alert("Please enter your email correctly");
		return false;
	}
	return true;
}
function validate_disc() // review form verification
{
	if (document.formD.nick.value.length<1)
	{
		alert("Please enter your nickname");
		return false;
	}

	if (document.formD.topic.value.length<1)
	{
		alert("Please enter message subject");
		return false;
	}

	return true;
}
function validate_search()
{

	if (document.Sform.price1.value!="" && ((document.Sform.price1.value < 0) || isNaN(document.Sform.price1.value)))
	{
		alert("Price should be a positive number");
		return false;
	}
	if (document.Sform.price2.value!="" && ((document.Sform.price2.value < 0) || isNaN(document.Sform.price2.value)))
	{
		alert("Price should be a positive number");
		return false;
	}

	return true;
}