var _POPUP_FEATURES = 'location=0, statusbar=0, menubar=0, width=400, height=300';


function raw_popup(url, target) {

  
  features = _POPUP_FEATURES;
  var theWindow =
    window.open(url, target, features);
  theWindow.focus();
  return theWindow;
}

function link_popup(src) {
	
	
	var hi = src.getAttribute('href');
	var bye = src.getAttribute('target');
	
    raw_popup(src.getAttribute('href'), src.getAttribute('target'));

	
}

//popups 

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=1,resizable=1,width=910,height=2000');");
}


// JavaScript Document


//load everything before executing simpleSwapSetup script

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

addLoadEvent(function() {
   
    SimpleSwapSetup();
   
})


// swap images

function SimpleSwap(el,which){
   el.src=el.getAttribute(which||"origsrc"); 
}
 

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
    // preload image
    // comment the next two lines to disable image pre-loading
     x[i].oversrc_img = new Image();
     x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}


