//////////////////////////////////////////
// General Javascript functions used in //
// the Indigo Prime 2005 site.          //
// Copyright Indigo Prime, 2005         //
//////////////////////////////////////////

//the following are default functions run automatically
//-----------> Start default functions

//first break out of any 3rd party frames
if (window!= top){
if (mysite!="indigo") {
top.location.href=location.href}}

//ensure that the status bar message is consistent regardless of links etc.
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidelinks
document.onmouseout=hidelinks

//<--------end default functions

//The following are functions called from html as required
//------------> Start called functions



//expanding animated window function
function expandingWindow(website) {
var windowprops='width=100,height=100,scrollbars=yes,status=yes,resizable=yes';
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 7;  // horizontal scrolling speed (higher = slower)
var leftdist = 10;    // distance to left edge of window
var topdist = 10;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'IndigoHelp');
}
//  End -->

//submit form pending script
function submittedform()
{ //location.replace("http://www.indigoprime.co.uk");
window.location.href="index.htm";
}

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") {
//disable em
tempobj.disabled=true;
}
}
}
//alert('Thank you. The details have been sent to our server.');
}

//send to a friend script
function sendtofriend()
{
//edit esub to change email subject
var esub="Hi, You have been sent this link by a visitor to our site.";
window.location="mailto:?body="+document.title+" can be found at the following address (just click the link!): "+window.location+"&subject="+esub;
} 

//hidestatus() related to status bar message script above
function hidelinks(){
window.status='++ Welcome to Indigo Prime - The Data Management Backup & Recovery Experts++'
return true
}

// bookmarkindigo() bookmarks current page */
function bookmarkindigo(name, url){
if (document.all)
window.external.AddFavorite(url, name);
else if (window.sidebar)
window.sidebar.addPanel(name, url, "")
}

//<------------ end called functions