function getValue(varname)
{
  // First, we load the URL into a variable
  var url = window.location.href;

  // Next, split the url by the ?
  var qparts = url.split("?");

  // Check that there is a querystring, return "" if not
  if (qparts.length === 0)
  {
    return "";
  }

  // Then find the querystring, everything after the ?
  var query = qparts[1];

  // Split the query string into variables (separates by &s)
  var vars = query.split("&");

  // Initialize the value with "" as default
  var value = "";

  // Iterate through vars, checking each one for varname
  for (i=0;i<vars.length;i++)
  {
    // Split the variable by =, which splits name and value
    var parts = vars[i].split("=");
    
    // Check if the correct variable
    if (parts[0] == varname)
    {
      // Load value into variable
      value = parts[1];

      // End the loop
      break;
    }
  }
  
  // Convert escape code
  value = unescape(value);

  // Convert "+"s to " "s
  value.replace(/\+/g," ");

  // Return the value
  return value;
}
function pagechange(){
	var a = 'anc';
	var b = 'VS';
	var c = 'name';
	var anchr = getValue(a);
	var voteyn = getValue(b);
	var name = getValue(c);
	if (voteyn=='Y'){
		alert('Thank you for rating '+name+'.');
} else if (voteyn=='N'){
		alert('Sorry, you have already reviewed '+name+'.');
}}

function starson(starh, id, se){
		switch(starh){
case 1:
document.getElementById('UserRating1'+se+id).src="IMG/starhover.gif";
break;
case 2:
document.getElementById('UserRating1'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating2'+se+id).src="IMG/starhover.gif";
break;
case 4:
document.getElementById('UserRating1'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating2'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating3'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating4'+se+id).src="IMG/starhover.gif";
break;
case 5:
document.getElementById('UserRating1'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating2'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating3'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating4'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating5'+se+id).src="IMG/starhover.gif";
break;
default :
document.getElementById('UserRating1'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating2'+se+id).src="IMG/starhover.gif";
document.getElementById('UserRating3'+se+id).src="IMG/starhover.gif";
}}

function starsoff(rate, id, se){

		switch(rate){
case 1:
document.getElementById('UserRating1'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating2'+se+id).src="IMG/staroff.gif";
document.getElementById('UserRating3'+se+id).src="IMG/staroff.gif";
document.getElementById('UserRating4'+se+id).src="IMG/staroff.gif";
document.getElementById('UserRating5'+se+id).src="IMG/staroff.gif";
break;
case 2:
document.getElementById('UserRating1'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating2'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating3'+se+id).src="IMG/staroff.gif";
document.getElementById('UserRating4'+se+id).src="IMG/staroff.gif";
document.getElementById('UserRating5'+se+id).src="IMG/staroff.gif";
break;
case 4:
document.getElementById('UserRating1'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating2'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating3'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating4'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating5'+se+id).src="IMG/staroff.gif";
break;
case 5:
document.getElementById('UserRating1'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating2'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating3'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating4'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating5'+se+id).src="IMG/staron.gif";
break;
default :
document.getElementById('UserRating1'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating2'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating3'+se+id).src="IMG/staron.gif";
document.getElementById('UserRating4'+se+id).src="IMG/staroff.gif";
document.getElementById('UserRating5'+se+id).src="IMG/staroff.gif";
}}

function setrate(val, id, name, se){
	var yn = confirm("You can only review each link once. Please confirm "+val+" star review for "+name+".");
	if (yn=== true){
    var ind = 'formrate' + se + id;
	var sr = 'starrate' + id;
	var it = 'itemid' + id;
	document.forms[ind].starrate.value=val;
	document.forms[ind].itemid.value=id;
	document.forms[ind].submit();
}}

function toggle(divid){
	var ele=document.getElementById(divid);
	if (ele.style.display=="block"){
	ele.style.display="none";
}else{ele.style.display="block";}}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter){
Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function sitesuggestions(){
	window.location = 'Guides.php5';			
}

function linksuggestions(){
	window.location = 'Guides.php5';
}

<!-- ADDTHIS BUTTON BEGIN -->
var addthis_config = {
     username: "Oddball-Links"
}

function setHomepage(){
	if (document.all){
//For IE
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.oddball-links.com');
}else if(window.sidebar){
if(window.netscape)
{try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}
catch(e){
alert("Sorry, your browser says No! You'll have to do it manually. Tools>Options>Main in Firefox");
}}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage','http://www.oddball-links.com');
}} 

<!-- ADDTHIS BUTTON END -->

function winNameClear(){
	window.name='Oddball';
}


	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-XXXXX-X']);
	_gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



