function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

var newFlag = 'uk';
var oldFlag = '';

function termsFlag(strFlag,IdFlag) {
	$('terms').className = strFlag;
	$('pLink').onclick = function (){ termsPopup(strFlag)};
	$('banner').className = strFlag;
	if(strFlag == 'italy'){
		$('footer').innerHTML = 'Araldite &egrave; un marchio registrato di Huntsman Corporation o delle sue filiali in uno o pi&Uacute; paesi ma non in tutti i paesi.<br />Copyright &copy; 2010 Huntsman Advanced Materials (Svizzera) GmbH';
		$('pFlag').innerHTML = "Per le condizioni di piena concorrenza e servizi <a id='pLink' href='#' title='clicca qui' onclick=termsPopup('italy');>clicca qui</a>. Progettato da <a href='http://www.hcl.uk.com' target='_blank' title='hcl marketing communications' class='white'>hcl marketing communications</a>"
	}
	if(strFlag == 'spain'){
		$('footer').innerHTML = 'Araldite es una marca registrada de Huntsman Corporation o sus subsidiarias en uno o m&aacute;s pa&iacute;ses, pero no en todos los pa&iacute;ses.<br />Copyright &copy; 2010 de Huntsman Advanced Materials (Suiza) GmbH';
		$('pFlag').innerHTML = "Para conocer los t&Eacute;rminos de plena competencia y condiciones <a id='pLink' href='#' title='presione aqu&iacute;' onclick=termsPopup('spain');>presione aqu&iacute;</a>. Dise&Ntilde;ado por <a href='http://www.hcl.uk.com' target='_blank' title='hcl marketing communications' class='white'>hcl marketing communications</a>"
	}
	if(strFlag == 'germany'){
		$('footer').innerHTML = 'Araldite ist eine eingetragene Handelsmarke von Huntsman Corporation oder ihrer Tochtergesellschaften in einem oder mehreren L&auml;ndern, aber nicht in allen L&auml;ndern. Copyright &copy; 2010 Huntsman Advanced Materials (Schweiz) GmbH';
		$('pFlag').innerHTML = "F&uuml;r die vollst&Auml;ndigen Teilnahmebedingungen <a id='pLink' href='#' title='hier klicken' onclick=termsPopup('germany');>hier klicken</a>. Entworfen von <a href='http://www.hcl.uk.com' target='_blank' title='hcl marketing communications' class='white'>hcl marketing communications</a>"
	}
	if(strFlag == 'france'){
		$('footer').innerHTML = 'Araldite est une  marque d&egrave;pos&egrave;e de Huntsman Corporation ou de ses filiales dans un ou plusieurs pays, mais pas dans tous les pays.<br />Copyright &copy; 2010 Huntsman Advanced Materials (Switzerland) GmbH';
		$('pFlag').innerHTML = "Pour ce qui concerne la pleine concurrence et conditions  <a id='pLink' href='#' title='cliquez ici' onclick=termsPopup('france');>cliquez ici</a>. Progettato da <a href='http://www.hcl.uk.com' target='_blank' title='hcl marketing communications' class='white'>hcl marketing communications</a>"
	}
	if(strFlag == 'uk'){
		$('footer').innerHTML = 'Araldite is a registered trademark of Huntsman Corporation or its subsidiaries in one or more countries but not in all countries.<br />Copyright &copy; 2010 Huntsman Advanced Materials (Switzerland) GmbH';
		$('pFlag').innerHTML = "For full competition terms &amp; conditions  <a id='pLink' href='#' title='click here' onclick=termsPopup('uk');>click here</a>. Designed by <a href='http://www.hcl.uk.com' target='_blank' title='hcl marketing communications' class='white'>hcl marketing communications</a>"
	}
	oldFlag 	= strFlag;
	$(IdFlag).className 	= newFlag;
	innerhtml = $(IdFlag).innerHTML;
	innerhtml = innerhtml.replace(oldFlag,newFlag);
	$(IdFlag).innerHTML 	= innerhtml;
	newFlag 	= oldFlag;
}

function termsPopup(strFlag) {
	window.open( "terms.html?c="+strFlag+"", "myWindow", "status = 0, height = 600, width = 550, resizable = 0, top=100, menubar=0, scrollbars=1" );
}

function showTerms(strFlag) {
	if( $(strFlag))	{
		$(strFlag).style.display = 'block';	
	}
}	

function getC(){
	var qs_c = window.location.search.substring(1);
	qs_c = qs_c.replace('c=','');
	showTerms(qs_c);
	//alert(qs_c);
}



