// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
//																								   //
//									WWW.YALLA.CO.IL												   //
//								   כל הזכויות שמורות											   //
//																								   //
//									@ אלמוג נחמיה @												   //
//																								   //
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //

// תוספות ושידרוגים של מוצר

function updatePrice (productPrice)
{
	var moreSum = 0;
	
	for (i = 1; i < 10; i++)
	{
		elm = document.getElementById('more_' + i);
		
		if	(elm)
		{
			price = parseInt(elm.options[document.getElementById('more_' + i).selectedIndex].title);
			if	(!price) price = 0;
			
			moreSum += price;
		}
	}
	
	document.getElementById('more_sum').innerHTML = moreSum;
	document.getElementById('product_sum').innerHTML = moreSum + productPrice;
}

function getMoreSelections ()
{
	var selections = '';
	
	for (i = 1; i < 10; i++)
	{
		elm = document.getElementById('more_' + i);
		
		if	(elm)
		{
			selections += ',more' + i + ':' + ((elm.value) ? elm.value : 0);
		}
	}
	
	return selections;
}

function upgradesList (html)
{
	myWindow=window.open('','','width=500,height=300')
	myWindow.document.write(html)
	myWindow.document.title = 'רשימת התוספות';
	myWindow.focus()
}

// תגובות

function addComment (page,id,storeId)
{
	var newWin = window.open('./addComment.php?storeid=' + storeId + '&tbl=' + page + '&id=' + id, 'addComment', 'menubar=0,resizable=0,scrollbars=1,top=100,left=200,width=500,height=400');
}

function Comment (id)
{
	var elm = document.getElementById('comment_' + id);
	
	if	(elm.style.display == 'none')
	{
		elm.style.display = 'block'
	}
	else
	{
		elm.style.display = 'none'
	}
}

// שלח לחבר

function send2f (page,id,storeId)
{
	var newWin = window.open('./send2f.php?storeid=' + storeId + '&tbl=' + page + '&id=' + id, 'send2f', 'menubar=0,resizable=0,scrollbars=1,top=100,left=200,width=500,height=400');
}

// גירסה להדפסה

function printVersion (page,id,storeId,pType)
{
	var newWin = window.open('./printVersion.php?storeid=' + storeId + '&tbl=' + page + '&id=' + id + '&pType=' + pType, 'printVersion', 'menubar=0,resizable=1,scrollbars=1,top=100,left=200,width=700,height=500');
}

// שכחתי סיסמא

function forgotPass (yallaUrl,storeId,lang)
{
	var newWin = window.open(yallaUrl + '/?view=forgotpass&disableHeader=true&storeid=' + storeId + '&lang=' + lang, 'forgotPass', 'menubar=0,resizable=0,scrollbars=1,top=100,left=200,width=400,height=300');
}

// מכרזים

function michrazim (yallaUrl,storeId,userId,price,esroni,productId)
{
	var newWin = window.open(yallaUrl + '/ssl/michrazim.php?storeid=' + storeId + '&userId=' + userId + '&productId=' + productId + '&price=' + price + '&esroni=' + esroni, 'michrazim', 'menubar=0,resizable=0,scrollbars=1,top=100,left=200,width=500,height=350');
}

function michrazimPacks (yallaUrl,storeId,userId,packId)
{
	var newWin = window.open(yallaUrl + '/ssl/michrazim.packs.php?storeid=' + storeId + '&userId=' + userId + '&packId=' + packId, 'michrazimPacks', 'menubar=0,resizable=0,scrollbars=1,top=100,left=200,width=500,height=350');
}

function openMifrat (storeId,productId)
{
	var newWin = window.open('mifrat.php?storeid=' + storeId + '&productId=' + productId, 'mifrat', 'menubar=0,resizable=0,scrollbars=1,top=100,left=200,width=500,height=350');
}