#!/bin/bash
# This code is part of CMPL
#
# Copyright (C) 2007, 2008, 2009, 2010, 2011 Thomas Schleiff - Halle(Saale), 
# Germany and Mike Steglich - Technical University of Applied Sciences
# Wildau, Germany 
#
# Coliop and CMPL are projects of the Technical University of 
# Applied Sciences Wildau and the Institute for Operations Research 
# and Business Management at the Martin Luther University 
# Halle-Wittenberg.
# Please visit the project homepage <www.coliop.org>
# 
# CMPL is free software; you can redistribute it and/or modify it 
# under the terms of the GNU General Public License as published by 
# the Free Software Foundation; either version 3 of the License, or 
# (at your option) any later version.
# 
# CMPL is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 
# License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# @author  Mike Steglich 

progPath="`dirname \"$0\"`"
if [[ $progPath = "." ]] ; then
	progPath="" 
else
	progPath=$progPath/
fi

manFile="$progPath"../doc/CMPL.pdf

if [[ $OSTYPE == *darwin* ]] ; then
	help="/usr/bin/open"
elif [[ $OSTYPE == *linux* ]]; then
  
	FE=1
	type -p evince &>/dev/null || FE=0
	FO=1
	type -p okular &>/dev/null || FO=0
	FX=1
	type -p xpdf &>/dev/null || FX=0


	help=""

	if  [ "$FE" = 1 ]; then
    	help="evince"
	elif  [ "$FO" = 1 ]; then
    	help="okular" 
	elif  [ "$FX" = 1 ]; then
    	help="xpdf"      
	fi
fi


$help  "$manFile" & 