

function jvDelTrans(tmp,param) {
	if (confirm('Are you sure you want to delete this transaction?')) {
		location.href='administration.asp?' + param + '&del=' + tmp;
	}
}

function jvCancelTrans(tmp) {
	if (confirm('Are you sure you want to delete this order?')) {
		location.href = 'administration.asp?action15=true&id=' + tmp;
	}
}

function jvCancelRating(tmp,tmp2,tmp3) {
	if (confirm('Are you sure you want to delete this rating?')) {
		location.href = 'administration.asp?action=rating&id=' + tmp2 +'&from=' + tmp3 +'&del=' + tmp;
	}
}

function jvDeleteUser(tmp) {
	if (confirm('Are you sure you want to delete this user?')) {
		location.href='administration.asp?action7=true&id='+ tmp;
	}
}

function jvDeleteGroup(tmp) {
	if (confirm('Are you sure you want to delete this group?')) {
		location.href='administration.asp?action18=true&id='+ tmp;
	}
}

function jvSendMail(tmp,tmp2) {
	if (tmp==1){
		if (confirm('Are you sure you want to send this e-mail message to all users?')) {
			location.href='administration.asp?action=sendmail&id='+ tmp2;
		}
	}
	else {
		if (confirm('Are you sure you want to send this e-mail to your address?')) {
			location.href='administration.asp?action=sendmail&error=test&id='+ tmp2;
		}
	}
}

function jvDeleteAdmin(tmp) {
	if (tmp!=1) {
		if (confirm('Are you sure you want to delete this administrator?'))
		{
		location.href='administration.asp?action13=true&id='+ tmp;
		}
	}
	else {
		alert('Delete Main Administrator is not possible.');
	}
}

function mysubmit(type)	{
	if(document.getElementById("uploadscript").value=='') {
		window.alert('Enter upload processing script file name!');
		return false;
	}
	if(type=='flash') {
		var Flash;
		if(document.embeds && document.embeds.length>=1 && navigator.userAgent.indexOf("Safari") == -1)
			Flash = document.getElementById("EmbedFlashFilesUpload");
		else
			Flash = document.getElementById("FlashFilesUpload");		
		Flash.SetVariable("uploadUrl", document.getElementById("uploadscript").value); 
		Flash.SetVariable("SubmitFlash", ""); 
	}
	else {
		var FormObj = document.getElementById("myform");
		FormObj.action = document.getElementById("uploadscript").value;
		return true;
	}
}

function jvRecount(exchange,type) {
	if (type=="1") {
		theForm.usd.value=(theForm.points.value/exchange);
	}
	else {
		theForm.points.value=(theForm.usd.value*exchange);
	}
}


var popupStatus = 0;

function createPopUp(popUpCode,AcceptButton) {
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;

	if (AcceptButton=="1") {
	document.getElementById("ce").innerHTML = '<div id="ce2"><iframe src="popup.asp?action=accept&id=' + popUpCode + '" frameborder="0" scrolling="no"></iframe><br /><input type="button" onclick="acceptPopUp('+ popUpCode +');" value="Accept order" class="sub" /> <input type="button" onclick="PrintPopUp('+  popUpCode +')" value="Print" class="sub" /> <input type="button" onclick="closePopUp();" value="Close" class="sub" />';
	}
	else {
	document.getElementById("ce").innerHTML = '<div id="ce2"><iframe src="popup.asp?action=accept&id=' + popUpCode + '" frameborder="0" scrolling="no"></iframe><br /><input type="button" onclick="PrintPopUp('+  popUpCode +')" value="PrintPrint" class="sub" /> <input type="button" onclick="closePopUp();" value="Close" class="sub" />';
	}
	document.getElementById("ce2").style.top = (windowHeight/2)-200 +'px';
	document.getElementById("ce2").style.left = (windowWidth/2)-300 +'px';
	// $("#ce").css({ "opacity": "0.5"});
	$("#ce").fadeIn("slow");
	popupStatus = 1;
	return false;
}

function acceptPopUp(tmp) {
	closePopUp()
	location.href = 'administration.asp?action14=true&id=' + tmp;
}

function PrintPopUp(tmp) {
	window.open('print.asp?shop=' + tmp, 'printme', 'location=yes,status=no,width=800,height=600,resizable=yes,menubar=yes,toolbar=yes,scrollbars=yes')
}

function closePopUp() {
	document.getElementById("ce").innerHTML = '';
	$("#ce").fadeOut("slow");
	popupStatus = 0;  
}

$(document).keypress(function(e){
	if(e.keyCode==27 && popupStatus==1) {
		closePopUp();
	}
});

function createPopUp2(popUpCode) {
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	document.getElementById("ce").innerHTML = '<div id="ce2"><iframe src="popup.asp?action=reply&id=' + popUpCode + '" frameborder="0" scrolling="no"></iframe><br /><input type="button" onclick="closePopUp();" value="Close" class="sub" />';
	document.getElementById("ce2").style.top = (windowHeight/2)-200 +'px';
	document.getElementById("ce2").style.left = (windowWidth/2)-300 +'px';
	// $("#ce").css({ "opacity": "0.5"});
	$("#ce").fadeIn("slow");
	popupStatus = 1;
	return false;}

