package it.unimi.di.laren.smartwash.Controller;

import it.unimi.di.laren.smartwash.R;
import it.unimi.di.laren.smartwash.View.MainActivity;
import it.unimi.di.laren.smartwash.View.PlayActivity;
import it.unimi.di.laren.smartwash.View.InstructionActivity;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.view.View.OnClickListener;

public class Main_Controller implements OnClickListener{
	private MainActivity mainActivity = null;

	public Main_Controller(MainActivity activity) {
		// TODO Auto-generated constructor stub
		mainActivity = activity;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.PlayBtn:
			Intent showPlay = new Intent(mainActivity.getApplicationContext(),
					PlayActivity.class);
			mainActivity.startActivity(showPlay);
			break;
		case R.id.InstrBtn:
			Intent showInst = new Intent(mainActivity.getApplicationContext(),
					InstructionActivity.class);
			mainActivity.startActivity(showInst);
			break;
		case R.id.creditsBtn:
				mainActivity.creditLay.setVisibility(View.VISIBLE);
				mainActivity.play.setVisibility(View.GONE);
				mainActivity.instruct.setVisibility(View.GONE);
			break;
		case R.id.closeBtn:
				mainActivity.creditLay.setVisibility(View.GONE);
				mainActivity.play.setVisibility(View.VISIBLE);
				mainActivity.instruct.setVisibility(View.VISIBLE);
		case R.id.sands:
			Intent intent = new Intent(Intent.ACTION_VIEW);
	        intent.setData(Uri.parse("http://www.sands-project.eu/"));
	        mainActivity.startActivity(intent);
	        break;
		case R.id.fire:
			Intent intent2 = new Intent(Intent.ACTION_VIEW);
	        intent2.setData(Uri.parse("http://www.ict-fire.eu/home.html"));
	        mainActivity.startActivity(intent2);
	        break;
		case R.id.europa:
			Intent intent3 = new Intent(Intent.ACTION_VIEW);
	        intent3.setData(Uri.parse("http://cordis.europa.eu/fp7/home_en.html"));
	        mainActivity.startActivity(intent3);
	        break;
		case R.id.amis:
			Intent intent4 = new Intent(Intent.ACTION_VIEW);
	        intent4.setData(Uri.parse("http://www.amis.net/web3/"));
	        mainActivity.startActivity(intent4);
	        break;
		case R.id.arduino:
			Intent intent5 = new Intent(Intent.ACTION_VIEW);
	        intent5.setData(Uri.parse("http://www.arduino.cc/"));
	        mainActivity.startActivity(intent5);
	        break;
		case R.id.cartif:
			Intent intent6 = new Intent(Intent.ACTION_VIEW);
	        intent6.setData(Uri.parse("http://www.cbecyl.com/index.php?option=com_content&view=article&id=82&Itemid=109&lang=en"));
	        mainActivity.startActivity(intent6);
	        break;
		case R.id.libelium:
			Intent intent7 = new Intent(Intent.ACTION_VIEW);
	        intent7.setData(Uri.parse("http://www.libelium.com/"));
	        mainActivity.startActivity(intent7);
	        break;
		case R.id.uniaten:
			Intent intent8 = new Intent(Intent.ACTION_VIEW);
	        intent8.setData(Uri.parse("http://www.ntua.gr/index_en.html"));
	        mainActivity.startActivity(intent8);
	        break;
		case R.id.upv:
			Intent intent9 = new Intent(Intent.ACTION_VIEW);
	        intent9.setData(Uri.parse("http://www.ehu.es/"));
	        mainActivity.startActivity(intent9);
	        break;
		case R.id.unimi:
			Intent intent10 = new Intent(Intent.ACTION_VIEW);
	        intent10.setData(Uri.parse("http://www.dsi.unimi.it/"));
	        mainActivity.startActivity(intent10);
	        break;
		case R.id.gorenje:
			Intent intent11 = new Intent(Intent.ACTION_VIEW);
	        intent11.setData(Uri.parse("http://www.gorenjegroup.com/en/about_gorenje_group"));
	        mainActivity.startActivity(intent11);
	        break;
		default:
			break;
		}
		
	}

}
