/* This stylsheet part must stay at the bottom of the page */
var verMajor; 
var verMinor; 
var Platform; 
var cssSheet;
var PLATFORM_MAC = 0;
var PLATFORM_WIN95 = 1;
var PLATFORM_WIN98 = 2;
var PLATFORM_WINNT = 3;
var PLATFORM_WIN2000 = 4;
var PLATFORM_WINXP = 5;
var PLATFORM_WINVISTA = 6;
var PLATFORM_OTHER =99;

/*Detect browsertype and version*/
function SetBrowserVer(){
	// Check whether IE or Netscape
	if (navigator.appName == "Microsoft Internet Explorer") {ie = true;} 
        else {
           if (navigator.appName == "Opera") {opera = true;}
           else {ns = true;}
           };  
	// Check Platform
	if(navigator.appVersion.indexOf('MAC') != -1){Platform = 0;};
	if(navigator.appVersion.indexOf('Macintosh') != -1){Platform = 0;};
	if(navigator.appVersion.indexOf('OS') != -1){Platform = 0;};
        if(navigator.appVersion.indexOf('Windows') != -1){Platform = 3;};
	if(navigator.appVersion.indexOf('95') != -1){Platform = 1;};
	if(navigator.appVersion.indexOf('98') != -1){Platform = 2;};
	if(navigator.appVersion.indexOf('NT') != -1){Platform = 3;};
	if(navigator.appVersion.indexOf('NT 5') != -1){Platform = 4;};
        if(navigator.appVersion.indexOf('XP') != -1){Platform = 5;};
        if(navigator.appVersion.indexOf('Vista') != -1){Platform = 6;};
	if(Platform == -1){Platform = 99;};
	// Check Version

	if(ie) {
		if(navigator.appVersion.indexOf('MSIE 7.') != -1){verMajor = "7";verMinor = "0";};
                if(navigator.appVersion.indexOf('MSIE 6.') != -1){verMajor = "6";verMinor = "0";};
		if(navigator.appVersion.indexOf('MSIE 5.') != -1){verMajor = "5";verMinor = "0";};
		if(navigator.appVersion.indexOf('MSIE 5.5') != -1){verMajor = "5";verMinor = "5";};
		if(navigator.appVersion.indexOf('MSIE 5.0') != -1){verMajor = "5";verMinor = "0";};
		if(navigator.appVersion.indexOf('MSIE 5.01') != -1){verMajor = "5";verMinor = "1";};
		if(navigator.appVersion.indexOf('MSIE 5.2') != -1){verMajor = "5";verMinor = "0";};
		if(navigator.appVersion.indexOf('MSIE 4.') != -1){verMajor = "4";verMinor = "0";};
		if(navigator.appVersion.indexOf('MSIE 4.5') != -1){verMajor = "4";verMinor = "5";};
		if(navigator.appVersion.indexOf('MSIE 4.0') != -1){verMajor = "4";verMinor = "0";};
		if(navigator.appVersion.indexOf('MSIE 4.01') != -1){verMajor = "4";verMinor = "1";};
		if(navigator.appVersion.indexOf('MSIE 3') != -1){verMajor = "3";verMinor = "0";};
	}
	if(ns) {
		if(navigator.appVersion.indexOf('2.') != -1){verMajor = "2";verMinor = "0";};
		if(navigator.appVersion.indexOf('3.') != -1){verMajor = "3";verMinor = "0";};
		if(navigator.appVersion.indexOf('4.') != -1){verMajor = "4";verMinor = "0";};
		if(navigator.appVersion.indexOf('4.5') != -1){verMajor = "4";verMinor = "5";};
		if(navigator.appVersion.indexOf('4.6') != -1){verMajor = "4";verMinor = "6";};
		if(navigator.appVersion.indexOf('4.7') != -1){verMajor = "4";verMinor = "7";};
		if(navigator.appVersion.indexOf('5.') != -1){verMajor = "6";verMinor = "0";};
		if(navigator.appVersion.indexOf('6.') != -1){verMajor = "6";verMinor = "0";};
		if(navigator.appVersion.indexOf('7.') != -1){verMajor = "7";verMinor = "0";};
		if(navigator.appVersion.indexOf('Safari') != -1){verMajor = "Safari";verMinor = "0";};
                if(navigator.appVersion.indexOf('Chrome') != -1){verMajor = "Chrome";verMinor = "0";};
                if(navigator.appVersion.indexOf('Opera') != -1){verMajor = "Opera";verMinor = "0";};
	}
}

