function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function sendemail() {
	var msg = document.contactform.msg.value;
	var email = document.contactform.email.value;
	document.contactform.send.disabled=true; 
	document.contactform.send.value='Sending....';

    http.open('get', 'http://www.rogerwalsh.info/emailme.php?msg='+msg+'&email='+email+'&action=send');
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        var update = new Array();

        if(response.indexOf('|' != -1)) {
            update = response.split('|');
            document.getElementById(update[0]).innerHTML = update[1];
         
        }
    }
} 




$(document).ready(function(){

	var designPicSettings = {
		username: 'twistedonion',
		mode: 'album',		//-- can be: album, albums, latest (default: &quot;albums&quot;)
		album: "design02",		//-- specify an album id if mode is 'album', default: &quot;&quot;
		page: 1,		//-- default: 1, Set to page if mode is 'album' and you want to start at a certain page of the album when the page is loaded.
		photoSize: 800,		//-- Photo size to link to in the album (default: 800, supported: 200, 288, 320, 400, 512, 576, 640, 720, 800)
		maxResults: 12,		//-- Maximum amount of photo's per album page (default: 50)
		thumbSize: 32,		//-- specify thumbnail size of photo's (default: 72, supported (un)cropped: 32, 48, 64, 72, 144, 160 and uncropped only: 200, 288, 320, 400, 512, 576, 640, 720, 800) 
		thumbCrop: 1,		//-- crop the thumb of the photo's (default: 0, 1 = yes / 0 = no) cropping makes the thumbs square and gives consistent layout
		thumbCss: {'margin' : '5px','border' : '1px solid #efeeff'}, //-- override and add custom styles for the thumbs (see http://docs.jquery.com/CSS/css#properties for specification)
		showPhotoDate: true,
		popupExt: function(photos){
				photos.fancybox({
					'hideOnContentClick': false
				})
			}
	}

	
	$("#designContainer").pwi(designPicSettings);



	//LAST FM RSS

	jQuery.getFeed({
	   url: 'proxy.php?url=http://ws.audioscrobbler.com/2.0/user/twistedonion/recenttracks.rss',
	   success: function(feed) {
	   var html = '';
	    
	    for(var i = 0; i < feed.items.length && i < 10; i++) {
	    
	        var item = feed.items[i];
	        
	        html += '<li>'
	        + '<a href="'
	        + item.link
	        + '">'
	        + item.title
	        + '</a>'
	        + '</li>';
	    }
	    $("#lastDiv").html(html);
	
	   }
	}); 

	
	//DELICIOUS RSS
	jQuery.getFeed({
	   url: 'proxy.php?url=http://feeds.delicious.com/v2/rss/twistedonion/design?count=15',
	   success: function(feed) {
	   var html = '';
	    
	    for(var i = 0; i < feed.items.length && i < 10; i++) {
	    
	        var item = feed.items[i];
	        
	        html += '<li>'
	        + '<a href="'
	        + item.link
	        + '">'
	        + item.title
	        + '</a>'
	        + '</li>';
	    }
	    $("#deliciousDiv").html(html);
	
	   }
	}); 


});			

 
 

