﻿

var browser = navigator.appName;
var isIE6 = false;

if (browser.indexOf("Internet Explorer")!=-1) {
	if (navigator.appVersion.indexOf("MSIE 6")!=-1) {
		isIE6 = true;
	}
}

//--logs the specified event in NextStat and Google Analytics
function nextstatLogEvent(description) {
	//--nextstatlog
	NS_LogEvent(description);
	//--analytics log
	pageTracker._trackPageview(description);

	//--log total studio contact clicks
	NS_LogEvent('studioContactTotal');
	pageTracker._trackPageview('/studioContactTotal');
}



//repositions the sub menu for ie6
function checkIE() {
	if (isIE6) {	
	
		var mainMenu = document.getElementById("CMSListMenu1");
		

		mainMenu.style.paddingTop = "0";

		//--move the parent div down 2 pixels
		var contDiv = mainMenu.parentElement;

		contDiv.style.paddingTop = "2px";

		//--move each sub UL left -495 pixels, set the width and move it down 10pixels
		var arr = mainMenu.getElementsByTagName("UL");
		for(i=0;i<arr.length;i++) {
			if (arr[i].className=="subCMSListMenuUL") {
              //  arr[i].style.left = "25px";
	            //arr[i].style.width = "654";
				//arr[i].style.top="10px";
			}
		
		}

	
		mainMenu.style.visibility = "visible";
	}
}



	




function playVideo(vidName) {

    window.open("../choosevideoformat.aspx?video=" + vidName,"vidPlayer","width=500,height=400,buttons=no,menubar=no");

}


function selectCV() {
    window.open("../uploadCV.aspx","cvwin","width=500,height=400,buttons=no,menubar=no");
}


function galleryImage(name,id) {
    this.name = name;
    this.id = id;
}

//--holds the first image in the current gallery
var firstImage = null;

//--initialises the first image for the gallery
function createFirstImage(galleryImage) {
    if (firstImage==null) firstImage = galleryImage;
}



function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}


