﻿
function getPath()

{
var pathname = window.location.pathname;
return pathname;
}

var logos=new Array()

logos[0]=  'sponsor/sponsor-d.jpg' // click our sponsors
logos[1]= 'sponsor/sponsor-ihs.jpg' // IHS
logos[2]=  'sponsor/sponsor-w.jpg' // Winslow
//logos[3]=  'sponsor/sponsor-cmca.jpg' // CMCAUK



function applyeffect(){
if (document.all){
sponsorlogo.style.filter="revealTrans(duration=2,transition=23)"
sponsorlogo.filters.revealTrans.Transition=Math.floor(Math.random()*23)
sponsorlogo.filters.revealTrans.stop()
sponsorlogo.filters.revealTrans.apply()
}
}


function playeffect(){
if (document.all)
sponsorlogo.filters.revealTrans.play()
}


// function to link to appropriate sponsor
function GoSponsor() {
   //if (sponsor==0)  do nothing
   //if (sponsor==1) javascript:Start('http://217.69.40.185/TStats/TStatsV2DRegClick.asp?wid=4&url=http://solutions.ihs.com&Referer='+location.href );
   //if (sponsor==2) javascript:Start('http://217.69.40.185/TStats/TStatsV2DRegClick.asp?wid=2&url=http://www.winslow.co.uk&Referer='+location.href);
   //if (sponsor==3) javascript:Start('http://217.69.40.185/TStats/TStatsV2DRegClick.asp?wid=6&url=http://www.cmcauk.co.uk&Referer='+location.href);
   if (sponsor==1) javascript:Start('http://solutions.ihs.com?ref=COGwebsite');
   if (sponsor==2) javascript:Start('http://www.winslow.co.uk?ref=COGwebsite');

}

// function to load sponsor pages in new window
//function Start(page) {
//OpenWin = this.open(page, "CtrlWindow", "resizable=yes,toolbar=yes location=yes scrollbars=yes,width=800,height=500, left=40, top=40");
//}

function Start(strURL) {
var strOptions="";
strOptions="toolbar,menubar,scrollbars,resizable, location,height=600,width=1000";
window.open(strURL, 'self', strOptions);
}



function rotate(){
if ((sponsor+1)>2) sponsor=-1
{
++sponsor
applyeffect()
document.images.sponsorlogo.src=logos[sponsor]
playeffect()
}
setTimeout('rotate()',6000);

}



