//sundayleague js file.

function simplepop( url, name, height, width, scroll, resize, x, y ) {
 window.open(url, name, "height="+height+",width="+width+"alwaysRaised=1,toolbar=0,scrollbars="+scroll+",menubar=0,screenX="+x+",left="+x+",screenY="+y+",top="+y+",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable="+resize+",status=0");
}
function pyramid() {
 window.open("/cricket/pyramid.html", "quiz", "height=540,width=720,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=20,left=10,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function tellafriend() {
 window.open("/cricket/tellafriend.html", "help", "height=350,width=630,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function beginner() {
 window.open("/cricket/beginner_1.html", "help", "height=450,width=630,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function faq() {
 window.open("/cricket/faq.html", "help", "height=500,width=690,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function terms() {
 window.open("/cricket/terms_pop.html", "terms", "height=600,width=700,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function feedback() {
 window.open("/cgi-bin/cricket/showtemplate.pl?template=feedback", "help", "height=350,width=630,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function infocups() {
 window.open("/cricket/help.html#gq42", "help", "height=500,width=690,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function fanspop() {
 window.open("/cgi-bin/cricket/fans.pl?pagenum=2", "fans", "height=630,width=650,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function fans1() {
 window.open("/cgi-bin/cricket/fans.pl", "fans1", "height=630,width=650,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function chat(u,s,c) {
 window.open("http://chat.cricketmanager.co.uk/cgi-bin/realchat.pl?username="+u+"&server="+s+"&cc="+c, "chat", "height=250,width=750,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}


//ref & weather pop up
//function ref() {
// window.open("/cgi-bin/cricket/umpire.pl?page={{refereeindex}}", "quiz", "height=340,width=680,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
//}
function weather_info() {
 window.open("/cgi-bin/cricket/showtemplate.pl?template=weather_info", "weather", "height=500,width=646,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function wicket_info() {
 window.open("/cgi-bin/cricket/showtemplate.pl?template=wicket_info", "wicket", "height=500,width=646,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}

//buddylist_*.html
function change(list) { 
if (list.options[list.selectedIndex].value == "null") {
 return true;
} else {
 location.href = list.options[list.selectedIndex].value
 }
}

//credits_index.html
function ivr_countries() {
 window.open("/cgi-bin/cricket/listnumbers.pl?type=ivr", "credits", "height=550,width=680,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sms_countries() {
 window.open("/cgi-bin/cricket/listnumbers.pl?type=sms", "credits", "height=420,width=680,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}

//fixturelist.html & fixtures_*.html
function resetgroupindex()
{
 document.options.division.value = 0;
 document.options.submit();
}

//teammanagement.html
function dochange(my_pos){
 my_select = "position" + my_pos;
 index     = "document.forms[0]."+my_select+".selectedIndex";
 index     = eval(index);
 value     = "document.forms[0]."+my_select+".options[index].value";
 my_value  = eval(value) - 1;
 var positions = new Array();
 var position  = 0;
 // Find the select that has my_value
 num_selects = 0;
 for (i = 0; i < document.forms[0].elements.length; i++) {
  select = document.forms[0].elements[i].name;
  if (select.substring(0,8) == "position") {
        num_selects++;
        pos      = select.substring(8,select.length);
        index    = "document.forms[0]."+select+".selectedIndex";
        index    = eval(index);
        value    = "document.forms[0]."+select+".options[index].value";
        value    = eval(value) - 1;
     // Now store the values in an array
     positions[position] = value;
     position++;
     // The select that we want to set
     if (value == my_value && select != my_select) { 
        target_select = select;
     }
  }
 }
 // Find the missing value since two will be duplicated
 missing = 0;
 for (i = 0; i < num_selects; i++) {

   used = 0;
   for (j = 0; j < num_selects; j++) {
     if (positions[j] == i) {
         used = 1;
     }
   }
   if (used == 0) {
       missing = i;
   }
 }
  eval("document.forms[0]."+target_select+".selectedIndex="+missing);
  return true;
} 

function dobatchange(my_pos){
 my_select = "position" + my_pos;
 index     = "document.forms[0]."+my_select+".selectedIndex";
 index     = eval(index);
 value     = "document.forms[0]."+my_select+".options[index].value";
 my_value  = eval(value);
 //alert(my_select+" index "+index+" = "+my_value);
 var positions = new Array();
 var position  = 0;
 // Find the select that has my_value
 num_selects = 0;
 for (i = 0; i < document.forms[0].elements.length; i++) {
  select = document.forms[0].elements[i].name;
  if (select.substring(0,8) == "position") {
        num_selects++;
        pos      = select.substring(8,select.length);
        index    = "document.forms[0]."+select+".selectedIndex";
        index    = eval(index);
        value    = "document.forms[0]."+select+".options[index].value";
        value    = eval(value);
     // Now store the values in an array
     positions[position] = value;
     position++;
     // The select that we want to set
     if (value == my_value && select != my_select) { 
        target_select = select;
     }
  }
 }
 // Find the missing value since two will be duplicated
 missing = 0;
 for (i = 0; i < num_selects; i++) {
   used = 0;
   for (j = 0; j < num_selects; j++) {
     if (positions[j] == i) {
         used = 1;
     }
   }
   if (used == 0) {
       missing = i;
   }
 }
  eval("document.forms[0]."+target_select+".selectedIndex="+missing);
  return true;
} 

function dopitchchange(my_pos){
 my_select = "position" + (my_pos<10 ? "0" : "") + my_pos;
 index     = "document.forms[0]."+my_select+".selectedIndex";
 index     = eval(index);
 value     = "document.forms[0]."+my_select+".options[index].value";
 my_value  = eval(value);
 if ( my_value > 8 ) {
  my_value = my_value - 8;
 }
 //alert(my_select+"="+index+" "+value+"="+my_value);
 var positions = new Array();
 var position  = 0;
 // Find the select that has my_value
 num_selects = 0;
 for (i = 0; i < document.forms[0].elements.length; i++) {
  select = document.forms[0].elements[i].name;
  if (select.substring(0,8) == "position") {
   num_selects++;
   pos      = select.substring(8,select.length);
   index    = "document.forms[0]."+select+".selectedIndex";
   index    = eval(index);
   value    = "document.forms[0]."+select+".options[index].value";
   value    = eval(value);
   if ( value > 8 ) {
    value = value - 8;
   }
   //alert( "position "+position+"=value "+value );
   // Now store the values in an array
   positions[position] = value;
   position++;
   // The select that we want to set
   if (value == my_value && select != my_select) { 
    target_select = select;
    //alert(target_select);
   }
  }
 }
 // Find the missing value since two will be duplicated
 missing = 0;
 for (i = 0; i < num_selects; i++) {
   used = 0;
   for (j = 0; j < num_selects; j++) {
     if (positions[j] == i) {
         used = 1;
     }
   }
   if (used == 0) {
    missing = i;
   }
 }
 //alert(target_select+" "+missing);
 eval("document.forms[0]."+target_select+".selectedIndex="+missing);
 return true;
} 

//help pop ups
function sl_help() {
 window.open("/cricket/sl_help_ti.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_buddy() {
 window.open("/cricket/sl_help_buddy.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_training() {
 window.open("/cricket/sl_help_training.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_ri() {
 window.open("/cricket/sl_help_ri.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_waiver() {
 window.open("/cricket/sl_help_waiver.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_fixtures() {
 window.open("/cricket/sl_help_fixtures.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_exhibition() {
 window.open("/cricket/sl_help_exhibition.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_ko() {
 window.open("/cricket/sl_help_ko.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_div() {
 window.open("/cricket/sl_help_div.html", "quiz", "height=500,width=720,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=20,left=10,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_man() {
 window.open("/cricket/sl_help_man.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_online() {
 window.open("/cricket/sl_help_online.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_account() {
 window.open("/cricket/sl_help_account.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=100,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_system() {
 window.open("/cricket/sl_help_system.html", "quiz", "height=500,width=820,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=50,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_playerinfo() {
 window.open("/cricket/sl_help_playerinfo.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_view_message() {
 window.open("/cricket/sl_help_view_message.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_view_message_inbox() {
 window.open("/cricket/sl_help_view_message_inbox.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_np() {
 window.open("/cricket/sl_help_newplayer.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_teamdetails() {
 window.open("/cricket/sl_help_teamdetails.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_teamhistory() {
 window.open("/cricket/sl_help_history.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_tactics() {
 window.open("/cricket/sl_help_tactics.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_advanced_tactics() {
 window.open("/cricket/sl_help_advanced_tactics.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_teamlayout() {
 window.open("/cricket/sl_help_teamlayout.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_playertables() {
 window.open("/cricket/sl_help_playertables.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_teammanagement() {
 window.open("/cricket/sl_help_teammanagement.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_credits() {
 window.open("/cricket/sl_help_credits.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_matchreport() {
 window.open("/cricket/sl_help_matchreport.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_chat() {
 window.open("/cricket/sl_help_chat.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_forum() {
 window.open("/cricket/sl_help_forum.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_faq() {
 window.open("/cricket/sl_help_faq.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_feedback() {
 window.open("/cricket/sl_help_feedback.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function sl_help_tellafriend() {
 window.open("/cricket/sl_help_tellafriend.html", "quiz", "height=500,width=660,alwaysRaised=1,toolbar=0,scrollbars=1,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}

//screen shots
function screen_shots_teami() {
 window.open("/cricket/screen_shots_teami.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_change() {
 window.open("/cricket/screen_shots_change.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_teamm() {
 window.open("/cricket/screen_shots_teamm.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_tack() {
 window.open("/cricket/screen_shots_tack.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_adtack() {
 window.open("/cricket/screen_shots_adtack.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_train() {
 window.open("/cricket/screen_shots_train.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_tranf() {
 window.open("/cricket/screen_shots_tranf.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
function screen_shots_knocko() {
 window.open("/cricket/screen_shots_knocko.html", "quiz", "height=500,width=750,alwaysRaised=1,toolbar=0,scrollbars=0,menubar=0,screenX=120,left=50,screenY=20,top=10,,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,resizable=1,status=0");
}
