<!--
var Dom = YAHOO.util.Dom;
var yEvent = YAHOO.util.Event;

function init()
{
	initFlash();
	YAHOO.contact.rewriteMail();
	if (Dom.get('terkep')) initializeMap();
	/*
	if (document.getElementById('moveH1')) {
		var moveH1 = document.getElementById('moveH1');
		document.getElementById('h1').innerHTML = moveH1.innerHTML;
		moveH1.parentNode.removeChild(moveH1);
	}
	*/
}

function initFlash() {
	var flashvars = {};
	var params = {wmode: "transparent"};
	var attributes = {};
	swfobject.embedSWF(SITE_ROOT+"library/flash/header.swf", "header", "963", "240", "9.0.0", false, flashvars, params, attributes);
}


function changeBigThumb(obj) {
	var temp = obj.src;
	var picPath = temp.substr(temp.lastIndexOf('../')+3);
	var bigPicSrc = Dom.get('bigpic').src;
	var bigPicLink = Dom.get('bigpicLink').href;
	var newBigPicSrc = bigPicSrc.substr(0,bigPicSrc.lastIndexOf('../'))+'../'+picPath;
	var newBigPicLink = SITE_ROOT+bigPicLink.substr(0,bigPicLink.lastIndexOf('../'))+picPath;
	Dom.get('bigpic').src = newBigPicSrc;
	Dom.get('bigpicLink').href = newBigPicLink;
}

/*
YAHOO.namespace('popup');

YAHOO.popup.close = function popupClose(justHolder) {
	if (Dom.get('popupBg')) {
		document.body.removeChild(Dom.get('popupHolder'));
		if (justHolder!=true) document.body.removeChild(Dom.get('popupBg'));
	}
}

YAHOO.popup.open = function popupOpen(image,w,h) {
	YAHOO.popup.close(true);
	w += 20;
	h += 20+25;
	if (w<200) w=200;
	
	if (Dom.get('popupBg')==undefined) {
		var bg = document.createElement('div');
		bg.id = 'popupBg';
		bg.onclick = function(){YAHOO.popup.close();}
		bg.className = 'popupBg';
		bg.style.height = Dom.getRegion(Dom.get('body')).height+50+'px';
		document.body.appendChild(bg);
	}

	var picDiv = document.createElement('div');
	picDiv.id = 'popupHolder';
	picDiv.className = 'popupHolder';
	picDiv.style.width = w+'px';
	picDiv.style.height = h+'px';
	picDiv.style.left = (Dom.getViewportWidth()-w)/2+'px';
	picDiv.style.top = (Dom.getViewportHeight()-h)/2+Dom.getDocumentScrollTop()+'px';
	
	var closeDiv = document.createElement('div');
	closeDiv.className = 'closeDiv';
	closeDiv.onclick = function(){YAHOO.popup.close();}
	picDiv.appendChild(closeDiv);
	
	var img = document.createElement('img');
	img.src = SITE_ROOT+image;
	picDiv.appendChild(img);
	
	document.body.appendChild(picDiv);
}
*/


YAHOO.namespace('contact');

YAHOO.contact.rewriteMail = function contactRewriteMail() {
	var links = Dom.getElementsByClassName('mail');
	if (links) {
		var linksSize = links.length;
		for (var i=0; i<linksSize; i++) {
			var string = links[i].innerHTML;
			string = string.replace('www.','mailto:');
			string = string.replace('#','@');
			links[i].href = string;
			links[i].innerHTML = string.substr(7);
		}
	}
}

YAHOO.contact.submit = function contactSubmit() {
	var obj = document.contact;
	var name = obj.c_name.value;
	var from = obj.c_from.value;
	var message = obj.c_message.value;
	var secnr = obj.secnr.value;
	var hidden_secnr = obj.hidden_secnr.value;
	var valid = false;
	if (name=='' || from=='' || message=='' || secnr=='') alert('Toate campurile sunt obligaroriu!');
	else if (!YAHOO.contact.isValidMail(from)) alert('Adresa email este incorecta!');
	else if (!YAHOO.contact.isValidSecnr(obj)) alert('Codul de securitate este incorecta!');
	else valid = true;
return valid;
}

YAHOO.contact.isValidMail = function contactIsValidMail(mail) {
	var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
  	var error = (emailPattern.test(mail.toLowerCase())) ? true : false; 
return error;
}

YAHOO.contact.isValidSecnr = function contactIsValidSecnr(obj) {
	if (obj.secnr.value!='' && obj.secnr.value==obj.hidden_secnr.value) return true;
	else return false;
}




function initializeMap() {
	var latlng = new google.maps.LatLng(47.040709, 21.956606);
	var myOptions = {
	  zoom: 15,
	  center: latlng,
	  mapTypeId: google.maps.MapTypeId.ROADMAP,
	  mapTypeControl: false
	};	
	var map = new google.maps.Map(document.getElementById("terkep"), myOptions);
	
	var companyLogo = new google.maps.MarkerImage('library/style/map-marker copy.png',
		new google.maps.Size(90,60),
		new google.maps.Point(0,0),
		new google.maps.Point(-5,-10)
	);
	var companyShadow = new google.maps.MarkerImage('library/style/map-shadow copy.png',
		new google.maps.Size(90,60),
		new google.maps.Point(0,0),
		new google.maps.Point(1,-5)
	);
	
	var companyMarker = new google.maps.Marker({
	  position: latlng,
	  map: map,
	  title:"Sc. INTER PACK Srl.",
	  icon: companyLogo,
	  shadow: companyShadow
	});
}


/************
 * EMERIGOS *
 ************/

function eon2(a)
{
	document.getElementById('emeon').style.opacity=a/10;
	document.getElementById('emeon').style.filter='alpha(opacity='+a*10+')';
	if (a<10) setTimeout("eon2("+(a+1)+")",25);
}

function eon(a)
{
document.getElementById('emeoff').style.opacity=a/10;
document.getElementById('emeoff').style.filter='alpha(opacity='+a*10+')';
if (a>0) setTimeout("eon("+(a-1)+")",20);
	else
	{
	document.getElementById('emeoff').style.display='none';
	document.getElementById('emeon').style.display='';
	document.getElementById('emeon').style.opacity=0;
	document.getElementById('emeon').style.filter='alpha(opacity=0)';
	eon2(0);
	}
}
	
function eoff2(a)
{
document.getElementById('emeoff').style.filter='alpha(opacity='+a*10+')';
document.getElementById('emeoff').style.opacity=a/10;
if (a<10) setTimeout("eoff2("+(a+1)+")",25);
}

function eoff(a)
{
document.getElementById('emeon').style.filter='alpha(opacity='+a*10+')';
document.getElementById('emeon').style.opacity=a/10;
if (a>0) setTimeout("eoff("+(a-1)+")",20);
	else
	{
	document.getElementById('emeon').style.display='none';
	document.getElementById('emeoff').style.display='';
	document.getElementById('emeoff').style.filter='alpha(opacity=0)';
	document.getElementById('emeoff').style.opacity=0;
	eoff2(0);
	}
}
-->