/*Call Style Sheet*/
function StyleSheet(){
    if (ie) {
        if(Platform==PLATFORM_MAC) {
            if(verMajor=="5") { cssSheet="mac_ie.css"; } else { cssSheet="mac_ie4.5.css"; }
        }
        else { cssSheet="pc_ie.css"; }
    }
    if (ns) {
        if(Platform==PLATFORM_MAC) {
            switch (verMajor) {
            case "7": 
              cssSheet="mac_ns7.css";
              break;
            case "6": 
              cssSheet="mac_ns6.css";
              break;
            case "Safari": 
              cssSheet="mac_safari.css";
              break;
            case "Opera": 
              cssSheet="mac_opera.css";
              break;
            default: 
              cssSheet="mac_ns4.css";
            }
        } else {
            if((verMajor=="6")||(verMajor=="7")) { cssSheet="pc_ns6.css"; }
            if(verMajor=="4") { cssSheet="pc_ns4.css"; }
            if(verMajor=="Chrome") { cssSheet="pc_chrome.css"; }
            if(verMajor=="Opera") { cssSheet="pc_opera.css"; }
        }
    }
    if (opera) { cssSheet="pc_opera.css"; }
    if((ie==false) && (ns==false) && (opera==false)) { cssSheet="pc_ie.css"; }

// write stylesheet link to document
document.write('<link rel="stylesheet" type="text/css" href="/style/' + cssSheet + '" />');
}

/*Module Initialization*/
ns = false;
ie = false;
opera = false;SetBrowserVer();StyleSheet();/* OTHER STUFF */function MM_findObj(n, d) { //v3.0	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;	}var menucellfunction ChangeBgColor(cellid,color) {	if (document.getElementById) {menucell = document.getElementById(cellid);}	else if (document.all) {menucell = document.all[cellid];}	menucell.style.backgroundColor = color;	}

function JumpMenu(menuid) {
	if (document.getElementById) {thismenu = document.getElementById(menuid);}	else if (document.all) {thismenu = document.all[menuid];}
	nextpage = thismenu.value + "";
        if (nextpage.length > 4) {window.location = nextpage;}
	}/* Occupation Counter */d = new Array("SUN","MON",	"TUE","WED",	"THU","FRI",	"SAT"	);m = new Array("JAN", "FEB",	"MAR", "APR",	"MAY", "JUN",	"JUL", "AUG",	"SEP", "OCT",	"NOV", "DEC"	);var today, day, date, month, year, dispdate, occdays;today = new Date();day = today.getDay();day = d[day];date = today.getDate();if ((date == 1) || (date == 21 ) || (date == 31)) { date = date + "st";} else if ((date == 2) || (date == 22 )) { date = date + "nd";} else if ((date == 3) || (date == 23 )) { date = date + "rd";}else { date = date + "th";}month = today.getMonth();month = m[month];year = today.getYear();if (year < 1900) { year = year + 1900;}dispdate = day + ", " + date + " " + month + " " + year;// Set date1temp to 09/04/2003 (start of occupation)// date1temp = new Date("04/09/2003 00:00:00");date1temp = new Date();date1temp.setTime(1049842800000);// Find how many days have passed since start of occupationdate2temp = new Date();timediff = Math.abs(date2temp.getTime() - date1temp.getTime());occdays = Math.floor(timediff / (1000 * 60 * 60 * 24));var topmsgvar mindatemindate = new Date("06/05/2004 00:00:00");if (today > mindate) { topmsg = "<span class=\"date\">" + dispdate + "  | </span><span class=\"occdays\">" + occdays + " days of occupation</span>"; }else { topmsg = "<span class=\"date\">For info, contact: <a href=\"mailto:iraqfocus@riseup.net\" style=\"color: #FFFFFF\">iraqfocus@riseup.net</a></span>";}
