function showHide(divID) 
{
	document.getElementById(divID).style.display == 'none' ? document.getElementById(divID).style.display = 'block' : document.getElementById(divID).style.display = 'none';
}

function pop(src)
{
	window.open('<?php echo BASE_HREF; ?>custom_images/produse/full/'+stripPath(src),'popup' ,'resizable=1, status=0, toolbar=0, location=0, menubar=0, width=850, height=850');
}

function stripPath(loc)
{
	return loc.replace(/^(((.+)\/)+)?(([\w\-_]+\.)+\w{3})$/, '$4');
}

function changePic(newSrc)
{
	document.getElementById('poza_mare').src=newSrc;
}

function activate(objectName){
	document.getElementById(objectName).className='hover';
}

function deactivate(objectName){
	document.getElementById(objectName).className='';
}

// Change the picture
function changePic(newSrc)
{
	document.getElementById('poza_mare').src=newSrc;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function reloadWindow()
{
	window.location=window.location;
	
	return;
}

function closeWindow(Id)
{
	document.getElementById(Id).style.display = "none";
}

// Checks if a field is empty, and if so, resets the input's content to the default value
function checkField( obj, value )
{
	// Match any amount of white spaces
	if( obj.value.match( " " ) || obj.value == "" )
	{
		obj.value = value;
	}
	
	return false;
}

// Clears an input's content
function clearField( obj, value )
{
	if( obj.value == value )
	{
		obj.value = "";
	}
	
	return false;
}