function openPopUp(href, target, width, height)
{
	window.open(href, target, 'width=' + width + ', height=' + height + ', top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}
function openPopUp_520x390(href, target)
{
	return openPopUp(href, target, "520", "390");
}
function sendToFriend(idx, lang)
{
	return openPopUp(baseURL + "send_to_friend.php?id=" + idx + "&lang=" + lang, "", "520", "390");
}
function makeOffer(idx, bore, rod, stroke, lang)
{
	return openPopUp(baseURL + "make_offer.php?id=" + idx + "&bore=" + bore + "&rod=" + rod + "&stroke=" + stroke + "&lang=" + lang, "", "520", "390");
}
function openPopUp_600x460(href, target)
{
	window.open(href, target, 'width=600, height=460, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}
function getSWF(swWidth, swHeight, swFile, swWmode)
{
	var str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width='+swWidth+'  height='+swHeight+'>';
	str += ' <param name="movie" value="'+swFile+'" /> ';
	str += ' <param name="quality" value="high" /> ';
	str += ' <param name="wmode" value="'+swWmode+'" /> ';
	str += ' <embed src='+swFile+' width='+swWidth+' height='+swHeight+' quality="high" pluginspage="http://www .macromedia.com/go/getflashplayer" type="application/x-shoc kwave-flash" wmode="transparent"></embed> ';
	str += ' </object> ';
	document.write(str);
}
function changeProductTab(idx)
{
	if(idx == 1)
	{
		document.getElementById("pro_tab1").style.display = 'block';
		document.getElementById("pro_tab2").style.display = 'none';
		document.getElementById("pro_tab3").style.display = 'none';
	}
	else if(idx == 2)
	{
		document.getElementById("pro_tab1").style.display = 'none';
		document.getElementById("pro_tab2").style.display = 'block';
		document.getElementById("pro_tab3").style.display = 'none';
	}
	else
	{
		document.getElementById("pro_tab1").style.display = 'none';
		document.getElementById("pro_tab2").style.display = 'none';
		document.getElementById("pro_tab3").style.display = 'block';
	}
}

function changeProduct(tab, direction)
{
	if(tab=='1')
	{
		control = _location1 + direction;
		if ((control<0) || (control==productCount1))
			return false;
		_location1 += direction;
		
		var title = document.getElementById("tab1_title");
		title.innerHTML = productsTitles1[_location1];
		
		var img = document.getElementById("tab1_a");
		img.href = 'product_detail.php?id=' + productsImages1[_location1];
	
		var img = document.getElementById("tab1_img");
		img.src = 'images/product/' + productsImages1[_location1] + '.jpg';
	}
	else if(tab=='2')
	{
		control = _location2 + direction;
		if ((control<0) || (control==productCount2))
			return false;
		_location2 += direction;
		
		var title = document.getElementById("tab2_title");
		title.innerHTML = productsTitles2[_location2];
		
		var img = document.getElementById("tab2_a");
		img.href = 'product_detail.php?id=' + productsImages2[_location2];
	
		var img = document.getElementById("tab2_img");
		img.src = 'images/product/' + productsImages2[_location2] + '.jpg';
	}
	else
	{
		control = _location3 + direction;
		if ((control<0) || (control==productCount3))
			return false;
		_location3 += direction;
		
		var title = document.getElementById("tab3_title");
		title.innerHTML = productsTitles3[_location3];
		
		var img = document.getElementById("tab3_a");
		//img.href = 'product_detail.php?id=' + productsImages3[_location3];
		img.href = 'product.php?parent_ids=00003';
	
		var img = document.getElementById("tab3_img");
		img.src = 'images/product/' + productsImages3[_location3] + '.jpg';
	}
}
