// JavaScript Document
function change_vid(videoid, cim){
	document.getElementById("cim").innerHTML = cim;
	document.getElementById("vid").innerHTML = '<object width="400" height="223"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + videoid + '&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=' + videoid + '&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="223"></embed></object>';
	cufonize();
}

function change_pic(src,  cim, id){
	document.getElementById("actual").value = id;
	document.getElementById("vid").innerHTML = '<a href="javascript:next_pic();"><img src="' + src + '" /></a>';
	cufonize();
}

function change_ide(src,  cim, href){
	document.getElementById("cim").innerHTML = cim;
	document.getElementById("vid").innerHTML = '<a href="' + href + '" target="_blank"><img src="' + src + '" /></a>';
	cufonize();
}

function next_pic(){
	var actual = document.getElementById("actual").value;
	//alert(actual);
	var pictnum = document.getElementById("pictnum").value;
	if(((pictnum * 1) - 1) > (actual * 1)){
		a = (1 * actual) + 1;
	}else{
		a = 0;	
	}
	document.getElementById("actual").value = a;
	var next_src = document.getElementById("i" + a).value;
	document.getElementById("vid").innerHTML = '<a href="javascript:next_pic();"><img src="' + next_src + '" /></a>';
	cufonize();
}

jQuery(function( $ ){
	cufonize();
});
function cufonize(){
	Cufon.replace('h1', { fontFamily: 'mgh', color: '-linear-gradient(#4A79B9, #223C55)' });
	Cufon.replace('h2', { fontFamily: 'mgh' });
	Cufon.replace('h3', { fontFamily: 'mgh' });	
	Cufon.replace('#list b', { fontFamily: 'mgh' });	
}
function rep_inp_text(obj,txt){
	if(obj.value == txt){
		obj.value = "";	
	}
}
