/** Image Arrays **/

var myImages = new Array("images/TOP_Image_1.jpg","images/TOP_Image_2.jpg","images/TOP_Image_3.jpg","images/TOP_Image_4.jpg","images/TOP_Image_5.jpg","images/TOP_Image_6.jpg","images/TOP_Image_7.jpg","images/TOP_Image_8.jpg","images/TOP_Image_9.jpg","images/TOP_Image_10.jpg","images/TOP_Image_11.jpg","images/TOP_Image_12.jpg","images/TOP_Image_13.jpg","images/TOP_Image_14.jpg","images/TOP_Image_15.jpg","images/TOP_Image_16.jpg","images/TOP_Image_17.jpg");
var myImageLength = myImages.length - 1;

/** Insert Pictures **/

function changeOnePic()
{
var arrayNumber1 = Math.round(Math.random() * myImageLength);
document.images.mainImage.src = myImages[arrayNumber1];
}

function writeOnePic()
{
var arrayNumber1 = Math.round(Math.random() * myImageLength);
document.write("<img name='mainImage' id='mainImage' src=" + myImages[arrayNumber1] + " width=970 height=230 alt='African Diving and Safari Tours by Surf n Turf Tours' border='0'>");

}

//Change Flash Video

function changeFLV(file,headIN)
{
//Flash Object Write
var root = 'file=http:\/\/www.surfturftours.com/diving_videos/flash/' + file + '&bufferlength=10';
var s1 = new SWFObject('flvmediaplayer/player.swf','player','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars',root);
s1.write('preview');

//Write to ID in page
//With Netscape 4.x, the code should look familiar: 
if (document.layers)
{document.headOUT.document.write(headIN);}

//Internet Explorer 5+, Netscape 6+ and all standards compliant browsers write to layers using the innerHTML property:
else if (document.getElementById)
{document.getElementById('headOUT').innerHTML = headIN;}

//Internet Explorer 4 and 4.5 varying slightly with its document.all syntax: 
else if (document.all)
{document.all['headOUT'].innerHTML = headIN;}


}

function changeWMV(file,headIN)
{
//Flash Object Write

var wmv1 = "<object id='MediaPlayer' classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' standby='Loading Windows Media Player components...' type='application/x-oleobject' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112' height='288' width='384'><param name='filename' value='http://www.surfturftours.com/diving_videos/" + file + "'><param name='Showcontrols' value='True'><param name='autoStart' value='true'><embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='http://www.surfturftours.com/diving_videos/" + file + "' name='MediaPlayer' autostart='1' showcontrols='1' height='330' width='384'></object>"

//Write to ID in page
//With Netscape 4.x, the code should look familiar: 
if (document.layers)
{document.headOUT.document.write(headIN);
document.preview.document.write(wmv1);}

//Internet Explorer 5+, Netscape 6+ and all standards compliant browsers write to layers using the innerHTML property:
else if (document.getElementById)
{document.getElementById('headOUT').innerHTML = headIN;
document.getElementById('preview').innerHTML = wmv1;}

//Internet Explorer 4 and 4.5 varying slightly with its document.all syntax: 
else if (document.all)
{document.all['headOUT'].innerHTML = headIN;
document.all['preview'].innerHTML = wmv1;}


}



// Print an element from an html page :)
function CallPrint(strid)
{

if (document.layers)
{var prtContent = document.strid.document;}

//Internet Explorer 5+, Netscape 6+ and all standards compliant browsers write to layers using the innerHTML property:
else if (document.getElementById)
{var prtContent = document.getElementById(strid).innerHTML;
}

//Internet Explorer 4 and 4.5 varying slightly with its document.all syntax: 
else if (document.all)
{var prtContent = document.all[strid].innerHTML;}

WinPrint= window.open ('','mywindowname'); 
WinPrint.document.write(
// Custom Html page construction...
"<html><head><title>Dive tours, safari tours | Surf n Turf Tours | KwaZulu-Natal, South Africa.</title><link rel='stylesheet' type='text/css' href='style.css' /><script language='JavaScript' type='text/javascript' src='fade.js'></script><link rel='stylesheet' type='text/css' href='print.css' media='print' /></head><body bgcolor=#FFFFFF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onload='timedChange1(8000);timedChange2(8000);'><img src='images/SurfTurfLogo.jpg' border='0'><br clear='all'><br>" + prtContent + "<script language='JavaScript' type='text/javascript'>if (document.layers){document.printButton.document.write('');}else if (document.getElementById){document.getElementById('printButton').innerHTML = '';}else if (document.all){document.all['printButton'].innerHTML = '';}if (document.layers){document.goBack.document.write('');}else if (document.getElementById){document.getElementById('goBack').innerHTML = '';}else if (document.all){document.all['goBack'].innerHTML = '';}window.print();</script></body></html>");
}

